ENH: Split install script into two parts. Added basic support for adding more files to the distribution and creating packages.
This commit is contained in:
parent
86709a4ccf
commit
5c51753913
|
@ -1,13 +1,16 @@
|
|||
RELEASE_TAG="Release-1-4"
|
||||
VERSION="1.4"
|
||||
PLATFORM="hpux-static"
|
||||
CMAKE="/home/hoffman/CMake-aCC/Source/cmake"
|
||||
CC="cc"
|
||||
CXX="aCC"
|
||||
|
||||
CMAKE_CACHE_ENTRIES="
|
||||
# Write entries into the cache file before building cmake.
|
||||
WriteCMakeCache()
|
||||
{
|
||||
${CAT} > CMakeCache.txt <<EOF
|
||||
BUILD_TESTING:BOOL=OFF
|
||||
CMAKE_CXX_SHLIB_LINK_FLAGS:STRING=-Wl,-a,archive
|
||||
CMAKE_CXX_SHLIB_BUILD_FLAGS:STRING=
|
||||
CMAKE_CXX_SHLIB_RUNTIME_FLAG:STRING=
|
||||
"
|
||||
|
||||
EOF
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
RELEASE_TAG="Release-1-4"
|
||||
VERSION="1.4"
|
||||
PLATFORM="irix65"
|
||||
CMAKE="/rolle/insight/CMake-CC-dashboard/Source/cmake"
|
||||
CC="cc"
|
||||
CXX="CC"
|
||||
|
||||
|
|
|
@ -5,11 +5,15 @@ CREATE_SOURCE_TARBALL="yes"
|
|||
CURSES_LIBRARY="/usr/lib/libcurses.a"
|
||||
FORM_LIBRARY="/usr/lib/libform.a"
|
||||
|
||||
CMAKE_CACHE_ENTRIES="
|
||||
# Write entries into the cache file before building cmake.
|
||||
WriteCMakeCache()
|
||||
{
|
||||
${CAT} > CMakeCache.txt <<EOF
|
||||
BUILD_TESTING:BOOL=OFF
|
||||
CMAKE_CXX_SHLIB_LINK_FLAGS:STRING=-static
|
||||
CMAKE_CXX_SHLIB_BUILD_FLAGS:STRING=
|
||||
CMAKE_CXX_SHLIB_RUNTIME_FLAG:STRING=
|
||||
CURSES_LIBRARY:FILEPATH=${CURSES_LIBRARY}
|
||||
FORM_LIBRARY:FILEPATH=${FORM_LIBRARY}
|
||||
"
|
||||
|
||||
EOF
|
||||
}
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
RELEASE_TAG="Release-1-4"
|
||||
VERSION="1.4"
|
||||
PLATFORM="sparc-sunos57-static"
|
||||
CMAKE="/space/berk/CMake-build/Source/cmake"
|
||||
CURSES_LIBRARY="/usr/lib/libcurses.a"
|
||||
FORM_LIBRARY="/usr/lib/libform.a"
|
||||
|
||||
CMAKE_CACHE_ENTRIES="
|
||||
# Write entries into the cache file before building cmake.
|
||||
WriteCMakeCache()
|
||||
{
|
||||
${CAT} > CMakeCache.txt <<EOF
|
||||
BUILD_TESTING:BOOL=OFF
|
||||
CMAKE_CXX_SHLIB_LINK_FLAGS:STRING=-static
|
||||
CMAKE_CXX_SHLIB_BUILD_FLAGS:STRING=
|
||||
CMAKE_CXX_SHLIB_RUNTIME_FLAG:STRING=
|
||||
CURSES_LIBRARY:FILEPATH=${CURSES_LIBRARY}
|
||||
FORM_LIBRARY:FILEPATH=${FORM_LIBRARY}
|
||||
"
|
||||
|
||||
EOF
|
||||
}
|
||||
|
|
|
@ -1,160 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# CMake UNIX Release Script.
|
||||
#
|
||||
# Run this in an empty directory. Your ~/.cvspass file should already
|
||||
# have an entry for the CVSROOT used below.
|
||||
#
|
||||
|
||||
# Check the command line arguments.
|
||||
CONFIG_FILE=$1
|
||||
if test "x$1" = "x"; then
|
||||
echo "Usage:"
|
||||
echo " $0 <configuration-file>"
|
||||
echo ""
|
||||
echo "Sample configuration file:"
|
||||
echo " RELEASE_TAG=\"Release-1-4\""
|
||||
echo " VERSION=\"1.4\""
|
||||
echo " PLATFORM=\"x86-linux\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set some defaults here. They can be changed by the configuration
|
||||
# file.
|
||||
CVSROOT=":pserver:anonymous@www.cmake.org:/cvsroot/CMake"
|
||||
RELEASE_ROOT=`pwd`
|
||||
CREATE_SOURCE_TARBALL="no"
|
||||
CMAKE="cmake"
|
||||
GZIP="gzip"
|
||||
COMPRESS="compress"
|
||||
TAR="tar"
|
||||
CAT="cat"
|
||||
MAKE="make"
|
||||
FIND="find"
|
||||
CVS="cvs"
|
||||
CC="gcc"
|
||||
CXX="c++"
|
||||
CFLAGS=""
|
||||
CXXFLAGS=""
|
||||
CMAKE_CACHE_ENTRIES=""
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configuration options (could be in separate file)
|
||||
echo "Reading configuration from ${CONFIG_FILE}..."
|
||||
if . `pwd`/${CONFIG_FILE} ; then : ; else
|
||||
echo "Error reading configuration."
|
||||
exit 1
|
||||
fi
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
export CC CXX CFLAGS CXXFLAGS
|
||||
|
||||
# Select directories.
|
||||
INSTALL_DIR="${RELEASE_ROOT}/Install"
|
||||
TARBALL_DIR="${RELEASE_ROOT}/Tarballs"
|
||||
BUILD_DIR="${RELEASE_ROOT}/CMake-$VERSION-$PLATFORM-build"
|
||||
LOG_DIR="${RELEASE_ROOT}/Logs"
|
||||
|
||||
# Cleanup from possible previous run.
|
||||
rm -rf ${LOG_DIR} ${BUILD_DIR} ${INSTALL_DIR} ${TARBALL_DIR}
|
||||
mkdir -p ${LOG_DIR} ${BUILD_DIR} ${INSTALL_DIR} ${TARBALL_DIR}
|
||||
|
||||
# Make sure the source is exported from CVS.
|
||||
SOURCE_DIR="${RELEASE_ROOT}/CMake-$VERSION"
|
||||
if test ! -d ${SOURCE_DIR} ; then
|
||||
cd ${RELEASE_ROOT}
|
||||
rm -rf CMake
|
||||
echo "Exporing CMake from CVS..."
|
||||
if ${CVS} -z3 -d ${CVSROOT} export -r ${RELEASE_TAG} \
|
||||
CMake > ${LOG_DIR}/cvs.log 2>&1 ; then : ; else
|
||||
echo "Error, see ${LOG_DIR}/cvs.log"
|
||||
exit 1
|
||||
fi
|
||||
mv CMake CMake-$VERSION
|
||||
fi
|
||||
|
||||
# Make the source tarball if requested.
|
||||
if test "${CREATE_SOURCE_TARBALL}" = "yes" ; then
|
||||
TARBALL="${TARBALL_DIR}/CMake$VERSION-src-unix.tar"
|
||||
echo "Creating CMake$VERSION-src-unix.tar"
|
||||
if ${TAR} cvf $TARBALL CMake-$VERSION \
|
||||
> ${LOG_DIR}/CMake$VERSION-src-unix.log 2>&1 ; then : ; else
|
||||
"Error, see ${LOG_DIR}/CMake$VERSION-src-unix.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
|
||||
fi
|
||||
|
||||
# Build the release.
|
||||
cd ${BUILD_DIR}
|
||||
echo "Writing CMakeCache.txt..."
|
||||
${CAT} > CMakeCache.txt <<EOF
|
||||
BUILD_TESTING:BOOL=OFF
|
||||
CMAKE_INSTALL_PREFIX:PATH=${INSTALL_DIR}
|
||||
${CMAKE_CACHE_ENTRIES}
|
||||
EOF
|
||||
|
||||
echo "Running CMake..."
|
||||
if ${CMAKE} ${SOURCE_DIR} > ${LOG_DIR}/cmake.log 2>&1 ; then : ; else
|
||||
echo "Error, see ${LOG_DIR}/cmake.log"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Running make..."
|
||||
if ${MAKE} > ${LOG_DIR}/make.log 2>&1 ; then : ; else
|
||||
echo "Error, see ${LOG_DIR}/make.log"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Running make install..."
|
||||
if ${MAKE} install > ${LOG_DIR}/make_install.log 2>&1 ; then : ; else
|
||||
echo "Error, see ${LOG_DIR}/make_install.log"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create the release tarballs.
|
||||
cd ${INSTALL_DIR}
|
||||
echo "Creating cmake-$VERSION-$PLATFORM.tar"
|
||||
|
||||
if ${TAR} cvf cmake-$VERSION-$PLATFORM.tar bin share \
|
||||
> ${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"
|
||||
FILES=`${FIND} bin share -type f |sed 's/^\.\///'`
|
||||
${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
|
|
@ -0,0 +1,66 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# CMake UNIX Release Script.
|
||||
#
|
||||
# Run this in an empty directory. Your ~/.cvspass file should already
|
||||
# have an entry for the CVSROOT used below.
|
||||
#
|
||||
|
||||
# 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 ${LOG_DIR} ${BUILD_DIR} ${INSTALL_DIR} ${TARBALL_DIR}
|
||||
mkdir -p ${LOG_DIR} ${BUILD_DIR} ${INSTALL_DIR} ${TARBALL_DIR}
|
||||
|
||||
# Make sure the source is exported from CVS.
|
||||
if test ! -d ${SOURCE_DIR} ; then
|
||||
cd ${RELEASE_ROOT}
|
||||
rm -rf CMake
|
||||
echo "Exporing CMake from CVS..."
|
||||
if ${CVS} -z3 -d ${CVSROOT} export -r ${RELEASE_TAG} \
|
||||
CMake > ${LOG_DIR}/cvs.log 2>&1 ; then : ; else
|
||||
echo "Error, see ${LOG_DIR}/cvs.log"
|
||||
exit 1
|
||||
fi
|
||||
mv CMake CMake-$VERSION
|
||||
fi
|
||||
|
||||
# Make the source tarball if requested.
|
||||
if test "${CREATE_SOURCE_TARBALL}" = "yes" ; then
|
||||
TARBALL="${TARBALL_DIR}/CMake$VERSION-src-unix.tar"
|
||||
echo "Creating CMake$VERSION-src-unix.tar"
|
||||
if ${TAR} cvf $TARBALL CMake-$VERSION \
|
||||
> ${LOG_DIR}/CMake$VERSION-src-unix.log 2>&1 ; then : ; else
|
||||
"Error, see ${LOG_DIR}/CMake$VERSION-src-unix.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
|
||||
fi
|
||||
|
||||
# Build the release.
|
||||
cd ${BUILD_DIR}
|
||||
echo "Writing CMakeCache.txt..."
|
||||
WriteCMakeCache
|
||||
|
||||
echo "Running configure..."
|
||||
if ${SOURCE_DIR}/configure --prefix=${PREFIX} > ${LOG_DIR}/configure.log 2>&1 ; then : ; else
|
||||
echo "Error, see ${LOG_DIR}/configure.log"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Running make..."
|
||||
if ${MAKE} > ${LOG_DIR}/make.log 2>&1 ; then : ; else
|
||||
echo "Error, see ${LOG_DIR}/make.log"
|
||||
exit 1
|
||||
fi
|
|
@ -0,0 +1,85 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# CMake UNIX Release Configuration Script.
|
||||
#
|
||||
# This is sourced by the cmake_release_unix_build and
|
||||
# cmake_release_unix_package to setup the configuration.
|
||||
#
|
||||
|
||||
# Check the command line arguments.
|
||||
CONFIG_FILE=$1
|
||||
if test "x$1" = "x"; then
|
||||
echo "Usage:"
|
||||
echo " $0 <configuration-file>"
|
||||
echo ""
|
||||
echo "Sample configuration file:"
|
||||
echo " RELEASE_TAG=\"Release-1-4\""
|
||||
echo " VERSION=\"1.4\""
|
||||
echo " PLATFORM=\"x86-linux\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set some defaults here. They can be changed by the configuration
|
||||
# file.
|
||||
CVSROOT=":pserver:anonymous@www.cmake.org:/cvsroot/CMake"
|
||||
CAT="cat"
|
||||
COMPRESS="compress"
|
||||
CREATE_SOURCE_TARBALL="no"
|
||||
CVS="cvs"
|
||||
FIND="find"
|
||||
GZIP="gzip"
|
||||
MAKE="make"
|
||||
MKDIR="mkdir"
|
||||
RELEASE_ROOT=`pwd`
|
||||
STRIP="strip"
|
||||
TAR="tar"
|
||||
TOUCH="touch"
|
||||
CC="gcc"
|
||||
CXX="c++"
|
||||
CFLAGS=""
|
||||
CXXFLAGS=""
|
||||
PREFIX="/usr/local"
|
||||
INSTALL_SUBDIRS="bin share doc"
|
||||
|
||||
# Functions can be replaced by configuration file.
|
||||
|
||||
# Create extra files in the installation tree. This allows
|
||||
# configurations to add documentation.
|
||||
CreateExtraFiles()
|
||||
{
|
||||
return 0
|
||||
}
|
||||
|
||||
# Create a package file. This allows configurations to create
|
||||
# packages for certain UNIX distributions.
|
||||
CreatePackage()
|
||||
{
|
||||
return 0
|
||||
}
|
||||
|
||||
# Write entries into the cache file before building cmake.
|
||||
WriteCMakeCache()
|
||||
{
|
||||
${CAT} > CMakeCache.txt <<EOF
|
||||
BUILD_TESTING:BOOL=OFF
|
||||
EOF
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configuration options.
|
||||
echo "Reading configuration from ${CONFIG_FILE}..."
|
||||
if . ${CONFIG_FILE} ; then : ; else
|
||||
echo "Error reading configuration."
|
||||
exit 1
|
||||
fi
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
export CC CXX CFLAGS CXXFLAGS
|
||||
|
||||
# Select directories.
|
||||
INSTALL_DIR="${RELEASE_ROOT}/Install"
|
||||
TARBALL_DIR="${RELEASE_ROOT}/Tarballs"
|
||||
SOURCE_DIR="${RELEASE_ROOT}/CMake-$VERSION"
|
||||
BUILD_DIR="${RELEASE_ROOT}/CMake-$VERSION-$PLATFORM-build"
|
||||
LOG_DIR="${RELEASE_ROOT}/Logs"
|
||||
INSTALL_OPTIONS="DESTDIR=\"${INSTALL_DIR}\""
|
|
@ -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
|
Loading…
Reference in New Issue