r2124: *** empty log message ***
[ctsim.git] / make-upstream.sh
index a05fcf242f0a2c18960ba217a2e2aa3f59dca16c..28b1f2c82c36c89f278a29ebeac55b7be322d17f 100755 (executable)
@@ -13,6 +13,7 @@ Usage: $progname [options]
 Creates upstream archives
 Options:
   -t   Tag CVS tree with current version numbers
+  -c   Commit all files to CVS server
   -h   Print this brief help
 EOF
 }
@@ -23,6 +24,7 @@ while [ $# != 0 ]; do
     case "$1" in
         -h)  usage; exit 0           ;;
         -t)  opt_tag=1               ;;
+        -c)  opt_commit=1            ;;
          *)  usage; exit 0           ;;
     esac
     shift
@@ -38,6 +40,23 @@ PACKAGE_DIR=/usr/local/src/Packages/${DEBPKG}
 DISTDIR=${PKG}-${VERSION}
 DEBDIR=${DEBPKG}-${VERSION}
 
+if [ -f ${PACKAGE_DIR}/${DEBPKG}_${VERSION}.orig.tar.gz ]; then
+  echo "File ${PACKAGE_DIR}/${DEBPKG}_${VERSION}.orig.tar.gz already exists."
+  echo -n "Are you sure that you want to create a new upstream archive? (y/N): "
+  read answer
+  case $answer in
+      [Yy]*) nop= ;;
+      *) echo "Not building"
+        exit 1
+         ;;
+  esac
+fi
+
+if [ ! -z ${opt_commit} ]; then
+    echo "Committing to CVS server"
+    cvs commit -m "Committing for ${VERSION}"
+fi
+
 if [ ! -z ${opt_tag} ]; then
     UPSTREAM_TAG=upstream_version_`echo ${VERSION} | tr . _`
     echo "(Re-)tagging with Upstream tag '${UPSTREAM_TAG}'"
@@ -45,6 +64,7 @@ if [ ! -z ${opt_tag} ]; then
     cvs -q tag -F $UPSTREAM_TAG > /dev/null
 fi
 
+
 if [ ! -f docs/${PKG}.htb -o ! -f docs/html/${PKG}_contents.html -o ! -f docs/${PKG}.pdf ]; then
   echo "Making documentation"
   ../make-doc.sh
@@ -58,20 +78,20 @@ cp -a ${TOPDIR} ${DISTDIR}
 
 echo "Cleaning distribution directory ${DISTDIR}"
 cd ${DISTDIR}
+make distclean
 rm -f upload.sh make-debian.sh make-upstream.sh cvsbp-prepare.sh make-doc.sh 
 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 -rf `find . -type d -name CVS -or -name .deps`
+rm -f `find . -type f -name '*~' -or -name '.#*'  -or -name '#*#' -or -name ".*~" -or -name "*.o" -or -name "*.a"`
 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
+rm -rf images doc stamp-h.in build-stamp stamp-h configure-stamp autom4te.cache do-autoconf config.log config.status config.h
 cd ..
 
 echo "Creating upstream archives"
 rm -rf ${DISTDIR}/debian
 GZIP=-9 tar czf ${DISTDIR}.tar.gz ${DISTDIR}
 
-rm -rf ${DISTDIR}
 if [ "${DISTDIR}" != "${DEBDIR}" ]; then 
   cp -a ${DISTDIR} ${DEBDIR}
 else
@@ -85,7 +105,7 @@ unix2dos `find ${DISTDIR} -type f -and -name '*.c' -or -name '*.h' -or \
   -name '*.hhc' -or -name '*.hhk' -or -name '*.hpj' -or -name '*.ini' -or \
   -name COPYING* -or -name catalog` 
 zip -rq ${DISTDIR}.zip ${DISTDIR}
-rm -r {$DISTDIR}
+rm -r ${DISTDIR}
 
 if [ "${DISTDIR}" == "${DEBDIR}" ]; then 
   mv ${DEBDIR}-copy ${DEBDIR}