-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
+ DEBCONTROL=debian/control
+ if test ! -f $DEBCONTROL; then
+ echo "$DEBCONTROL missing"
+ echo "The current directory should be base source of package"
+ exit 1
+ fi
+ PRODUCT=`awk '/Source:/ {print $2}' $DEBCONTROL`
+fi
+TAR=${PRODUCT}-${VERSION}.tar.gz
+echo "TAR=$TAR"