summaryrefslogtreecommitdiff
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2002-09-23 21:14:20 -0400
committerBrad King <brad.king@kitware.com>2002-09-23 21:14:20 -0400
commit305081002eafab32d071ce10d723727d1d81d6e1 (patch)
treef8e33d40e4d170918e8cb6abfe96468813afa20d /Utilities
parentba10f9622339641d1048a1424c313c90b117c0db (diff)
downloadcmake-305081002eafab32d071ce10d723727d1d81d6e1.tar.gz
ENH: Added cygwin packaging scripts. The setup.hint and cmake.README files required by Cygwin are generated automatically.
Diffstat (limited to 'Utilities')
-rwxr-xr-xUtilities/cmake-cygwin-package.sh155
-rw-r--r--Utilities/cmake-cygwin.README32
-rwxr-xr-xUtilities/cmake_release_cygwin.sh103
-rw-r--r--Utilities/setup.hint6
4 files changed, 258 insertions, 38 deletions
diff --git a/Utilities/cmake-cygwin-package.sh b/Utilities/cmake-cygwin-package.sh
new file mode 100755
index 0000000000..80b7660579
--- /dev/null
+++ b/Utilities/cmake-cygwin-package.sh
@@ -0,0 +1,155 @@
+#!/bin/sh
+
+TOP_DIR=`cd \`echo "$0" | sed -n '/\//{s/\/[^\/]*$//;p;}'\`;pwd`
+SELF_NAME=`basename "$0" .sh`
+PKG=`echo ${SELF_NAME} | sed -e 's/\-[^\-]*\-[^\-]*$//'`
+VER=`echo ${SELF_NAME} | sed -e 's/^[^\-]*\-//' -e 's/\-[^\-]*$//'`
+REL=`echo ${SELF_NAME} | sed -e 's/^[^\-]*\-[^\-]*\-//'`
+FULLPKG=${PKG}-${VER}-${REL}
+
+SOURCE_DIR="${TOP_DIR}/${PKG}-${VER}"
+BINARY_DIR=${SOURCE_DIR}/.build
+INSTALL_DIR=${SOURCE_DIR}/.inst
+SPKG_DIR=${SOURCE_DIR}/.sinst
+SOURCE_PACKAGE="${TOP_DIR}/${FULLPKG}-src.tar.bz2"
+SOURCE_TARBALL="${TOP_DIR}/${PKG}-${VER}.tar.bz2"
+SOURCE_PATCH="${TOP_DIR}/${FULLPKG}.patch"
+PREFIX="/usr"
+
+BINARY_PACKAGE="${TOP_DIR}/${FULLPKG}.tar.bz2"
+
+mkdirs()
+{
+ (
+ mkdir -p "${BINARY_DIR}" "${INSTALL_DIR}" "${SPKG_DIR}"
+ )
+}
+
+prep()
+{
+ (
+ cd ${TOP_DIR} &&
+ tar xvjf "${SOURCE_TARBALL}" &&
+ patch -p0 < "${SOURCE_PATCH}" &&
+ mkdirs
+ )
+}
+
+conf()
+{
+ (
+ cd ${BINARY_DIR} &&
+ ${SOURCE_DIR}/configure --prefix=${PREFIX}
+ )
+}
+
+build()
+{
+ (
+ cd ${BINARY_DIR} &&
+ make
+ )
+}
+
+install()
+{
+ (
+ cd ${BINARY_DIR} &&
+ make install DESTDIR="${INSTALL_DIR}" &&
+ mkdir -p ${INSTALL_DIR}${PREFIX}/doc/Cygwin &&
+ mkdir -p ${INSTALL_DIR}${PREFIX}/doc/${PKG}-${VER} &&
+ cp ${SOURCE_DIR}/CMake.pdf ${INSTALL_DIR}${PREFIX}/doc/${PKG}-${VER} &&
+ cp ${SOURCE_DIR}/CMake.rtf ${INSTALL_DIR}${PREFIX}/doc/${PKG}-${VER} &&
+ cp ${SOURCE_DIR}/Copyright.txt ${INSTALL_DIR}${PREFIX}/doc/${PKG}-${VER} &&
+ cp ${SOURCE_DIR}/CYGWIN-PATCHES/cmake.README \
+ ${INSTALL_DIR}${PREFIX}/doc/Cygwin/${FULLPKG}.README &&
+ touch ${INSTALL_DIR}${PREFIX}/doc/${PKG}-${VER}/MANIFEST &&
+ cd ${INSTALL_DIR} &&
+ FILES=`find .${PREFIX} -type f |sed 's/^\.\//\//'` &&
+(
+cat >> ${INSTALL_DIR}${PREFIX}/doc/${PKG}-${VER}/MANIFEST <<EOF
+${FILES}
+EOF
+)
+ )
+}
+
+strip()
+{
+ (
+ cd ${INSTALL_DIR} &&
+ find . -name "*.dll" | xargs strip >/dev/null 2>&1
+ find . -name "*.exe" | xargs strip >/dev/null 2>&1
+ true
+ )
+}
+
+clean()
+{
+ (
+ cd ${BINARY_DIR} &&
+ make clean
+ )
+}
+
+pkg()
+{
+ (
+ cd ${INSTALL_DIR} &&
+ tar cvjf "${BINARY_PACKAGE}" *
+ )
+}
+
+mkpatch()
+{
+ (
+ cd ${SOURCE_DIR} &&
+ tar xvjf "${SOURCE_TARBALL}" &&
+ mv ${PKG}-${VER} ../${PKG}-${VER}-orig &&
+ cd ${TOP_DIR} &&
+ diff -urN -x '.build' -x '.inst' -x '.sinst' \
+ "${PKG}-${VER}-orig" "${PKG}-${VER}" > "${SPKG_DIR}/${FULLPKG}.patch" ;
+ rm -rf "${TOP_DIR}/${PKG}-${VER}-orig"
+ )
+}
+
+spkg()
+{
+ (
+ mkpatch &&
+ cp ${SOURCE_TARBALL} ${SPKG_DIR} &&
+ cp "$0" ${SPKG_DIR} &&
+ cd ${SPKG_DIR} &&
+ tar cvjf ${SOURCE_PACKAGE} *
+ )
+}
+
+finish()
+{
+ (
+ rm -rf "${SOURCE_DIR}"
+ )
+}
+
+case $1 in
+ prep) prep ; STATUS=$? ;;
+ mkdirs) mkdirs ; STATUS=$? ;;
+ conf) conf ; STATUS=$? ;;
+ build) build ; STATUS=$? ;;
+ check) check ; STATUS=$? ;;
+ clean) clean ; STATUS=$? ;;
+ install) install ; STATUS=$? ;;
+ strip) strip ; STATUS=$? ;;
+ package) pkg ; STATUS=$? ;;
+ pkg) pkg ; STATUS=$? ;;
+ mkpatch) mkpatch ; STATUS=$? ;;
+ src-package) spkg ; STATUS=$? ;;
+ spkg) spkg ; STATUS=$? ;;
+ finish) finish ; STATUS=$? ;;
+ all) (
+ prep && conf && build && install && strip && pkg && spkg && finish ;
+ STATUS=$?
+ ) ;;
+ *) echo "Error: bad arguments" ; exit 1 ;;
+esac
+exit ${STATUS}
diff --git a/Utilities/cmake-cygwin.README b/Utilities/cmake-cygwin.README
deleted file mode 100644
index 47d8203309..0000000000
--- a/Utilities/cmake-cygwin.README
+++ /dev/null
@@ -1,32 +0,0 @@
-cmake
---------------------------------------
-Runtime requirements:
- cygwin-1.3.5 or newer
-
-Build requirements
- cygwin-1.3.5 or newer
- make
-
-Canonical homepage:
- http://www.cmake.org
-
-Canonical download:
- ftp://www.cmake.org/pub/cmake/
-
----------------------------------------
-
-Build instructions:
- unpack cmake-1.4-X-src.tar.bz2
- cd cmake
- ./configure
- make
- make test
-
----------------------------------------
-
-Port Notes:
-
-<none>
-
-----------------------------------------
-Cygwin port maintained by: William A. Hoffman <bill.hoffman@kitware.com>
diff --git a/Utilities/cmake_release_cygwin.sh b/Utilities/cmake_release_cygwin.sh
new file mode 100755
index 0000000000..d8a66ea89e
--- /dev/null
+++ b/Utilities/cmake_release_cygwin.sh
@@ -0,0 +1,103 @@
+#!/bin/sh
+#
+# CMake Cygwin package creation script. Run this in an empty
+# directory from a separate CMake checkout.
+#
+
+CVS_TAG="-r Release-1-4"
+PKG=cmake
+VER=1.4.5
+REL=1
+
+CVSROOT=":pserver:anonymous@www.cmake.org:/cvsroot/CMake"
+FULLPKG="${PKG}-${VER}-${REL}"
+
+SELF_DIR=`cd \`echo "$0" | sed -n '/\//{s/\/[^\/]*$//;p;}'\`;pwd`
+
+WriteREADME()
+{
+cat > ${PKG}-${VER}/CYGWIN-PATCHES/cmake.README <<EOF
+cmake
+--------------------------------------
+Runtime requirements:
+ cygwin-1.3.5 or newer
+
+Build requirements
+ cygwin-1.3.5 or newer
+ make
+
+Canonical homepage:
+ http://www.cmake.org
+
+Canonical download:
+ ftp://www.cmake.org/pub/cmake/
+
+------------------------------------
+
+Build instructions:
+ unpack ${FULLPKG}-src.tar.bz2
+ if you use setup to install this src package, it will be
+ unpacked under /usr/src automatically
+ cd /usr/src
+ ./${FULLPKG}.sh all
+
+This will create:
+ /usr/src/${FULLPKG}.tar.bz2
+ /usr/src/${FULLPKG}-src.tar.bz2
+
+-------------------------------------------
+
+Port Notes:
+
+<none>
+
+------------------
+
+Cygwin port maintained by: CMake Developers <cmake@www.cmake.org>
+
+EOF
+}
+
+WriteSetupHint()
+{
+cat > ${PKG}-${VER}/CYGWIN-PATCHES/setup.hint <<EOF
+# CMake setup.hint file for cygwin setup.exe program
+category: Devel
+requires: libncurses5 cygwin
+sdesc: "A cross platform build manger"
+ldesc: "CMake is a cross platform build manager. It allows you to specify build parameters for C and C++ programs in a cross platform manner. For cygwin Makefiles will be generated. CMake is also capable of generating microsoft project files, nmake, and borland makefiles. CMake can also perform system inspection operations like finding installed libraries and header files."
+curr: ${VER}-${REL}
+EOF
+}
+
+SourceTarball()
+{
+ cvs -z3 -d ${CVSROOT} export ${CVS_TAG} CMake &&
+ mv CMake ${PKG}-${VER} &&
+ tar cvjf ${PKG}-${VER}.tar.bz2 ${PKG}-${VER}
+}
+
+SourcePatch()
+{
+ mv ${PKG}-${VER} ${PKG}-${VER}-orig &&
+ tar xvjf ${PKG}-${VER}.tar.bz2 &&
+ mkdir -p ${PKG}-${VER}/CYGWIN-PATCHES &&
+ WriteREADME &&
+ WriteSetupHint &&
+ cp ${PKG}-${VER}/Utilities/setup.hint ${PKG}-${VER}/CYGWIN-PATCHES &&
+ (diff -urN "${PKG}-${VER}-orig" "${PKG}-${VER}" > "${FULLPKG}.patch")
+ rm -rf ${PKG}-${VER} ${PKG}-${VER}-orig
+}
+
+CygwinScript()
+{
+ cp ${SELF_DIR}/cmake-cygwin-package.sh ./${FULLPKG}.sh
+ chmod u+x ./${FULLPKG}.sh
+}
+
+Package()
+{
+ ./${FULLPKG}.sh all
+}
+
+SourceTarball && SourcePatch && CygwinScript && Package
diff --git a/Utilities/setup.hint b/Utilities/setup.hint
deleted file mode 100644
index 592883e998..0000000000
--- a/Utilities/setup.hint
+++ /dev/null
@@ -1,6 +0,0 @@
-# CMake setup.hint file for cygwin setup.exe program
-category: Devel
-requires: libncurses5 cygwin
-sdesc: "A cross platform build manger"
-ldesc: "CMake is a cross platform build manager. It allows you to specify build parameters for C and C++ programs in a cross platform manner. For cygwin Makefiles will be generated. CMake is also capable of generating microsoft project files, nmake, and borland makefiles. CMake can also perform system inspection operations like finding installed libraries and header files."
-curr: 1.4-3