summaryrefslogtreecommitdiffstats
path: root/Utilities/Release/Cygwin
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2007-02-02 19:40:26 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2007-02-02 19:40:26 (GMT)
commit4925e64b97b46b7248b7fe7ffa9fb215ca2d460f (patch)
tree9f5590a4240a1abc5762dcfdcca4faaf544b7d66 /Utilities/Release/Cygwin
parent1feb4a09b078452c42e74a1caeb432f6ccc7da68 (diff)
downloadCMake-4925e64b97b46b7248b7fe7ffa9fb215ca2d460f.zip
CMake-4925e64b97b46b7248b7fe7ffa9fb215ca2d460f.tar.gz
CMake-4925e64b97b46b7248b7fe7ffa9fb215ca2d460f.tar.bz2
ENH: add support for cygwin source and binary packaging
Diffstat (limited to 'Utilities/Release/Cygwin')
-rw-r--r--Utilities/Release/Cygwin/CMakeLists.txt4
-rw-r--r--Utilities/Release/Cygwin/README.cygwin.in12
-rwxr-xr-xUtilities/Release/Cygwin/cygwin-package.sh.in103
3 files changed, 98 insertions, 21 deletions
diff --git a/Utilities/Release/Cygwin/CMakeLists.txt b/Utilities/Release/Cygwin/CMakeLists.txt
index 24f529b..0c274f3 100644
--- a/Utilities/Release/Cygwin/CMakeLists.txt
+++ b/Utilities/Release/Cygwin/CMakeLists.txt
@@ -14,9 +14,9 @@ MESSAGE(STATUS "Using curses version: libncurses${MAX}")
CONFIGURE_FILE("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-setup.hint.in"
"${CMake_BINARY_DIR}/setup.hint")
CONFIGURE_FILE("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/README.cygwin.in"
- "${CMake_BINARY_DIR}/Docs/@CYGWIN_PACKAGE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.README")
+ "${CMake_BINARY_DIR}/Docs/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.README")
INSTALL_FILES(/share/doc/Cygwin FILES
- ${CMake_BINARY_DIR}/Docs/@CYGWIN_PACKAGE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.README
+ ${CMake_BINARY_DIR}/Docs/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.README
)
CONFIGURE_FILE("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-package.sh.in"
${CPACK_CYGWIN_BUILD_SCRIPT})
diff --git a/Utilities/Release/Cygwin/README.cygwin.in b/Utilities/Release/Cygwin/README.cygwin.in
index 10a253b..6c42a4c 100644
--- a/Utilities/Release/Cygwin/README.cygwin.in
+++ b/Utilities/Release/Cygwin/README.cygwin.in
@@ -16,22 +16,22 @@ Canonical download:
------------------------------------
Build instructions:
- unpack @CYGWIN_SRC_PACKAGE_NAME@.tar.bz2
+ unpack @CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@-src.tar.bz2
if you use setup to install this src package, it will be
unpacked under /usr/src automatically
cd /usr/src
- ./@CYGWIN_PACKAGE_NAME@.sh
+ ./@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.sh all
This will create:
- /usr/src/@CYGWIN_PACKAGE_NAME@.tar.bz2
- /usr/src/@CYGWIN_SRC_PACKAGE_NAME@.tar.bz2
+ /usr/src/@CPACK_PACKAGE_FILE_NAME@.tar.bz2
+ /usr/src/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@-src.tar.bz2
-------------------------------------------
Port Notes:
-The directory /usr/share/@CPACK_CYGWIN_NAME@/include is purposely not
-located at /usr/include/@CPACK_CYGWIN_NAME@ or /usr/include/cmake. The
+The directory /usr/share/@CPACK_PACKAGE_FILE_NAME@/include is purposely not
+located at /usr/include/@CPACK_PACKAGE_FILE_NAME@ or /usr/include/cmake. The
files it contains are not meant for inclusion in any C or C++ program.
They are used for compiling dynamically loadable CMake commands inside
projects that provide them. CMake will automatically provide the
diff --git a/Utilities/Release/Cygwin/cygwin-package.sh.in b/Utilities/Release/Cygwin/cygwin-package.sh.in
index 0ce7b7e..9730b33 100755
--- a/Utilities/Release/Cygwin/cygwin-package.sh.in
+++ b/Utilities/Release/Cygwin/cygwin-package.sh.in
@@ -1,13 +1,90 @@
-tdir=`pwd`
-tar xvfj @CYGWIN_SRC_PACKAGE_NAME@.tar.bz2 &&
-cd @CYGWIN_SRC_PACKAGE_NAME@ &&
-mkdir .build &&
-cd .build &&
-../bootstrap --parallel=2 &&
-make -j2 &&
-make test &&
-./bin/cpack &&
-./bin/cpack --config CPackSourceConfig.cmake
-
-mv @CYGWIN_SRC_PACKAGE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@-src.tar.bz2 "$tdir"
-mv @CYGWIN_PACKAGE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.tar.bz2 "$tdir"
+TOP_DIR=`cd \`echo "$0" | sed -n '/\//{s/\/[^\/]*$//;p;}'\`;pwd`
+
+# create build directory
+mkdirs()
+{
+ (
+ mkdir -p "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build"
+ )
+}
+
+# cd into
+# untar source tree and apply patch
+prep()
+{
+ (
+ cd "$TOP_DIR" &&
+ tar xvfj @CPACK_PACKAGE_FILE_NAME@.tar.bz2
+ patch -p0 < "@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.patch" &&
+ mkdirs
+ )
+}
+
+conf()
+{
+ (
+ cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
+ ../bootstrap --parallel=2
+ )
+}
+
+build()
+{
+ (
+ cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
+ make -j2 &&
+ make test
+ )
+}
+
+clean()
+{
+ (
+ cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
+ make clean
+ )
+}
+
+pkg()
+{
+ (
+ cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
+ ./bin/cpack &&
+ mv @CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.tar.bz2 "$TOP_DIR"
+ )
+}
+
+spkg()
+{
+ (
+ cd "$TOP_DIR/@CPACK_PACKAGE_FILE_NAME@/.build" &&
+ ./bin/cpack --config CPackSourceConfig.cmake &&
+ mv @CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@-src.tar.bz2 "$TOP_DIR"
+ )
+}
+
+finish()
+{
+ (
+ rm -rf "@CPACK_PACKAGE_FILE_NAME@"
+ )
+}
+
+case $1 in
+ prep) prep ; STATUS=$? ;;
+ mkdirs) mkdirs ; STATUS=$? ;;
+ conf) conf ; STATUS=$? ;;
+ build) build ; STATUS=$? ;;
+ clean) clean ; STATUS=$? ;;
+ package) pkg ; STATUS=$? ;;
+ pkg) pkg ; STATUS=$? ;;
+ src-package) spkg ; STATUS=$? ;;
+ spkg) spkg ; STATUS=$? ;;
+ finish) finish ; STATUS=$? ;;
+ all) (
+ prep && conf && build && pkg && spkg && finish ;
+ STATUS=$?
+ ) ;;
+ *) echo "Error: bad argument (all or one of these: prep mkdirs conf build clean package pkg src-package spkg finish)" ; exit 1 ;;
+esac
+exit ${STATUS}