← Back to team overview

pkgme-devs team mailing list archive

Backend specific rules template?

 

So, pkgme is starting to look really great and I think the last round of
branches merged make it pretty useable.  One thing I'd like to do though is
extend the Python rules file with a few extra targets that I've settled on in
discussion with the debian-python folks.  This is an outgrowth of recent
efforts to package some of my Python packages for Debian.  For example, here's
the rules file from my flufl.i18n package:

-----snip-----
#!/usr/bin/make -f

PYTHON2=$(shell pyversions -vr)
#PYTHON3=$(shell py3versions -vr)

%:
	dh $@ --with python2, --buildsystem python_distutils

test-python%:
	python$* setup.py test -vv

override_dh_auto_test: $(PYTHON2:%=test-python%)

override_dh_installchangelogs:
	dh_installchangelogs -k flufl/i18n/NEWS.txt

override_dh_installdocs:
	python setup.py build_sphinx
	dh_installdocs build/sphinx/html
-----snip-----

A few things:

* I want to add '--with python2' so it uses dh_python2 by default (the new
  goodness in Python packaging).

* Adding the test-python% and override_dh_auto_test targets allow us to
  promote 'pythonX.Y setup.py test' as the standard interface for running the
  test suite as part of the binary package build process.

* override_dh_installdocs hooks into a standard Sphinx build for those
  packages that use it for documentation.

* override_dh_installchangelogs can be promoted as a standard way to use a
  NEWS file for the installed package changelog (not debian/changelog).

Assuming the Python backend can determine whether these targets are supported
by inspecting the setup.py file (and I think they can), the question is,
what's the best way to hook this into pkgme?  Looking at templates/rules,
there doesn't seem to be a good way at the moment.

Clearly the backend will need to provide some information.  But should it also
be able to provide its own debian/rules template?  If so, should that be
distributed with the backend (for third party backends) or provided as output
from the helper scripts?

It does seem like the backends want more control over the rules file than what
currently appears possible.  Suggestions welcome.  I plan on working on an
implementation.

-Barry

Attachment: signature.asc
Description: PGP signature


Follow ups