From: Kevin M. Rosenberg Date: Sun, 5 May 2002 11:36:02 +0000 (+0000) Subject: r1949: *** empty log message *** X-Git-Tag: debian-4.5.3-3~282 X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=f89d1bc4c048094680cb33a7b6120c3cc0db3938 r1949: *** empty log message *** --- diff --git a/make-dist.sh b/make-dist.sh index 5ab5bf3..bfac5c0 100755 --- a/make-dist.sh +++ b/make-dist.sh @@ -1,54 +1,101 @@ -#!/bin/sh - -# Creates debian and system-independent archive files -# Programmer: Kevin M. Rosenberg - -set -e +#!/bin/bash +# +# Creates debian and upstream packages +# Programmer: Kevin Rosenberg + +set -e # abort on error + +progname="`basename \"$0\"`" + +usage () { + cat >&2 < /dev/null + cvs -q tag -F ${DEB_TAG} > /dev/null + + # Retag with upstream tag if release not 0 or 1 + if [ "`echo ${DEBVERSION} | egrep '\-0$\-1$]'`" != "" ]; then + echo "(Re-)tagging with Upstream tag '${UPSTREAM_TAG}'" + cvs -q rtag -d $UPSTREAM_TAG $PKG > /dev/null + cvs -q tag -F $UPSTREAM_TAG > /dev/null + fi +fi + +if [ ! -f docs/${PKG}.htb -o ! -f docs/html/${PKG}_contents.html -o ! -f docs/${PKG}.pdf ]; then echo "Making documentation" pushd doc make all popd fi -TAG=upstream_version_`echo $VERSION | tr . _` -#echo "(re)tagging with release tag '$TAG'" -#cvs -q rtag -d $TAG $PKG -#cvs -q tag -F $TAG - - -echo "Preparing for archives" -pushd .. +# Prepare for archive +cd .. rm -f ${PKG}_${VERSION}.tar.gz ${DEBPKG}_${VERSION}.orig.tar.gz rm -rf ${DISTDIR} ${DEBDIR} ${DISTDIR}.zip - -echo "Making archives" cp -a ${TOPDIR} ${DISTDIR} -# Remove junk from distribution dir -pushd ${DISTDIR} +echo "Cleaning distribution directory ${DISTDIR}" +cd ${DISTDIR} make distclean +rm -f upload.sh make-dist.sh cvsbp-prepare rm -f `find . -type f -name .cvsignore` rm -rf `find . -type d -name CVS` -rm -f `find . -type f -name '*~' -or -name '.*~' -or \ - -name '.#*' -or -name '#*#' -or -name '*.fig' -or -name '*.psd'` -rm -rf images copy make-dist.sh make-doc.sh doc stamp-h.in build-stamp \ - configure-stamp -popd +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` +rm -rf images doc stamp-h.in build-stamp configure-stamp autom4te.cache +cd .. -# Create original distribution archives +echo "Creating upstream archives" rm -rf ${DISTDIR}/debian GZIP=-9 tar czf ${DISTDIR}.tar.gz ${DISTDIR} +if [ "${DISTDIR}" != "${DEBDIR}" ]; then + cp -a ${DISTDIR} ${DEBDIR} +else + cp -a ${DISTDIR} ${DEBDIR}-copy +fi +GZIP=-9 tar czf ${DEBPKG}_${VERSION}.orig.tar.gz ${DEBDIR} + unix2dos `find ${DISTDIR} -type f -and -name '*.c' -or -name '*.h' -or \ -name '*.cpp' -or -name '*.sh' -or -name '*.in' -or \ -name 'Makefile*' -or -name ChangeLog -or -name COPYRIGHT -or -name TODO -or \ @@ -58,26 +105,41 @@ unix2dos `find ${DISTDIR} -type f -and -name '*.c' -or -name '*.h' -or \ zip -rq ${DISTDIR}.zip ${DISTDIR} rm -rf ${DISTDIR} - -tar xzf ${DISTDIR}.tar.gz -cp ${DISTDIR}.tar.gz ${DEBPKG}_${VERSION}.orig.tar.gz - -if [ "${DISTDIR}" != "${DEBDIR}" ]; then - mv ${DISTDIR} ${DEBDIR} +if [ "${DISTDIR}" == "${DEBDIR}" ]; then + mv ${DEBDIR}-copy ${DEBDIR} fi + cp -a ${TOPDIR}/debian ${DEBDIR} +rm -f ${DEBDIR}/debian/.cvsignore +rm -rf ${DEBDIR}/debian/CVS -echo "Building Debian packages" -pushd ${DEBDIR} -dpkg-buildpackage -rfakeroot -kkevin@b9.com #-tc -b -popd -rm -r ${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} + +echo "Building Debian files" +if [ -z ${opt_dpkg_buildpackage} ]; then + cd ${TOPDIR} + cvs-buildpackage -rfakeroot -kkevin@rosenberg.net -H${TOPDIR}/cvsbp-prepare -tC -i.pdf ${DEBPKG} + cd .. +else + cd ${DEBDIR} + dpkg-buildpackage -rfakeroot -kkevin@rosenberg.net + cd .. + mv ${DEBPKG}_${VERSION}* ${PACKAGE_DIR} +fi +rm -rf ${DEBDIR} -lintian ${DEBPKG}_${VERSION}-*.changes +if [ ! -z ${opt_lintian} ]; then + pushd ${PACKAGE_DIR} > /dev/null + lintian ${DEBPKG}_${DEBVERSION}_*.changes + popd > /dev/null +fi -mkdir -p /usr/local/src/Packages/${DEBPKG} -mv ${DEBPKG}_${VERSION}* /usr/local/src/Packages/${DEBPKG} +cd ${TOPDIR} -popd exit 0 + +