3 # Creates upstream packages
4 # Programmer: Kevin Rosenberg
6 set -e # abort on error
9 progname="`basename \"$0\"`"
12 Usage: $progname [options]
13 Creates upstream archives
15 -c Commit and tag CVS tree with current version numbers
16 -t Tag CVS tree with current version numbers
17 -f Force creation of upstream archive, even if exists'
18 -h Print this brief help
24 value="`echo x\"$1\" | sed -e 's/^x-.//'`"
27 -c) opt_commit=1; opt_tag=1 ;;
39 VERSION=`sed -n -e "s/${DEBPKG} (\(.*\)-[0-9.]).*/\1/p" < debian/changelog |head -1`
41 PACKAGE_DIR=/usr/local/src/Packages/${DEBPKG}
42 DISTDIR=${PKG}-${VERSION}
43 DEBDIR=${DEBPKG}-${VERSION}
45 if [ ! -z ${opt_commit} ]; then
46 cvs commit -m 'Debian build'
49 if [ ! -z ${opt_tag} ]; then
50 UPSTREAM_TAG=upstream_version_`echo ${VERSION} | tr . _`
51 echo "(Re-)tagging with Upstream tag '${UPSTREAM_TAG}'"
52 cvs -q rtag -d $UPSTREAM_TAG $PKG > /dev/null
53 cvs -q tag -F $UPSTREAM_TAG > /dev/null
57 if [ -z ${opt_force} -a -f ${PACKAGE_DIR}/${DEBPKG}_${VERSION}.orig.tar.gz ]; then
58 echo "File ${PACKAGE_DIR}/${DEBPKG}_${VERSION}.orig.tar.gz already exists."
59 echo -n "Are you sure that you want to create a new upstream archive? (y/N): "
63 *) echo "Not building"
71 rm -f ${PKG}_${VERSION}.tar.gz ${DEBPKG}_${VERSION}.orig.tar.gz
72 rm -rf ${DISTDIR} ${DEBDIR} ${DISTDIR}.zip
73 cp -a ${TOPDIR} ${DISTDIR}
75 echo "Cleaning distribution directory ${DISTDIR}"
77 rm -f upload.sh make-debian.sh make-upstream.sh cvsbp-prepare.sh
78 rm -f test-suite/test.config
79 rm -f `find . -type f -name .cvsignore`
80 rm -rf `find . -type d -name CVS`
81 rm -f `find . -type f -name '*~' -or -name '.#*' -or -name '#*#' -or -name ".*~"`
82 rm -f `find doc -type f -name \*.tex -or -name \*.aux -or \
83 -name \*.log -or -name \*.out -or -name \*.dvi`
86 echo "Creating upstream archives"
87 rm -rf ${DISTDIR}/debian
88 GZIP=-9 tar czf ${DISTDIR}.tar.gz ${DISTDIR}
90 cp -a ${DISTDIR} ${DEBDIR}
91 GZIP=-9 tar czf ${DEBPKG}_${VERSION}.orig.tar.gz ${DEBDIR}
93 unix2dos `find ${DISTDIR} -type f -name \*.cl -or -name \*.list -or \
94 -name \*.system -or -name Makefile -or -name ChangeLog -or \
95 -name COPYRIGHT -or -name TODO -or -name README -or -name INSTALL -or \
96 -name NEWS -or -name \*.sgml -or -name COPYING\* -or -name catalog`
97 zip -rq ${DISTDIR}.zip ${DISTDIR}
99 cp -a ${TOPDIR}/debian ${DEBDIR}
100 rm -f ${DEBDIR}/debian/.cvsignore
101 rm -rf ${DEBDIR}/debian/CVS
103 rm -rf ${DISTDIR} ${DEBDIR}
105 echo "Moving upstream archives to ${PACKAGE_DIR}"
106 mkdir -p /usr/local/src/Packages/${DEBPKG}
107 rm -f ${PACKAGE_DIR}/${DISTDIR}.zip ${PACKAGE_DIR}/${DEBPKG}_${VERSION}.orig.tar.gz
108 mv ${DISTDIR}.zip ${DEBPKG}_${VERSION}.orig.tar.gz ${DISTDIR}.tar.gz ${PACKAGE_DIR}