From 8142fe343fc333c4a580eda37888f03d79212cf1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 17 Jan 2003 11:57:26 -0500 Subject: ENH: Renamed cmake-cygwin-package.sh to cygwin-package.sh.in and removed executable permission so it cannot be run accidentally. It must be run after being renamed to cmake-${VERSION}-${RELEASE}. --- Utilities/Release/cmake-cygwin-package.sh | 155 ------------------------------ Utilities/Release/cmake_release.sh | 2 +- Utilities/Release/cygwin-package.sh.in | 155 ++++++++++++++++++++++++++++++ 3 files changed, 156 insertions(+), 156 deletions(-) delete mode 100755 Utilities/Release/cmake-cygwin-package.sh create mode 100755 Utilities/Release/cygwin-package.sh.in diff --git a/Utilities/Release/cmake-cygwin-package.sh b/Utilities/Release/cmake-cygwin-package.sh deleted file mode 100755 index 23ff392..0000000 --- a/Utilities/Release/cmake-cygwin-package.sh +++ /dev/null @@ -1,155 +0,0 @@ -#!/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=`/usr/bin/find .${PREFIX} -type f |sed 's/^\.\//\//'` && -( -cat >> ${INSTALL_DIR}${PREFIX}/doc/${PKG}-${VER}/MANIFEST </dev/null 2>&1 - /usr/bin/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/Release/cmake_release.sh b/Utilities/Release/cmake_release.sh index 813f927..0af5833 100755 --- a/Utilities/Release/cmake_release.sh +++ b/Utilities/Release/cmake_release.sh @@ -462,7 +462,7 @@ cygwin_package_script() utilities || return 1 echo "Creating cygwin packaging script ..." && ( - cp ReleaseUtilities/cmake-cygwin-package.sh cmake-${VERSION}-${RELEASE}.sh && + cp ReleaseUtilities/cygwin-package.sh.in cmake-${VERSION}-${RELEASE}.sh && chmod u+x cmake-${VERSION}-${RELEASE}.sh ) >Logs/cygwin_package_script.log 2>&1 || error_log Logs/cygwin_package_script.log } diff --git a/Utilities/Release/cygwin-package.sh.in b/Utilities/Release/cygwin-package.sh.in new file mode 100755 index 0000000..23ff392 --- /dev/null +++ b/Utilities/Release/cygwin-package.sh.in @@ -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=`/usr/bin/find .${PREFIX} -type f |sed 's/^\.\//\//'` && +( +cat >> ${INSTALL_DIR}${PREFIX}/doc/${PKG}-${VER}/MANIFEST </dev/null 2>&1 + /usr/bin/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} -- cgit v0.12