[--centos=distros]
[--upload]
[--concurrency=N]
- [--product=X]
EOF
exit $1
}
--concurrency=*)
concurrency=$optarg
;;
- --product=*)
- PRODUCT=$optarg
- ;;
-*)
do_help=yes
;;
exit 1
fi
-MKDEBSRC=${ID_DEB_BUILD}/id-mk-deb-src.sh
-if test ! -x $MKDEBSRC; then
- echo "$MKDEBSRC not found"
- exit 1
+if test "$CENTOS_DIST"; then
+ RNAME=`rpm -q --specfile *.spec --queryformat "%{NAME};" | cut -d ";" -f1`
+ echo "RNAME=$RNAME"
+ if test "$NAME" -a "$NAME" != "$RNAME"; then
+ echo "NAME in IDMETA ($NAME) does not match RPM spec NAME ($RNAME)"
+ exit 1
+ fi
+ PRODUCT=$RNAME
fi
-
-if ! $upload; then
- if $debian; then
+if $debian; then
+ DNAME=`awk '/Source:/ {print $2}' debian/control`
+ if test "$NAME" -a "$NAME" != "$DNAME"; then
+ echo "NAME in IDMETA ($NAME) does not match debian/control ($DNAME)"
+ exit 1
+ fi
+ PRODUCT=$DNAME
+ if ! $upload; then
+ MKDEBSRC=${ID_DEB_BUILD}/id-mk-deb-src.sh
+ if test ! -x $MKDEBSRC; then
+ echo "$MKDEBSRC not found"
+ exit 1
+ fi
+ DCH=debian/changelog
+ if ! git ls-files $DCH --error-unmatch >/dev/null 2>&1; then
+ rm -f $DCH
+ echo "${DNAME} (${VERSION}-1.indexdata) unstable; urgency=medium" >$DCH
+ echo '' >>$DCH
+ echo ' * Upstream.' >>$DCH
+ echo '' >>$DCH
+ echo " -- `git config --get user.name` <`git config --get user.email`> `date -R`" >>$DCH
+ echo '' >>$DCH
+ fi
if test "${SUDO_USER}"; then
if test ! -d deb-src; then
$MKDEBSRC
fi
$MKDEBSRC
fi
- else
- mkdir -p deb-src
fi
+else
+ mkdir -p deb-src
fi
cd deb-src
fi
fi
-if test -z "$PRODUCT"; then
- PRODUCT=$NAME
-fi
-if test -z "$PRODUCT"; then
- if $debian; then
- PRODUCT=`echo *.dsc|sed 's/_.*//g'`
- else
- PRODUCT=`cd ..;rpm -q --specfile *.spec --queryformat "%{NAME};" | cut -d ";" -f1`
- fi
-fi
-echo "Dsc $PKG . Product $PRODUCT"
+echo "Product: $PRODUCT"
echo "Ubuntu distros: $UBUNTU_DIST"
echo "Debian distros: $DEBIAN_DIST"
echo "Centos distros: $CENTOS_DIST"
fi
#we will keep this to get the project name
-DEBCHANGELOG=debian/changelog
if [ "x$NAME" != x ]; then
echo "Got name $NAME from IDMETA file"
-elif test -f $DEBCHANGELOG; then
- NAME=`head -1 $DEBCHANGELOG|sed 's/ .*//g'`
- echo "Warning: assuming name $NAME from $DEBCHANGELOG"
+elif test -f debian/control; then
+ NAME=`awk '/Source:/ {print $2}' debian/control`
+ echo "Warning: assuming name $NAME from debian/control"
else
- die "No $DEBCHANGELOG and no NAME in IDMETA"
+ die "No debian/control and no NAME in IDMETA"
fi
if [ "x$2" != x ]; then