id-upload.sh uses IDMETA info
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 4 Nov 2013 11:34:36 +0000 (12:34 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 4 Nov 2013 11:34:36 +0000 (12:34 +0100)
id-deb-build/id-upload.sh

index 671ae84..b5959bc 100755 (executable)
@@ -1,19 +1,23 @@
 #!/bin/sh
-DEBCHANGELOG=debian/changelog
-if test ! -f $DEBCHANGELOG; then
-       echo "$DEBCHANGELOG missing"
-       echo "The current directory should be base source of package"
+if test ! -f IDMETA; then
+       echo "IDMETA is not in current directory"
        exit 1
 fi
-l=`head -1 $DEBCHANGELOG`
-PROD=`echo $l|sed 's/ .*//g'`
-VERSION=`echo $l|sed 's/.*(//g'|sed 's/).*//g'`
-echo "VERSION=$VERSION"
-MAJOR=`echo $VERSION|sed 's/-.*//g'`
-echo "MAJOR=$MAJOR"
-MINOR=`echo $VERSION|sed 's/.*-//g'`
-echo "MINOR=$MINOR"
-TAR=${PROD}-${MAJOR}.tar.gz
+. ./IDMETA
+if test -n "$NAME"; then
+       PRODUCT=$NAME
+else
+       DEBCHANGELOG=debian/changelog
+       if test ! -f $DEBCHANGELOG; then
+               echo "$DEBCHANGELOG missing"
+               echo "The current directory should be base source of package"
+               exit 1
+       fi
+       l=`head -1 $DEBCHANGELOG`
+       PRODUCT=`echo $l|sed 's/ .*//g'`
+fi
+TAR=${PRODUCT}-${VERSION}.tar.gz
+echo "TAR=$TAR"
 if test ! -f ${TAR}; then
        echo "$0: ${TAR} missing"
        exit 1
@@ -22,10 +26,10 @@ set -e
 if test -f Doxyfile; then
        doxygen >out 2>stderr
 fi
-(cd doc && make ${PROD}.pdf index.html)
+(cd doc && make ${PRODUCT}.pdf index.html)
 cp NEWS doc/
-scp ${TAR} ftp.indexdata.dk:/home/ftp/pub/${PROD}/
-tar cz --exclude=.git -f - dox doc|ssh website "cd /var/www/software/${PROD}; tar x --overwrite -z -f -"
+scp ${TAR} ftp.indexdata.dk:/home/ftp/pub/${PRODUCT}/
+tar cz --exclude=.git -f - dox doc|ssh website "cd /var/www/software/${PRODUCT}; tar x --overwrite -z -f -"
 # Local Variables:
 # mode:shell-script
 # sh-indentation: 2