From 305081002eafab32d071ce10d723727d1d81d6e1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 23 Sep 2002 21:14:20 -0400 Subject: ENH: Added cygwin packaging scripts. The setup.hint and cmake.README files required by Cygwin are generated automatically. --- Utilities/cmake-cygwin-package.sh | 155 ++++++++++++++++++++++++++++++++++++++ Utilities/cmake-cygwin.README | 32 -------- Utilities/cmake_release_cygwin.sh | 103 +++++++++++++++++++++++++ Utilities/setup.hint | 6 -- 4 files changed, 258 insertions(+), 38 deletions(-) create mode 100755 Utilities/cmake-cygwin-package.sh delete mode 100644 Utilities/cmake-cygwin.README create mode 100755 Utilities/cmake_release_cygwin.sh delete mode 100644 Utilities/setup.hint diff --git a/Utilities/cmake-cygwin-package.sh b/Utilities/cmake-cygwin-package.sh new file mode 100755 index 0000000..80b7660 --- /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 </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 47d8203..0000000 --- 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: - - - ----------------------------------------- -Cygwin port maintained by: William A. Hoffman diff --git a/Utilities/cmake_release_cygwin.sh b/Utilities/cmake_release_cygwin.sh new file mode 100755 index 0000000..d8a66ea --- /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 < + +------------------ + +Cygwin port maintained by: CMake Developers + +EOF +} + +WriteSetupHint() +{ +cat > ${PKG}-${VER}/CYGWIN-PATCHES/setup.hint < "${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 592883e..0000000 --- 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 -- cgit v0.12