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"
57 rm -f ${PKG}_${VERSION}.tar.gz ${DEBPKG}_${VERSION}.orig.tar.gz
58 rm -rf ${DISTDIR} ${DEBDIR} ${DISTDIR}.zip
59 cp -a ${TOPDIR} ${DISTDIR}
61 echo "Cleaning distribution directory ${DISTDIR}"
63 rm -f upload.sh make-debian.sh make-upstream.sh cvsbp-prepare.sh
64 rm -f `find . -type f -name .cvsignore`
65 rm -rf `find . -type d -name CVS`
66 rm -f `find . -type f -name '*~' -or -name '.#*' -or -name '#*#' -or -name ".*~"`
67 rm -f `find doc -type f -name \*.tex -or -name \*.aux -or \
68 -name \*.log -or -name \*.out -or -name \*.dvi`
69 rm -rf images doc stamp-h.in build-stamp configure-stamp autom4te.cache
72 echo "Creating upstream archives"
73 rm -rf ${DISTDIR}/debian
74 GZIP=-9 tar czf ${DISTDIR}.tar.gz ${DISTDIR}
77 if [ "${DISTDIR}" != "${DEBDIR}" ]; then
78 cp -a ${DISTDIR} ${DEBDIR}
80 cp -a ${DISTDIR} ${DEBDIR}-copy
83 unix2dos `find ${DISTDIR} -type f -and -name '*.c' -or -name '*.h' -or \
84 -name '*.cpp' -or -name '*.sh' -or -name '*.in' -or \
85 -name 'Makefile*' -or -name ChangeLog -or -name COPYRIGHT -or -name TODO -or \
86 -name README -or -name INSTALL -or -name NEWS -or -name '*.tex' -or \
87 -name '*.hhc' -or -name '*.hhk' -or -name '*.hpj' -or -name '*.ini' -or \
88 -name COPYING* -or -name catalog`
89 zip -rq ${DISTDIR}.zip ${DISTDIR}
92 if [ "${DISTDIR}" == "${DEBDIR}" ]; then
93 mv ${DEBDIR}-copy ${DEBDIR}
95 GZIP=-9 tar czf ${DEBPKG}_${VERSION}.orig.tar.gz ${DEBDIR}
97 cp -a ${TOPDIR}/debian ${DEBDIR}
98 rm -f ${DEBDIR}/debian/.cvsignore
99 rm -rf ${DEBDIR}/debian/CVS
103 echo "Moving upstream archives to ${PACKAGE_DIR}"
104 mkdir -p /usr/local/src/Packages/${DEBPKG}
105 rm -f ${PACKAGE_DIR}/${DISTDIR}.zip ${PACKAGE_DIR}/${DEBPKG}_${VERSION}.orig.tar.gz
106 mv ${DISTDIR}.zip ${DEBPKG}_${VERSION}.orig.tar.gz ${DISTDIR}.tar.gz ${PACKAGE_DIR}