X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=make-dist.sh;h=387e3da3b1058116b412be01d0f4fb252e45a130;hb=a2398ff9145acb93a9d7d5034bf1eb3c2a425470;hp=5e1fdd2eb22b0dfe1909e7bb989e536dff6644e0;hpb=ae5ad2e9fe92b5fdb2a4c5d6e6f3e2de410e61d8;p=ctsim.git diff --git a/make-dist.sh b/make-dist.sh index 5e1fdd2..387e3da 100755 --- a/make-dist.sh +++ b/make-dist.sh @@ -1,46 +1,102 @@ -#!/bin/sh - -# Creates debian and system-independent archive files -# Programmer: Kevin Rosenberg based on script used by onShore Development - -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 -# build the tarball -echo "building tarballs" -pushd .. +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 + +# Prepare for archive +cd .. rm -f ${PKG}_${VERSION}.tar.gz ${DEBPKG}_${VERSION}.orig.tar.gz rm -rf ${DISTDIR} ${DEBDIR} ${DISTDIR}.zip 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 make-doc.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 + 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 \ @@ -50,26 +106,40 @@ 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} +GZIP=-9 tar czf ${DEBPKG}_${VERSION}.orig.tar.gz ${DEBDIR} -# dpkg-source ${DEBDIR} ${PKG}_${VERSION}.orig.tar.gz +cp -a ${TOPDIR}/debian ${DEBDIR} +rm -f ${DEBDIR}/debian/.cvsignore +rm -rf ${DEBDIR}/debian/CVS + +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 -mkevin@rosenberg.net ${DEBPKG} + cd .. +else + cd ${DEBDIR} + dpkg-buildpackage -rfakeroot -kkevin@rosenberg.net + cd .. + mv -f ${DEBPKG}_${VERSION}* ${PACKAGE_DIR} +fi +rm -rf ${DEBDIR} -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} +mv -f ${DISTDIR}.zip ${DISTDIR}.tar.gz ${PACKAGE_DIR} -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 + +