summaryrefslogtreecommitdiffstats
path: root/Utilities
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
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')
-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
-rw-r--r--Utilities/Release/create-cmake-release.cmake1
-rw-r--r--Utilities/Release/release_cmake.cmake11
5 files changed, 108 insertions, 23 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}
diff --git a/Utilities/Release/create-cmake-release.cmake b/Utilities/Release/create-cmake-release.cmake
index b547951..9307f5a 100644
--- a/Utilities/Release/create-cmake-release.cmake
+++ b/Utilities/Release/create-cmake-release.cmake
@@ -10,6 +10,7 @@ set(RELEASE_SCRIPTS
dashsgi1_release.cmake # IRIX
dashsgi1_release64.cmake # IRIX 64
vogon_release.cmake # Windows
+ discworld_cygwin.cmake # Cygwin
# r36n11_aix_release.cmake # AIX 5.3
r15n65_aix_release.cmake # AIX 5.2
)
diff --git a/Utilities/Release/release_cmake.cmake b/Utilities/Release/release_cmake.cmake
index 005836a..42b2942 100644
--- a/Utilities/Release/release_cmake.cmake
+++ b/Utilities/Release/release_cmake.cmake
@@ -76,8 +76,12 @@ configure_file(${SCRIPT_PATH}/release_cmake.sh.in ${SCRIPT_FILE} @ONLY)
# run the script by starting a shell on the remote machine
# then using the script file as input to the shell
-remote_command("run release_cmake-${HOST}.sh on server"
- "${RUN_SHELL}" ${SCRIPT_FILE})
+IF(RUN_LOCAL)
+ message(FATAL_ERROR "run this command: ${RUN_SHELL} ${SCRIPT_FILE}")
+ELSE(RUN_LOCAL)
+ remote_command("run release_cmake-${HOST}.sh on server"
+ "${RUN_SHELL}" ${SCRIPT_FILE})
+ENDIF(RUN_LOCAL)
# now figure out which types of packages were created
set(generators ${CPACK_BINARY_GENERATORS} ${CPACK_SOURCE_GENERATORS})
@@ -95,6 +99,9 @@ foreach(gen ${generators})
if("${gen}" STREQUAL "TBZ2")
set(SUFFIXES ${SUFFIXES} "*.tar.bz2")
endif("${gen}" STREQUAL "TBZ2")
+ if("${gen}" MATCHES "Cygwin")
+ set(SUFFIXES ${SUFFIXES} "*.tar.bz2")
+ endif("${gen}" STREQUAL "Cygwin")
if("${gen}" STREQUAL "TZ")
set(SUFFIXES ${SUFFIXES} "*.tar.Z")
endif("${gen}" STREQUAL "TZ")