-*)
do_help=yes
;;
- esac
+ esac
shift
done
usage 1 1>&2
fi
+if test "$DEBIAN_DIST" -o "$UBUNTU_DIST"; then
+ debian=true
+else
+ debian=false
+fi
+
D0=`dirname $0`
ID_DEB_BUILD=`cd $D0; pwd`
PBUILDROOT=${ID_DEB_BUILD}/id-pbuild-root.sh
if $upload; then
:
else
- if test "${SUDO_USER}"; then
- if test ! -d deb-src; then
+ if $debian; then
+ if test "${SUDO_USER}"; then
+ if test ! -d deb-src; then
+ $MKDEBSRC
+ fi
+ else
+ if test -d deb-src; then
+ rm -f deb-src/*.gz
+ if test $? -ne 0; then
+ echo "deb-src could not be removed. Remove deb-src manually"
+ exit 1
+ fi
+ fi
$MKDEBSRC
fi
else
- if test -d deb-src; then
- rm -f deb-src/*.gz
- if test $? -ne 0; then
- echo "deb-src could not be removed. Remove deb-src manually"
- exit 1
- fi
- fi
- $MKDEBSRC
+ mkdir -p deb-src
fi
fi
+
cd deb-src
-for f in *.dsc; do
- if test -f "$f"; then
- PKG=$f
+if $debian; then
+ for f in *.dsc; do
+ if test -f "$f"; then
+ PKG=$f
+ fi
+ done
+ if test -z "$PKG"; then
+ echo "Specify .dsc file"
+ exit 1
+ fi
+ if test ! -e "$PKG"; then
+ echo "${PKG} does not exist"
+ exit 1
+ fi
+ if grep "Architecture: all" $PKG >/dev/null; then
+ USE_ARCHS=i386
+ else
+ USE_ARCHS=$ARCHS
fi
-done
-if test -z "$PKG"; then
- echo "Specify .dsc file"
- exit 1
-fi
-if test ! -e "$PKG"; then
- echo "${PKG} does not exist"
- exit 1
fi
+
if test -z "$PRODUCT"; then
- PRODUCT=`echo *.dsc|sed 's/_.*//g'`
+ PRODUCT=$NAME
fi
-if grep "Architecture: all" $PKG >/dev/null; then
- USE_ARCHS=i386
-else
- USE_ARCHS=$ARCHS
+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 "Ubuntu distros: $UBUNTU_DIST"
echo "Debian distros: $DEBIAN_DIST"
echo "Centos distros: $CENTOS_DIST"
-if test "${SUDO_USER}"; then
- echo "Running as sudo."
- echo "Tip: You can avoid it by adding the following in /etc/sudoers"
- echo "${SUDO_USER} ALL=NOPASSWD: ${ID_DEB_BUILD}/id-pbuild-root.sh"
- HOME_EXPORT=/home/${SUDO_USER}
-else
- sudo -k
- HOME_EXPORT=$HOME
-fi
-if test ! -f ${HOME_EXPORT}/.pbuilderrc; then
- echo "${HOME_EXPORT}/.pbuilderrc missing"
- exit 1
+
+if $debian; then
+ if test "${SUDO_USER}"; then
+ echo "Running as sudo."
+ echo "Tip: You can avoid it by adding the following in /etc/sudoers"
+ echo "${SUDO_USER} ALL=NOPASSWD: ${ID_DEB_BUILD}/id-pbuild-root.sh"
+ HOME_EXPORT=/home/${SUDO_USER}
+ else
+ sudo -k
+ HOME_EXPORT=$HOME
+ fi
+ if test ! -f ${HOME_EXPORT}/.pbuilderrc; then
+ echo "${HOME_EXPORT}/.pbuilderrc missing"
+ exit 1
+ fi
fi
if $upload; then