← Back to team overview

launchpad-users team mailing list archive

Re: Is it possible to use git inside debian/rules?


On Wed, Jun 20, 2018 at 03:58:28AM -0300, Gustavo Benedito Costa wrote:
> I know of git-buildpackage, but it does not explain well how to use git on
> debian/rules.
> I built a PKBGUILD for Arch Linux-derived distros, it uses git and this
> configuration is too easy to build, compile, download and install, but I do
> not know how to figure on debian/rules, using git. For example, See my
> https://aur.archlinux.org/cgit/aur.g...-plus-pack-git
> <https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=suru-plus-pack-git>
> Is it possible to use git inside debian/rules?

You can use git if you list it in Build-Depends in debian/control.

However, builds of packages in Launchpad aren't allowed to talk to
external network resources, so it's not clear whether you'll be able to
do much useful with it.  You'd be able to do things like git rev-list
and git rev-parse provided that the source package contains a git
repository, I suppose.

The convention is not to do version handling this way, but rather to get
the version from debian/changelog; after all, you need to update that
anyway.  dpkg provides some helpers to make this easy to do.  If you add
"include /usr/share/dpkg/pkg-info.mk" to debian/rules, then you get a
number of variables defined for you such as $(DEB_VERSION_UPSTREAM) (see
that file for details).

Colin Watson                                    [cjwatson@xxxxxxxxxxxxx]