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 -t Tag CVS tree with current version numbers
16 -h Print this brief help
22 value="`echo x\"$1\" | sed -e 's/^x-.//'`"
35 VERSION=`sed -n -e "s/${DEBPKG} (\(.*\)-[0-9.]).*/\1/p" < debian/changelog |head -1`
37 PACKAGE_DIR=/usr/local/src/Packages/${DEBPKG}
38 DISTDIR=${PKG}-${VERSION}
39 DEBDIR=${DEBPKG}-${VERSION}
41 if [ ! -z ${opt_tag} ]; then
42 UPSTREAM_TAG=upstream_version_`echo ${VERSION} | tr . _`
43 echo "(Re-)tagging with Upstream tag '${UPSTREAM_TAG}'"
44 cvs -q rtag -d $UPSTREAM_TAG $PKG > /dev/null
45 cvs -q tag -F $UPSTREAM_TAG > /dev/null
48 if [ ! -f docs/${PKG}.htb -o ! -f docs/html/${PKG}_contents.html -o ! -f docs/${PKG}.pdf ]; then
49 echo "Making documentation"
55 rm -f ${PKG}_${VERSION}.tar.gz ${DEBPKG}_${VERSION}.orig.tar.gz
56 rm -rf ${DISTDIR} ${DEBDIR} ${DISTDIR}.zip
57 cp -a ${TOPDIR} ${DISTDIR}
59 echo "Cleaning distribution directory ${DISTDIR}"
61 rm -f upload.sh make-debian.sh make-upstream.sh cvsbp-prepare.sh make-doc.sh
62 rm -f `find . -type f -name .cvsignore`
63 rm -rf `find . -type d -name CVS`
64 rm -f `find . -type f -name '*~' -or -name '.#*' -or -name '#*#' -or -name ".*~"`
65 rm -f `find doc -type f -name \*.tex -or -name \*.aux -or \
66 -name \*.log -or -name \*.out -or -name \*.dvi`
67 rm -rf images doc stamp-h.in build-stamp configure-stamp autom4te.cache
70 echo "Creating upstream archives"
71 rm -rf ${DISTDIR}/debian
72 GZIP=-9 tar czf ${DISTDIR}.tar.gz ${DISTDIR}
74 if [ "${DISTDIR}" != "${DEBDIR}" ]; then
75 cp -a ${DISTDIR} ${DEBDIR}
77 cp -a ${DISTDIR} ${DEBDIR}-copy
80 unix2dos `find ${DISTDIR} -type f -and -name '*.c' -or -name '*.h' -or \
81 -name '*.cpp' -or -name '*.sh' -or -name '*.in' -or \
82 -name 'Makefile*' -or -name ChangeLog -or -name COPYRIGHT -or -name TODO -or \
83 -name README -or -name INSTALL -or -name NEWS -or -name '*.tex' -or \
84 -name '*.hhc' -or -name '*.hhk' -or -name '*.hpj' -or -name '*.ini' -or \
85 -name COPYING* -or -name catalog`
86 zip -rq ${DISTDIR}.zip ${DISTDIR}
89 if [ "${DISTDIR}" == "${DEBDIR}" ]; then
90 mv ${DEBDIR}-copy ${DEBDIR}
92 GZIP=-9 tar czf ${DEBPKG}_${VERSION}.orig.tar.gz ${DEBDIR}
94 cp -a ${TOPDIR}/debian ${DEBDIR}
95 rm -f ${DEBDIR}/debian/.cvsignore
96 rm -rf ${DEBDIR}/debian/CVS
100 echo "Moving upstream archives to ${PACKAGE_DIR}"
101 mkdir -p /usr/local/src/Packages/${DEBPKG}
102 rm -f ${PACKAGE_DIR}/${DISTDIR}.zip ${PACKAGE_DIR}/${DEBPKG}_${VERSION}.orig.tar.gz
103 mv ${DISTDIR}.zip ${DEBPKG}_${VERSION}.orig.tar.gz ${DISTDIR}.tar.gz ${PACKAGE_DIR}