X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=debian%2Fmake-upstream.sh;h=6729134a29087f98a81a960d9b95a57048816d2d;hp=b838c2e89b1be3729ea47e37833c954d705b7517;hb=ed507b70a9d910372d1378cf0a7754fc88171183;hpb=3a7fe44546a552323f37c5928091d549a41f73bf diff --git a/debian/make-upstream.sh b/debian/make-upstream.sh index b838c2e..6729134 100755 --- a/debian/make-upstream.sh +++ b/debian/make-upstream.sh @@ -1,80 +1,7 @@ -#!/bin/bash -# -# Creates upstream packages -# Programmer: Kevin Rosenberg +#!/bin/bash -e -set -e # abort on error +bups.sh -Sclsql -Dcl-sql -f"-name test.config" -d"-name .bin" || + (echo "Error building upstream" >& 2; exit 1) -PKG=clsql -DEBPKG=cl-sql - -PACKAGE_DIR=/usr/local/src/Packages/${DEBPKG} -WORK_DIR=/usr/local/src/Work/${PKG} - -VERSION=`sed -n -e "s/${DEBPKG} (\(.*\)-[0-9.]).*/\1/p" < ${WORK_DIR}/debian/changelog |head -1` -DISTDIR=${PKG}-${VERSION} -DEBDIR=${DEBPKG}-${VERSION} - -if [ -z "${VERSION}" ]; then - echo "Can't find Debian changelog" - exit 1 -fi - -cvs commit -m 'Auto commit for Debian build' - -if [ -f ${PACKAGE_DIR}/${DEBPKG}_${VERSION}.orig.tar.gz ]; then - echo "File ${PACKAGE_DIR}/${DEBPKG}_${VERSION}.orig.tar.gz already exists." - echo -n "Are you sure that you want to create a new upstream archive? (y/N): " - read answer - case $answer in - [Yy]*) nop= ;; - *) echo "Not building" - exit 1 - ;; - esac -fi - -# Prepare for archive -cd ${WORK_DIR}/.. -rm -f ${PKG}_${VERSION}.tar.gz ${DEBPKG}_${VERSION}.orig.tar.gz -rm -rf ${DISTDIR} ${DEBDIR} ${DISTDIR}.zip -cp -a ${WORK_DIR} ${DISTDIR} - -echo "Cleaning distribution directory ${DISTDIR}" -cd ${DISTDIR} -make clean -rm -f debian/upload.sh debian/make-debian.sh debian/make-upstream.sh debian/cvsbp-prepare.sh test-suite/test.config -rm -f `find . -type f -name "*.so" -or -name "*.o"` -rm -f `find . -type f -name .cvsignore` -rm -rf `find . -type d -name CVS -or -name .bin` -rm -f `find . -type f -name '*~' -or -name '.#*' -or -name '#*#' -or -name ".*~"` -rm -f `find doc -type f -name \*.tex -or -name \*.aux -or \ - -name \*.log -or -name \*.out -or -name \*.dvi` -cd .. - -echo "Creating upstream archives" -rm -rf ${DISTDIR}/debian -GZIP=-9 tar czf ${DISTDIR}.tar.gz ${DISTDIR} - -cp -a ${DISTDIR} ${DEBDIR} -GZIP=-9 tar czf ${DEBPKG}_${VERSION}.orig.tar.gz ${DEBDIR} - -unix2dos `find ${DISTDIR} -type f -name \*.cl -or -name \*.list -or \ - -name \*.system -or -name Makefile -or -name ChangeLog -or \ - -name COPYRIGHT -or -name TODO -or -name README -or -name INSTALL -or \ - -name NEWS -or -name \*.sgml -or -name COPYING\* -or -name catalog` -zip -rq ${DISTDIR}.zip ${DISTDIR} - -cp -a ${WORK_DIR}/debian ${DEBDIR} -rm -f ${DEBDIR}/debian/.cvsignore -rm -rf ${DEBDIR}/debian/CVS - -rm -rf ${DISTDIR} ${DEBDIR} - -echo "Moving upstream archives to ${PACKAGE_DIR}" -mkdir -p /usr/local/src/Packages/${DEBPKG} -rm -f ${PACKAGE_DIR}/${DISTDIR}.zip ${PACKAGE_DIR}/${DEBPKG}_${VERSION}.orig.tar.gz -mv ${DISTDIR}.zip ${DEBPKG}_${VERSION}.orig.tar.gz ${DISTDIR}.tar.gz ${PACKAGE_DIR} - -cd ${WORK_DIR} exit 0 +