X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=make-dist.sh;h=0b28e92b7aae6770e1f21a35cc606e3a532fe912;hb=6562049dd76f2b8d6ded69dc75b4649e1b203743;hp=a5d6edb406321da6e01e40142e41a60c579aaa53;hpb=0e5e11646e5abe89f73c3e8cf40c9cbaa2cc1383;p=ctsim.git diff --git a/make-dist.sh b/make-dist.sh index a5d6edb..0b28e92 100755 --- a/make-dist.sh +++ b/make-dist.sh @@ -1,74 +1,143 @@ -#!/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 -popd -rm -f `find ${DISTDIR} -type f -name .cvsignore` -rm -rf `find ${DISTDIR} -type d -name CVS` -rm -f `find ${DISTDIR} -type f -name '*~' -or -name '.*~' -or \ - -name '.#*' -or -name '#*#' -or -name '*.fig' -or -name '*.psd'` - -rm -rf ${DISTDIR}/images ${DISTDIR}/copy ${DISTDIR}/make-dist.sh - -# Create original distribution archives +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 '.#*'` +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 .. + +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 Makefile -or -name ChangeLog -or -name COPYRIGHT -or -name TODO -or \ + -name '*.cpp' -or -name '*.sh' -or -name '*.in' -or \ + -name 'Makefile*' -or -name ChangeLog -or -name COPYRIGHT -or -name TODO -or \ -name README -or -name INSTALL -or -name NEWS -or -name '*.tex' -or \ + -name '*.hhc' -or -name '*.hhk' -or -name '*.hpj' -or -name '*.ini' -or \ -name COPYING* -or -name catalog` 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 ${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 + +