hg-buildpackage - helper program to maintain Debian packages with mercurial
hg-buildpackage [ -mq / -mqd / tag ] [ <options_for_dpkg-buildpackage> ]
This manual page documents briefly the hg-buildpackage command.
hg-buildpackage is a simple wrapper script to maintain Debian packages with mercurial (AKA hg).
The options -mq and -mqd are intended for non nativ debian package which have a tracking repos and a versioned mercurial patch queue.
Prerequisites
To keep hg-buildpackage as simple as possible there is a number of prerequisites in this build mode.
The first patch in the queue should be the debian patch, and it should be applied before execution of hg-buildpackage.
If commandline option -mpd is given, all patches in the queue which are not allready applied are converted to the dpatch system. The necessarry infrastructure for dpatch should allready be available (best from the allready applied debian patch).
All patches touching files from upstream should be handled through dpatch (thats the reason why the debian patch should be the first patch in the queue).
If you use hg-buildpackage tag some things will happen:
-
Tag the repository with the package version from the changelog
-
Increase debian release by 1
-
Set distribution to unreleased
~/.hgbuildpackage
When executing hg-buildpackage it sources the file ~/.hgbuildpackage if it exists. You can overwrite all environment variables used inside
hg-buildpackage and used for BUILD_COMMAND this way. What you might want to set and adjust are the variables UPSTREAM and BUILD_COMMAND.
You can use pbuilder or cowbuilder for building packages. If you set
BUILD_MODE to "pbuilder" or "cowbuilder" the one you choosed will be used, if
set to "local" dpkg-buildpackage will be used. Per default sudo will be used
to call pbuilder and cowbuilder, if you don't like this set ROOT_COMMAND
to the one you like.
Example for ~/.hgbuildpackage:
# where the upstream sources are
UPSTREAM=/home/mika/grml/hg/upstream/
# define the build command
BUILD_COMMAND="dpkg-buildpackage -k37E272E8 -sa -rfakeroot"
# use cowbuilder
BUILD_MODE="cowbuilder"
# use sudo for getting root (this is the default)
ROOT_COMMAND="sudo"
# call lintian after building
LINTIAN="true"
Short command sequence to modify a patch from a package (eg. zzuf)
hg clone http://hg.grml.org/zzuf
hg clone http://hg.grml.org/zzuf zzuf/.hg/patches
cd zzuf
hg qpush
vi debian/rules
[make some changes]
hg qrefresh
hg qcommit -m 'made some modifications to debian/rules'
cd .hg/patches
hg push
hg(1), hgmergevim(1), hgr(1), hg-mirror(1), hg-cleantree(1)
hg-buildpackage was written by Alexander Wirt <formorer@grml.org>, with mq support from Michael Gebetsroither <gebi@grml.org>
This manual page was original written by Michael Prokop <mika@grml.org> and converted to asciidoc from Michael Gebetsroither <gebi@grml.org>