More complete Hpkg support in CMake/CPack

* This works well enough to get hpkg files of HaikuWebkit
 * Packages can be used in Haiku build for a Network Kit Web+
This commit is contained in:
Adrien Destugues
2013-10-24 09:25:47 +02:00
parent c0ac90b86c
commit 1c9af8d9b6
2 changed files with 386 additions and 37 deletions

View File

@@ -10,7 +10,7 @@ LICENSE="CMake"
COPYRIGHT="2002-2013 Kitware, Inc., Insight Consortium, All rights reserved."
SRC_URI="http://www.cmake.org/files/v2.8/cmake-2.8.11.2.tar.gz"
CHECKSUM_MD5="6f5d7b8e7534a5d9e1a7664ba63cf882"
REVISION="2"
REVISION="3"
ARCHITECTURES="?x86_gcc2 ?x86 ?x86_64"
PROVIDES="

View File

@@ -657,12 +657,315 @@ index 0000000..6b868bb
1.8.3.4
From 43ea4f564927235c5131d28d320dd90d09e5e852 Mon Sep 17 00:00:00 2001
From 9721c802a88d20b2f724909e6cce07295002bedd Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Thu, 17 Oct 2013 19:35:25 +0200
Subject: CPack: add Haiku hpkg support
diff --git a/Modules/CPackHpkg.cmake b/Modules/CPackHpkg.cmake
new file mode 100644
index 0000000..3308889
--- /dev/null
+++ b/Modules/CPackHpkg.cmake
@@ -0,0 +1,297 @@
+##section Variables specific to CPack Haiku (HPKG) generator
+##end
+##module
+# - The builtin (binary) CPack Haiku generator (Haiku only)
+# CPackHaiku may be used to create Haiku packages using CPack.
+# CPackHaiku is a CPack generator thus it uses the CPACK_XXX variables
+# used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration.
+# CPackHaiku will work only on haiku as it uss the 'package' tool available
+# there. With the custom archive format and compression algorithm, there is
+# currently no better way.
+#
+# CPackHaiku has specific features which are controlled by
+# the specifics CPACK_HAIKU_XXX variables.You'll find a detailed usage on
+# the wiki:
+# http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#HAIKU_.28HAIKU_only.29
+# However as a handy reminder here comes the list of specific variables:
+##end
+#
+##variable
+# CPACK_HAIKU_PACKAGE_NAME
+# Mandatory : YES
+# Default : CPACK_PACKAGE_NAME (lower case)
+# The haiku package name
+##end
+##variable
+# CPACK_HAIKU_PACKAGE_VERSION
+# Mandatory : YES
+# Default : CPACK_PACKAGE_VERSION
+# The haiku package version
+##end
+##variable
+# CPACK_HAIKU_PACKAGE_REVISION
+# Mandatory : YES
+# Default : 1
+# The haiku package version
+##end
+##variable
+# CPACK_HAIKU_PACKAGE_ARCHITECTURE
+# Mandatory : YES
+# Default : $ENV{BE_SYSTEM_CPU}, or x86_gcc2 if using gcc2.
+# The haiku package architecture
+##end
+##variable
+# CPACK_HAIKU_PACKAGE_PACKAGER
+# Mandatory : YES
+# Default : CPACK_PACKAGE_CONTACT
+# The haiku package maintainer e-mail address
+##end
+##variable
+# CPACK_HAIKU_PACKAGE_VENDOR
+# Mandatory : YES
+# Default : CPACK_PACKAGE_VENDOR
+# The haiku package vendor
+##end
+##variable
+# CPACK_HAIKU_PACKAGE_DESCRIPTION
+# Mandatory : YES
+# Default : CPACK_PACKAGE_DESCRIPTION
+# The haiku package description
+##end
+##variable
+# CPACK_HAIKU_PACKAGE_DESCRIPTION_SUMMARY
+# Mandatory : YES
+# Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY
+# The haiku package one-line description
+##end
+##variable
+# CPACK_HAIKU_PACKAGE_COPYRIGHT
+# Mandatory : YES
+# Default : -
+# The haiku package copyright holders
+##end
+##variable
+# CPACK_HAIKU_PACKAGE_LICENSES
+# Mandatory : YES
+# Default : -
+# The haiku package licenses. This must be available in /system/data/licenses,
+# either provided by the package or one of the system-provided licenses.
+##end
+##variable
+# CPACK_HAIKU_PACKAGE_URL
+# Mandatory : NO
+# Default : -
+# The URL of the web site for this package, preferably (when applicable) the
+# site from which the original source can be obtained and any additional
+# upstream documentation or information may be found.
+# The content of this field is a simple URL without any surrounding
+# characters such as <>.
+##end
+##variable
+# CPACK_HAIKU_PACKAGE_DEBUG
+# Mandatory : NO
+# Default : -
+# May be set when invoking cpack in order to trace debug information
+# during CPackHpkg run.
+##end
+##variable
+# CPACK_HAIKU_PACKAGE_PREREQUIRES
+# Mandatory : NO
+# Default : -
+# This is similar to REQUIRES, but the package will not be rebuilt. This
+# makes it possible to have circular dependencies between prerequired
+# packages
+##end
+##variable
+# CPACK_HAIKU_PACKAGE_SUPPLEMENTS
+# Mandatory : NO
+# Default : -
+# This field allow adding functionality to an existing package. This will
+# be made visible to the original package in its private directory.
+# It is used to declare that a package can enhance the functionality of another package.
+##end
+##variable
+# CPACK_HAIKU_PACKAGE_CONFLICTS
+# Mandatory : NO
+# Default : -
+# When one binary package declares a conflict with another using a Conflicts field,
+# Haiku will refuse to allow them to be installed on the system at the same time.
+##end
+##variable
+# CPACK_HAIKU_PACKAGE_CONTROL_EXTRA
+# Mandatory : NO
+# Default : -
+# This variable allow advanced user to add other entries to the .PackageInfo file
+##end
+##variable
+# CPACK_HAIKU_<COMPONENT_>PACKAGE_PROVIDES
+# Mandatory : YES
+# Default : -
+# List of provided entries for the package, with version constraints.
+# There should be an entry for each binary, application, library and add-on
+# provided by the package. The packages always provides itself, there is no
+# need for explicitly mentionning it in this variable.
+##end
+##variable
+# CPACK_HAIKU_<COMPONENT_>PACKAGE_REQUIRES
+# Mandatory : NO
+# Default : -
+# May be used to set package dependencies.
+##end
+
+
+#=============================================================================
+# Copyright 2007-2013 Kitware, Inc.
+# Copyright 2007-2009 Mathieu Malaterre <mathieu.malaterre@gmail.com>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# CPack script for creating Haiku packages
+# Author: Adrien Destugues
+#
+# http://wiki.debian.org/HowToPackageForDebian
+
+if(CMAKE_BINARY_DIR)
+ message(FATAL_ERROR "CPackHpkg.cmake may only be used by CPack internally.")
+endif()
+
+if(NOT HAIKU)
+ message(FATAL_ERROR "CPackHpkg.cmake may only be used under Haiku.")
+endif()
+
+find_program(FAKEROOT_EXECUTABLE fakeroot)
+if(FAKEROOT_EXECUTABLE)
+ set(CPACK_DEBIAN_FAKEROOT_EXECUTABLE ${FAKEROOT_EXECUTABLE})
+endif()
+
+
+# Let's define the .PackageInfo file found in haiku package:
+
+# Package: (mandatory)
+if(NOT CPACK_HAIKU_PACKAGE_NAME)
+ string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_HAIKU_PACKAGE_NAME)
+ string(REPLACE "_unspecified" "" CPACK_HAIKU_PACKAGE_NAME
+ "${CPACK_HAIKU_PACKAGE_NAME}")
+endif()
+
+# Version: (mandatory)
+if(NOT CPACK_HAIKU_PACKAGE_VERSION)
+ if(NOT CPACK_PACKAGE_VERSION)
+ message(FATAL_ERROR "CPackHpkg: Haiku package requires a package version")
+ endif()
+ set(CPACK_HAIKU_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
+endif()
+
+# Revision: (mandatory)
+if(NOT CPACK_HAIKU_PACKAGE_REVISION)
+ set(CPACK_HAIKU_PACKAGE_REVISION 1)
+endif()
+
+# Architecture: (mandatory)
+if(NOT CPACK_HAIKU_PACKAGE_ARCHITECTURE)
+ if(CMAKE_C_COMPILER_VERSION VERSION_LESS 3.0)
+ set(CPACK_HAIKU_PACKAGE_ARCHITECTURE "x86_gcc2")
+ else()
+ set(CPACK_HAIKU_PACKAGE_ARCHITECTURE $ENV{BE_HOST_CPU})
+ endif()
+endif()
+
+# have a look at get_property(result GLOBAL PROPERTY ENABLED_FEATURES),
+# this returns the successful find_package() calls, maybe this can help
+# Depends:
+# You should set: DEBIAN_PACKAGE_DEPENDS
+# TODO: automate 'objdump -p | grep NEEDED'
+if(NOT CPACK_HAIKU_PACKAGE_DEPENDS)
+ message(STATUS "CPACK_HAIKU_PACKAGE_DEPENDS not set, the package will have no dependencies.")
+endif()
+
+# Maintainer: (mandatory)
+if(NOT CPACK_HAIKU_PACKAGE_PACKAGER)
+ if(NOT CPACK_PACKAGE_CONTACT)
+ message(FATAL_ERROR "CPackHpkg: Haiku package requires a maintainer, set CPACK_PACKAGE_CONTACT or CPACK_HAIKU_PACKAGE_PACKAGER")
+ endif()
+ set(CPACK_HAIKU_PACKAGE_MAINTAINER ${CPACK_PACKAGE_PACKAGER})
+endif()
+
+# Vendor: (mandatory)
+if(NOT CPACK_HAIKU_PACKAGE_VENDOR)
+ if(NOT CPACK_PACKAGE_VENDOR)
+ message(FATAL_ERROR "CPackHpkg: Haiku package requires a vendor, set CPACK_PACKAGE_VENDOR or CPACK_HAIKU_PACKAGE_VENDOR")
+ endif()
+ set(CPACK_HAIKU_PACKAGE_VENDOR ${CPACK_PACKAGE_VENDOR})
+endif()
+
+# Copyright: (mandatory)
+if(NOT CPACK_HAIKU_PACKAGE_COPYRIGHT)
+ message(FATAL_ERROR "CPackHaiku: Haiku package requires a copyright for a package, set CPACK_HAIKU_PACKAGE_COPYRIGHT")
+endif()
+
+# License: (mandatory)
+if(NOT CPACK_HAIKU_PACKAGE_LICENSES)
+ message(FATAL_ERROR "CPackHaiku: Haiku package requires a copyright for a package, set CPACK_HAIKU_PACKAGE_LICENSES")
+endif()
+
+# Description: (mandatory)
+if(NOT CPACK_HAIKU_PACKAGE_DESCRIPTION)
+ if(NOT CPACK_PACKAGE_DESCRIPTION)
+ message(FATAL_ERROR "CPackHaiku: Haiku package requires a description for a package, set CPACK_PACKAGE_DESCRIPTION or CPACK_HAIKU_PACKAGE_DESCRIPTION")
+ endif()
+ set(CPACK_HAIKU_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION})
+endif()
+
+# Summary: (mandatory)
+if(NOT CPACK_HAIKU_PACKAGE_DESCRIPTION_SUMMARY)
+ if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+ message(FATAL_ERROR "CPackHaiku: Haiku package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_HAIKU_PACKAGE_DESCRIPTION_SUMMARY")
+ endif()
+ set(CPACK_HAIKU_PACKAGE_DESCRIPTION_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
+endif()
+
+# Provides: (mandatory)
+if(NOT CPACK_HAIKU_PACKAGE_PROVIDES)
+ set(CPACK_HAIKU_PACKAGE_PROVIDES ${CPACK_HAIKU_PACKAGE_NAME})
+else()
+ set(CPACK_HAIKU_PACKAGE_PROVIDES ${CPACK_HAIKU_PACKAGE_NAME} ${CPACK_HAIKU_PACKAGE_PROVIDES})
+endif()
+
+# CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
+# This variable allow advanced user to add custom script to the control.tar.gz (inside the .deb archive)
+# Typical examples are:
+# - conffiles
+# - postinst
+# - postrm
+# - prerm"
+# Usage:
+# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
+# "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
+
+# Are we packaging components ?
+if(CPACK_HAIKU_PACKAGE_COMPONENT)
+ set(CPACK_HAIKU_PACKAGE_COMPONENT_PART_NAME "_${CPACK_HAIKU_PACKAGE_COMPONENT}")
+ string(TOLOWER "${CPACK_PACKAGE_NAME}${CPACK_HAIKU_PACKAGE_COMPONENT_PART_NAME}" CPACK_HAIKU_PACKAGE_NAME)
+else()
+ set(CPACK_HAIKU_PACKAGE_COMPONENT_PART_NAME "")
+endif()
+
+set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_HAIKU_PACKAGE_COMPONENT_PART_PATH}")
+
+# Print out some debug information if we were asked for that
+if(CPACK_HAIKU_PACKAGE_DEBUG)
+ message("CPackHpkg:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}")
+ message("CPackHpkg:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}")
+ message("CPackHpkg:Debug: CPACK_TEMPORARY_DIRECTORY = ${CPACK_TEMPORARY_DIRECTORY}")
+ message("CPackHpkg:Debug: CPACK_OUTPUT_FILE_NAME = ${CPACK_OUTPUT_FILE_NAME}")
+ message("CPackHpkg:Debug: CPACK_OUTPUT_FILE_PATH = ${CPACK_OUTPUT_FILE_PATH}")
+ message("CPackHpkg:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}")
+ message("CPackHpkg:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
+ message("CPackHpkg:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
+endif()
+
diff --git a/Source/CPack/cmCPackGeneratorFactory.cxx b/Source/CPack/cmCPackGeneratorFactory.cxx
index b36c2a2..7d8f8a5 100644
--- a/Source/CPack/cmCPackGeneratorFactory.cxx
@@ -694,10 +997,10 @@ index b36c2a2..7d8f8a5 100644
//----------------------------------------------------------------------
diff --git a/Source/CPack/cmCPackHpkgGenerator.cxx b/Source/CPack/cmCPackHpkgGenerator.cxx
new file mode 100644
index 0000000..b29e1c0
index 0000000..f4933cf
--- /dev/null
+++ b/Source/CPack/cmCPackHpkgGenerator.cxx
@@ -0,0 +1,472 @@
@@ -0,0 +1,509 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
@@ -738,10 +1041,12 @@ index 0000000..b29e1c0
+//----------------------------------------------------------------------
+int cmCPackHpkgGenerator::InitializeInternal()
+{
+ this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/boot/system");
+ if (cmSystemTools::IsOff(this->GetOption("CPACK_SET_DESTDIR")))
+ // Haiku packages are "rootless": the hierarchy inside them is relative to
+ // the package mount/install point.
+ this->SetOption("CPACK_PACKAGING_INSTALL_PREFIX", NULL);
+ if (cmSystemTools::IsOn(this->GetOption("CPACK_SET_DESTDIR")))
+ {
+ this->SetOption("CPACK_SET_DESTDIR", "I_ON");
+ this->SetOption("CPACK_SET_DESTDIR", "I_OFF");
+ }
+ return this->Superclass::InitializeInternal();
+}
@@ -761,6 +1066,9 @@ index 0000000..b29e1c0
+ +"_"+packageName + this->GetOutputExtension()
+ );
+
+ cmCPackLogger(cmCPackLog::LOG_DEBUG,
+ "Packaging " << outputFileName << std::endl);
+
+ localToplevel += "/"+ packageName;
+ /* replace the TEMP DIRECTORY with the component one */
+ this->SetOption("CPACK_TEMPORARY_DIRECTORY",localToplevel.c_str());
@@ -771,11 +1079,11 @@ index 0000000..b29e1c0
+ this->SetOption("CPACK_TEMPORARY_PACKAGE_FILE_NAME",
+ packageFileName.c_str());
+ // Tell CPackHpkg.cmake the name of the component GROUP.
+ this->SetOption("CPACK_DEB_PACKAGE_COMPONENT",packageName.c_str());
+ this->SetOption("CPACK_HAIKU_PACKAGE_COMPONENT",packageName.c_str());
+ // Tell CPackHpkg.cmake the path where the component is.
+ std::string component_path = "/";
+ component_path += packageName;
+ this->SetOption("CPACK_DEB_PACKAGE_COMPONENT_PART_PATH",
+ this->SetOption("CPACK_HAIKU_PACKAGE_COMPONENT_PART_PATH",
+ component_path.c_str());
+ if (!this->ReadListFile("CPackHpkg.cmake"))
+ {
@@ -797,7 +1105,7 @@ index 0000000..b29e1c0
+ }
+ packageFiles = gl.GetFiles();
+
+ int res = createHpkg();
+ int res = createHpkg(packageName);
+ if (res != 1)
+ {
+ retval = 0;
@@ -816,6 +1124,9 @@ index 0000000..b29e1c0
+ packageFileNames.clear();
+ std::string initialTopLevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY"));
+
+ cmCPackLogger(cmCPackLog::LOG_DEBUG,
+ "Packaging in components mode" << std::endl);
+
+ // The default behavior is to have one package by component group
+ // unless CPACK_COMPONENTS_IGNORE_GROUP is specified.
+ if (!ignoreGroup)
@@ -852,6 +1163,9 @@ index 0000000..b29e1c0
+ // We build 1 package per component
+ else
+ {
+ cmCPackLogger(cmCPackLog::LOG_DEBUG,
+ "Groups are ignored" << std::endl);
+
+ std::map<std::string, cmCPackComponent>::iterator compIt;
+ for (compIt=this->Components.begin();
+ compIt!=this->Components.end(); ++compIt )
@@ -879,6 +1193,9 @@ index 0000000..b29e1c0
+ "(CPACK_COMPONENTS_ALL_[GROUPS_]IN_ONE_PACKAGE is set)"
+ << std::endl);
+
+ cmCPackLogger(cmCPackLog::LOG_DEBUG,
+ "Packaging in all-in-one mode" << std::endl);
+
+ // The ALL GROUPS in ONE package case
+ std::string localToplevel(initialTopLevel);
+ std::string packageFileName(
@@ -902,7 +1219,7 @@ index 0000000..b29e1c0
+ // Tell CPackHpkg.cmake the path where the component is.
+ std::string component_path = "/";
+ component_path += compInstDirName;
+ this->SetOption("CPACK_DEB_PACKAGE_COMPONENT_PART_PATH",
+ this->SetOption("CPACK_HPKG_PACKAGE_COMPONENT_PART_PATH",
+ component_path.c_str());
+ if (!this->ReadListFile("CPackHpkg.cmake"))
+ {
@@ -976,19 +1293,25 @@ index 0000000..b29e1c0
+ return retval;
+}
+
+int cmCPackHpkgGenerator::createHpkg()
+int cmCPackHpkgGenerator::createHpkg(std::string packageName)
+{
+ const char* cmakeExecutable = this->GetOption("CMAKE_COMMAND");
+
+ // control file
+ // .PackageInfo file
+ std::string infofilename;
+ infofilename = this->GetOption("WDIR");
+ infofilename += "/.PackageInfo";
+
+ std::string haiku_pkg_id = this->GetOption("CPACK_HAIKU_PACKAGE_NAME");
+ if(packageName == "Unspecified") {
+ // Remove package specifier for the "unspecified" package
+ haiku_pkg_id.erase(haiku_pkg_id.length() - packageName.length() - 1);
+ packageName = "";
+ } else if(packageName.length() > 0) {
+ packageName += "_";
+ }
+ // haiku policy enforce lower case for package name
+ std::string haiku_pkg_name = cmsys::SystemTools::LowerCase(haiku_pkg_id);
+
+ // mandatory entries:
+ std::string haiku_pkg_name = cmsys::SystemTools::LowerCase(
+ this->GetOption("CPACK_HAIKU_PACKAGE_NAME") );
+ const char* haiku_pkg_version =
+ this->GetOption("CPACK_HAIKU_PACKAGE_VERSION");
+ const char* haiku_pkg_revision =
@@ -1003,16 +1326,20 @@ index 0000000..b29e1c0
+ const char* haiku_pkg_licenses =
+ this->GetOption("CPACK_HAIKU_PACKAGE_LICENSES");
+
+ // component-specific entries
+ std::string pkg_requires_option = "CPACK_HAIKU_" + packageName
+ + "PACKAGE_REQUIRES";
+ const char* haiku_pkg_dep = this->GetOption(pkg_requires_option.c_str());
+ std::string pkg_provides_option = "CPACK_HAIKU_" + packageName
+ + "PACKAGE_PROVIDES";
+ const char* haiku_pkg_provides = this->GetOption(pkg_provides_option.c_str());
+
+ // optional entries
+ const char* haiku_pkg_dep = this->GetOption("CPACK_HAIKU_PACKAGE_DEPENDS");
+ const char* haiku_pkg_url =
+ this->GetOption("CPACK_HAIKU_PACKAGE_HOMEPAGE");
+ const char* haiku_pkg_url = this->GetOption("CPACK_HAIKU_PACKAGE_HOMEPAGE");
+ const char* haiku_pkg_enhances =
+ this->GetOption("CPACK_HAIKU_PACKAGE_ENHANCES");
+ const char* haiku_pkg_conflicts =
+ this->GetOption("CPACK_HAIKU_PACKAGE_CONFLICTS");
+ const char* haiku_pkg_provides =
+ this->GetOption("CPACK_HAIKU_PACKAGE_PROVIDES");
+ const char* haiku_pkg_replaces =
+ this->GetOption("CPACK_HAIKU_PACKAGE_REPLACES");
+
@@ -1023,7 +1350,16 @@ index 0000000..b29e1c0
+ out << "architecture " << haiku_pkg_arch << "\n";
+ if(haiku_pkg_dep && *haiku_pkg_dep)
+ {
+ out << "requires " << haiku_pkg_dep << "\n";
+ out << "requires {";
+ std::vector<std::string> requiresList;
+ cmSystemTools::ExpandListArgument(haiku_pkg_dep, requiresList);
+ for(std::vector<std::string>::iterator i =
+ requiresList.begin(); i != requiresList.end(); ++i)
+ {
+ out << *i << "\n";
+ }
+
+ out << "}\n";
+ }
+ if(haiku_pkg_url && *haiku_pkg_url)
+ {
@@ -1041,8 +1377,17 @@ index 0000000..b29e1c0
+ {
+ out << "replaces " << haiku_pkg_replaces << "\n";
+ }
+ out << "provides {" << haiku_pkg_provides << "}\n";
+ out << "copyrights {\"" << copyrights << "\"}\n";
+
+ out << "provides {";
+ std::vector<std::string> providesList;
+ cmSystemTools::ExpandListArgument(haiku_pkg_provides, providesList);
+ for(std::vector<std::string>::iterator i =
+ providesList.begin(); i != providesList.end(); ++i)
+ {
+ out << *i << "\n";
+ }
+
+ out << "}\n";
+
+ out << "licenses {";
+ std::vector<std::string> licensesList;
@@ -1054,8 +1399,10 @@ index 0000000..b29e1c0
+ }
+
+ out << "}\n";
+
+ out << "copyrights {\"" << copyrights << "\"}\n";
+ out << "packager " << maintainer << "\n";
+ out << "vendor " << vendor << "\n";
+ out << "vendor \"" << vendor << "\"\n";
+ out << "summary \"" << summary << "\"\n";
+ out << "description \"" << desc << "\"\n";
+ out << std::endl;
@@ -1135,14 +1482,7 @@ index 0000000..b29e1c0
+
+bool cmCPackHpkgGenerator::SupportsComponentInstallation() const
+ {
+ if (IsOn("CPACK_HAIKU_COMPONENT_INSTALL"))
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ return true;
+ }
+
+std::string cmCPackHpkgGenerator::GetComponentInstallDirNameSuffix(
@@ -1172,10 +1512,10 @@ index 0000000..b29e1c0
+
diff --git a/Source/CPack/cmCPackHpkgGenerator.h b/Source/CPack/cmCPackHpkgGenerator.h
new file mode 100644
index 0000000..36e6e78
index 0000000..ffa803d
--- /dev/null
+++ b/Source/CPack/cmCPackHpkgGenerator.h
@@ -0,0 +1,73 @@
@@ -0,0 +1,82 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2013 Kitware, Inc.
@@ -1238,12 +1578,21 @@ index 0000000..36e6e78
+ int PackageComponentsAllInOne();
+ virtual int PackageFiles();
+ virtual const char* GetOutputExtension() { return ".hpkg"; }
+ virtual enum CPackSetDestdirSupport SupportsSetDestdir() const
+ {
+ return SETDESTDIR_UNSUPPORTED;
+ }
+
+ virtual bool SupportsAbsoluteDestination() const
+ {
+ return false;
+ }
+ virtual bool SupportsComponentInstallation() const;
+ virtual std::string GetComponentInstallDirNameSuffix(
+ const std::string& componentName);
+
+private:
+ int createHpkg();
+ int createHpkg(std::string packageName = "");
+ std::vector<std::string> packageFiles;
+
+};