##// END OF EJS Templates
builddeb: rename --release option to --codename...
builddeb: rename --release option to --codename Debian and Ubuntu releases have both codenames and traditional version numbers. An entire "branch" of releases is referred to by its codename, and version numbers (e.g. 8.2, 14.04.3) are used to address individual releases. Since we use codenames for building .deb packages, let's call the option and the variable appropriately.

File last commit:

r27209:7fbab10f default
r27209:7fbab10f default
Show More
builddeb
91 lines | 1.9 KiB | text/plain | TextLexer
Augie Fackler
builddeb: new script for building a deb package...
r24971 #!/bin/sh -e
#
# Build a Mercurial debian package from the current repo
#
# Tested on Jessie (stable as of original script authoring.)
Augie Fackler
packaging: extract packagelib for common code from builddeb and buildrpm
r24972 . $(dirname $0)/packagelib.sh
Augie Fackler
builddeb: new script for building a deb package...
r24971 BUILD=1
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 CLEANUP=1
av6
builddeb: rename --release option to --codename...
r27209 CODENAME=jessie
Augie Fackler
builddeb: new script for building a deb package...
r24971 while [ "$1" ]; do
case "$1" in
av6
builddeb: rename --release option to --codename...
r27209 --codename )
Augie Fackler
builddeb: rework how output dir and platform are specified...
r26108 shift
av6
builddeb: rename --release option to --codename...
r27209 CODENAME="$1"
Augie Fackler
builddeb: rework how output dir and platform are specified...
r26108 shift
;;
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 --cleanup )
Augie Fackler
builddeb: new script for building a deb package...
r24971 shift
BUILD=
;;
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 --build )
shift
CLEANUP=
;;
Augie Fackler
builddeb: new script for building a deb package...
r24971 --debbuilddir )
shift
DEBBUILDDIR="$1"
shift
;;
* )
echo "Invalid parameter $1!" 1>&2
exit 1
;;
esac
done
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 trap "if [ '$CLEANUP' ] ; then rm -r '$PWD/debian' ; fi" EXIT
Augie Fackler
builddeb: rework how output dir and platform are specified...
r26108
Augie Fackler
builddeb: new script for building a deb package...
r24971 set -u
if [ ! -d .hg ]; then
echo 'You are not inside a Mercurial repository!' 1>&2
exit 1
fi
Augie Fackler
packaging: extract packagelib for common code from builddeb and buildrpm
r24972 gethgversion
Augie Fackler
packaging: rework version detection and declaration (issue4912)...
r26833 debver="$version"
if [ -n "$type" ] ; then
debver="$debver~$type"
fi
if [ -n "$distance" ] ; then
debver="$debver+$distance-$node"
fi
Augie Fackler
builddeb: new script for building a deb package...
r24971
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 control=debian/control
changelog=debian/changelog
Augie Fackler
builddeb: new script for building a deb package...
r24971
if [ "$BUILD" ]; then
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 if [ -d debian ] ; then
echo "Error! debian control directory already exists!"
exit 1
Augie Fackler
builddeb: new script for building a deb package...
r24971 fi
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148
cp -r $PWD/contrib/debian debian
chmod -R 0755 debian
# This looks like sed -i, but sed -i behaves just differently enough
# between BSD and GNU sed that I gave up and did the dumb thing.
Augie Fackler
packaging: rework version detection and declaration (issue4912)...
r26833 sed "s/__VERSION__/$debver/" < $changelog > $changelog.tmp
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 date=$(date --rfc-2822)
sed "s/__DATE__/$date/" < $changelog.tmp > $changelog
rm $changelog.tmp
debuild -us -uc -b
if [ $? != 0 ]; then
echo 'debuild failed!'
exit 1
fi
Augie Fackler
builddeb: new script for building a deb package...
r24971 fi
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 if [ "$CLEANUP" ] ; then
echo
av6
builddeb: rename --release option to --codename...
r27209 OUTPUTDIR=${OUTPUTDIR:=packages/debian-$CODENAME}
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 find ../mercurial*.deb ../mercurial_*.build ../mercurial_*.changes \
-type f -newer $control -print0 | \
xargs -Inarf -0 mv narf "$OUTPUTDIR"
Augie Fackler
packaging: rework version detection and declaration (issue4912)...
r26833 echo "Built packages for $debver:"
Augie Fackler
debian: switch to using debhelper and dh_python2 to build debs...
r26148 find "$OUTPUTDIR" -type f -newer $control -name '*.deb'
fi