Defining binary package description using package.substvars without getting clobber by debhelper scripts?

StackOverflow https://stackoverflow.com/questions/15399483

  •  23-03-2022
  •  | 
  •  

Question

Okay so I have a debian/rules file that looks something like this:

#!/usr/bin/make -f

PACKAGE = packagename
SRC_VERSION := $(shell grep version setup.py | awk -F [\'] '{print $$2}')
TARBALL = $(PACKAGE)_$(SRC_VERSION).orig.tar.gz
.PHONY: get-orig-source

%:
        # Adding the required helpers
        dh $@ --with python2

get-orig-source:
        python setup.py sdist --formats=gztar
        mv dist/*gz ../$(TARBALL)
        echo "  "$(TARBALL)" created"

Ignoring my bizarre get-orig-source maneuver. I ultimately want to change the Description field in the debian/control file for the binary PACKAGE dynamically. My understanding is that I need to add the variable definition to packagename.substvars in packagename/debian/ . However, because my simple dh $@ --with python2 dynamically generates that file, any addition I could make is now competing with dh processes.

So my question to you good folks of stackoverflow becomes this....

If I want to define the binary package Description dynamically using substvars, how do I do it?

Was it helpful?

Solution

Any package preparation tools can append to a substvars file; just make sure, if you're using debhelper, that you do it after dh_prep gets called, since that will erase any debian/*.substvars files lying around.

You can even use your own substvars file if you like, if you're worried about interfering with debhelper (or debhelper interfering with you). Just add the substvar filename to the arguments for dh_gencontrol with something like this:

override_dh_gencontrol:
        dh_gencontrol -- -Tpath/to/my/substvars

See man deb-substvars, man dpkg-substvars, and man dh_substvars for more information.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top