summaryrefslogtreecommitdiffstats
path: root/Utilities/cmake_release_unix_package.sh
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2002-08-07 22:12:36 (GMT)
committerBrad King <brad.king@kitware.com>2002-08-07 22:12:36 (GMT)
commit5c517539136aa6309f35fec66213d6b1fc36acce (patch)
tree5b6136e9764112e7ab4a8452a83271e4672e041b /Utilities/cmake_release_unix_package.sh
parent86709a4ccf72e8519db2ad01917badad657562a8 (diff)
downloadCMake-5c517539136aa6309f35fec66213d6b1fc36acce.zip
CMake-5c517539136aa6309f35fec66213d6b1fc36acce.tar.gz
CMake-5c517539136aa6309f35fec66213d6b1fc36acce.tar.bz2
ENH: Split install script into two parts. Added basic support for adding more files to the distribution and creating packages.
Diffstat (limited to 'Utilities/cmake_release_unix_package.sh')
-rwxr-xr-xUtilities/cmake_release_unix_package.sh87
1 files changed, 87 insertions, 0 deletions
diff --git a/Utilities/cmake_release_unix_package.sh b/Utilities/cmake_release_unix_package.sh
new file mode 100755
index 0000000..1c172dc
--- /dev/null
+++ b/Utilities/cmake_release_unix_package.sh
@@ -0,0 +1,87 @@
+#!/bin/sh
+#
+# CMake UNIX Release Script.
+#
+# Run this in the directory where cmake_release_unix_build was run.
+#
+
+# Find our own script's location.
+SELFPATH=`cd \`echo $0 | sed -n '/\//{s/\/[^\/]*$//;p;}'\`;pwd`
+
+# Read the configuration.
+. ${SELFPATH}/cmake_release_unix_config.sh
+
+# Cleanup from possible previous run.
+rm -rf ${INSTALL_DIR} ${TARBALL_DIR}
+mkdir -p ${INSTALL_DIR} ${TARBALL_DIR}
+
+# Run the installation.
+cd ${BUILD_DIR}
+echo "Running make install ${INSTALL_OPTIONS}..."
+if ${MAKE} install ${INSTALL_OPTIONS} > ${LOG_DIR}/make_install.log 2>&1 ; then : ; else
+ echo "Error, see ${LOG_DIR}/make_install.log"
+ exit 1
+fi
+
+# Strip the executables.
+echo "Stripping executables..."
+if ${STRIP} ${INSTALL_DIR}${PREFIX}/bin/* \
+ > ${LOG_DIR}/strip.log 2>&1 ; then : ; else
+ echo "Error, see ${LOG_DIR}/strip.log"
+ exit 1
+fi
+
+# Let the configuration file add some files.
+CreateExtraFiles
+
+# Create the manifest file.
+echo "Writing MANIFEST..."
+${MKDIR} -p ${INSTALL_DIR}${PREFIX}/doc/cmake
+${TOUCH} ${INSTALL_DIR}${PREFIX}/doc/cmake/MANIFEST
+cd ${INSTALL_DIR}${PREFIX}
+FILES=`${FIND} ${INSTALL_SUBDIRS} -type f |sed 's/^\.\///'`
+${CAT} >> ${INSTALL_DIR}${PREFIX}/doc/cmake/MANIFEST <<EOF
+${FILES}
+EOF
+
+# Allow the configuration to create package files if it wants to do so.
+CreatePackage
+
+# Create the release tarballs.
+echo "Creating cmake-$VERSION-$PLATFORM.tar"
+cd ${INSTALL_DIR}${PREFIX}
+if ${TAR} cvf ${INSTALL_DIR}/cmake-$VERSION-$PLATFORM.tar ${INSTALL_SUBDIRS} \
+ > ${LOG_DIR}/cmake-$VERSION-$PLATFORM.log 2>&1 ; then : ; else
+ echo "Error, see ${LOG_DIR}/cmake-$VERSION-$PLATFORM.log"
+ exit 1
+fi
+
+echo "Writing README"
+cd ${INSTALL_DIR}
+${CAT} >> README <<EOF
+CMake $VERSION binary for $PLATFORM
+
+Extract the file "cmake-$VERSION-$PLATFORM.tar" into your
+destination directory. The following files will be extracted:
+
+${FILES}
+
+EOF
+
+TARBALL="${TARBALL_DIR}/CMake$VERSION-$PLATFORM.tar"
+echo "Creating CMake$VERSION-$PLATFORM.tar"
+if ${TAR} cvf $TARBALL README cmake-$VERSION-$PLATFORM.tar \
+ > ${LOG_DIR}/CMake$VERSION-$PLATFORM.log 2>&1 ; then : ; else
+ "Error, see ${LOG_DIR}/CMake$VERSION-$PLATFORM.log"
+ exit 1
+fi
+
+if test "x${GZIP}" != "x" ; then
+ echo "Creating $TARBALL.gz"
+ ${GZIP} -c $TARBALL > $TARBALL.gz
+fi
+
+if test "x${COMPRESS}" != "x" ; then
+ echo "Creating $TARBALL.Z"
+ ${COMPRESS} $TARBALL
+fi