updated debian build & upload scripts
This commit is contained in:
parent
94d07eed53
commit
e697a2d6cf
|
@ -2,16 +2,17 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
DEVSCRIPTS="${HOME}/.devscripts"
|
export DEBFULLNAME="Daniel Pavel"
|
||||||
. "${DEVSCRIPTS}"
|
export DEBMAIL=${DEBMAIL:-daniel.pavel+debian@gmail.com}
|
||||||
|
export DEBSIGN_KEYID=${DEBSIGN_KEYID:-0B34B1A7}
|
||||||
|
|
||||||
DISTRIBUTION=${DISTRIBUTION:-debian}
|
DISTRIBUTION=${DISTRIBUTION:-debian}
|
||||||
|
DIST_RELEASE=${DIST_RELEASE:-unstable}
|
||||||
|
|
||||||
cd "$(dirname "$0")/.."
|
cd "$(dirname "$0")/.."
|
||||||
UDEV_RULES="$PWD/rules.d"
|
UDEV_RULES="$PWD/rules.d"
|
||||||
DEBIAN_FILES="$PWD/packaging/debian"
|
DEBIAN_FILES="$PWD/packaging/debian"
|
||||||
DIST="$PWD/dist/$DISTRIBUTION"
|
DIST_TARGET="$PWD/dist/$DISTRIBUTION"
|
||||||
export DIST_RELEASE=${DIST_RELEASE:-UNRELEASED}
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# build a python sdist package
|
# build a python sdist package
|
||||||
|
@ -25,22 +26,29 @@ BUILD_DIR="$TMPDIR/build-$DISTRIBUTION"
|
||||||
python "setup.py" sdist --dist-dir="$BUILD_DIR" --formats=gztar
|
python "setup.py" sdist --dist-dir="$BUILD_DIR" --formats=gztar
|
||||||
|
|
||||||
cd "$BUILD_DIR"
|
cd "$BUILD_DIR"
|
||||||
|
|
||||||
|
# guess the version of the built sdist
|
||||||
S=$(ls -1t solaar-*.tar.gz | tail -n 1)
|
S=$(ls -1t solaar-*.tar.gz | tail -n 1)
|
||||||
test -r "$S"
|
test -r "$S"
|
||||||
VERSION=${S#solaar-}
|
VERSION=${S#solaar-}
|
||||||
VERSION=${VERSION%.tar.gz}
|
VERSION=${VERSION%.tar.gz}
|
||||||
|
|
||||||
|
# check the last version built
|
||||||
LAST=$(head -n 1 "$DEBIAN_FILES/changelog" | grep -o ' ([0-9.-]*) ')
|
LAST=$(head -n 1 "$DEBIAN_FILES/changelog" | grep -o ' ([0-9.-]*) ')
|
||||||
LAST=${LAST# (}
|
LAST=${LAST# (}
|
||||||
LAST=${LAST%) }
|
LAST=${LAST%) }
|
||||||
LAST_VERSION=$(echo "$LAST" | cut -d- -f 1)
|
LAST_VERSION=$(echo "$LAST" | cut -d- -f 1)
|
||||||
LAST_BUILD=$(echo "$LAST" | cut -d- -f 2)
|
LAST_BUILD=$(echo "$LAST" | cut -d- -f 2)
|
||||||
|
|
||||||
if test -n "$BUILD_EXTRA"; then
|
if test "$BUILD_EXTRA"; then
|
||||||
|
# when building for a distro other than Debian, keep the same build number,
|
||||||
|
# just append the BUILD_EXTRA to it
|
||||||
BUILD_NUMBER=$LAST_BUILD
|
BUILD_NUMBER=$LAST_BUILD
|
||||||
elif dpkg --compare-versions "$VERSION" gt "$LAST_VERSION"; then
|
elif dpkg --compare-versions "$VERSION" gt "$LAST_VERSION"; then
|
||||||
|
# the version increased, this is the first build for this version
|
||||||
BUILD_NUMBER=1
|
BUILD_NUMBER=1
|
||||||
else
|
else
|
||||||
|
# increase the build number
|
||||||
BUILD_NUMBER=$(($LAST_BUILD + 1))
|
BUILD_NUMBER=$(($LAST_BUILD + 1))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -48,12 +56,16 @@ tar xfz "$S"
|
||||||
mv "$S" solaar_$VERSION.orig.tar.gz
|
mv "$S" solaar_$VERSION.orig.tar.gz
|
||||||
|
|
||||||
#
|
#
|
||||||
# finally build the package
|
# preparing to build the package
|
||||||
#
|
#
|
||||||
|
|
||||||
cd solaar-$VERSION
|
cd solaar-$VERSION
|
||||||
cp -a "$DEBIAN_FILES" .
|
cp -a "$DEBIAN_FILES" .
|
||||||
|
|
||||||
|
# udev rules, if not already set
|
||||||
test -s debian/solaar.udev || cp -a "$UDEV_RULES"/??-*.rules debian/solaar.udev
|
test -s debian/solaar.udev || cp -a "$UDEV_RULES"/??-*.rules debian/solaar.udev
|
||||||
|
|
||||||
|
# generate the changelog with the right version number and release
|
||||||
cat >debian/changelog <<_CHANGELOG
|
cat >debian/changelog <<_CHANGELOG
|
||||||
solaar ($VERSION-$BUILD_NUMBER$BUILD_EXTRA) $DIST_RELEASE; urgency=low
|
solaar ($VERSION-$BUILD_NUMBER$BUILD_EXTRA) $DIST_RELEASE; urgency=low
|
||||||
|
|
||||||
|
@ -62,17 +74,26 @@ solaar ($VERSION-$BUILD_NUMBER$BUILD_EXTRA) $DIST_RELEASE; urgency=low
|
||||||
-- $DEBFULLNAME <$DEBMAIL> $(date -R)
|
-- $DEBFULLNAME <$DEBMAIL> $(date -R)
|
||||||
|
|
||||||
_CHANGELOG
|
_CHANGELOG
|
||||||
|
|
||||||
# if this is the main (Debian) build, update the changelog
|
# if this is the main (Debian) build, update the changelog
|
||||||
test "$BUILD_EXTRA" || cp -a debian/changelog "$DEBIAN_FILES"/changelog
|
test "$BUILD_EXTRA" || cp -a debian/changelog "$DEBIAN_FILES"/changelog
|
||||||
|
|
||||||
|
# other distros may have extra files to place in debian/
|
||||||
test "$DEBIAN_FILES_EXTRA" && cp -a $DEBIAN_FILES_EXTRA/* debian/
|
test "$DEBIAN_FILES_EXTRA" && cp -a $DEBIAN_FILES_EXTRA/* debian/
|
||||||
|
|
||||||
/usr/bin/debuild ${DEBUILD_ARGS:-$@} \
|
# set the right maintainer email address
|
||||||
--lintian-opts --profile $DISTRIBUTION
|
sed -i -e "s/^Maintainer: .*$/Maintainer: $DEBFULLNAME <$DEBMAIL>/" debian/control
|
||||||
|
|
||||||
/bin/rm --force "$DIST"/*
|
export DEBUILD_LINTIAN_OPTS="--profile $DISTRIBUTION"
|
||||||
/bin/mkdir --parents "$DIST"
|
export DEBUILD_DPKG_BUILDPACKAGE_OPTS="-sa"
|
||||||
cp -a -t "$DIST" ../solaar_$VERSION* || true
|
export DEBUILD_PRESERVE_ENVVARS='GPG_AGENT_INFO,DISPLAY'
|
||||||
cp -a -t "$DIST" ../solaar-*_$VERSION* || true
|
/usr/bin/debuild $@
|
||||||
cd "$DIST"
|
|
||||||
#cp -av -t ../../../packages/ * || true
|
#
|
||||||
|
# place the resulting files in dist/$DISTRIBUTION/
|
||||||
|
#
|
||||||
|
|
||||||
|
/bin/rm --force "$DIST_TARGET"/*
|
||||||
|
/bin/mkdir --parents "$DIST_TARGET"
|
||||||
|
cp -a -t "$DIST_TARGET" ../solaar_$VERSION*
|
||||||
|
cp -a -t "$DIST_TARGET" ../solaar-*_$VERSION* || true
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
cd "$(dirname "$0")/.."
|
|
||||||
|
|
||||||
DISTRIBUTION=ubuntu
|
|
||||||
DIST_RELEASE=precise
|
|
||||||
DEBIAN_FILES_EXTRA="$PWD/packaging/ubuntu"
|
|
||||||
BUILD_EXTRA=ppa1
|
|
||||||
DEBUILD_ARGS="-sa $@"
|
|
||||||
. packaging/build_deb.sh
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
[solaar-ppa]
|
||||||
|
fqdn = ppa.launchpad.net
|
||||||
|
method = ftp
|
||||||
|
incoming = ~daniel.pavel/solaar/ubuntu/
|
||||||
|
login = anonymous
|
||||||
|
allow_unsigned_uploads = 0
|
||||||
|
|
||||||
|
[solaar-snapshots-ppa]
|
||||||
|
fqdn = ppa.launchpad.net
|
||||||
|
method = ftp
|
||||||
|
incoming = ~daniel.pavel/solaar-snapshots/ubuntu/
|
||||||
|
login = anonymous
|
||||||
|
allow_unsigned_uploads = 0
|
||||||
|
|
||||||
|
[mentors]
|
||||||
|
fqdn = mentors.debian.net
|
||||||
|
incoming = /upload
|
||||||
|
method = http
|
||||||
|
allow_unsigned_uploads = 0
|
||||||
|
progress_indicator = 2
|
||||||
|
# Allow uploads for UNRELEASED packages
|
||||||
|
allowed_distributions = .*
|
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
export DEBSIGN_KEYID=07D8904B
|
||||||
|
export DEBMAIL="daniel.pavel+launchpad@gmail.com"
|
||||||
|
|
||||||
|
export DISTRIBUTION=ubuntu
|
||||||
|
export DIST_RELEASE=precise
|
||||||
|
export DEBIAN_FILES_EXTRA="$PWD/packaging/ubuntu"
|
||||||
|
export BUILD_EXTRA=ppa1
|
||||||
|
|
||||||
|
Z="$(readlink -f "$(dirname "$0")")"
|
||||||
|
"$Z"/build_deb.sh -S
|
||||||
|
|
||||||
|
cd "$Z/../dist/ubuntu/"
|
||||||
|
/usr/bin/dput --config="$Z/dput.cf" solaar-snapshots-ppa solaar_*_source.changes
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
Z="$(readlink -f "$(dirname "$0")")"
|
||||||
|
"$Z"/build_deb.sh -S
|
||||||
|
|
||||||
|
cd "$Z/../dist/debian/"
|
||||||
|
/usr/bin/dput --config="$Z/dput.cf" mentors solaar_*_source.changes
|
|
@ -1,18 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
cd "$(dirname "$0")"/..
|
|
||||||
./packaging/build_ppa.sh -S
|
|
||||||
|
|
||||||
cd ./dist/ubuntu/
|
|
||||||
|
|
||||||
C=${XDG_CONFIG_HOME:-$HOME/.config}/debian/dput.cf
|
|
||||||
if test -r "$C"; then
|
|
||||||
C="--config $C"
|
|
||||||
elif test -r "$HOME/.dput.cf"; then
|
|
||||||
C="--config=$HOME/.dput.cf"
|
|
||||||
else
|
|
||||||
unset C
|
|
||||||
fi
|
|
||||||
/usr/bin/dput $C solaar-snapshots-ppa solaar_*_source.changes
|
|
Loading…
Reference in New Issue