Howdy all,

Howd can I write ‘debian/rules’ to specify the right ‘--install-data=’
value to ‘setup.py’ for each binary package?


I'm working on modifying an existing Python package (‘python-coverage’)
to install its arch-independent files to ‘/usr/share/${PACKAGE_NAME}/’.

Those files are specifically declared in the ‘setup.py’ call via the
‘package_data’ option. To tell Distutils where those files go,
<URL:http://docs.python.org/2/install/index.html#custom-installation>
says the correct command-line option I should use is
‘--install-data=usr/share/${PACKAGE_NAME}’.

So I'm currently crafting a ‘install-python%’ target to supply the
appropriate option to each ‘python$* setup.py install …’:

=====
PYTHON2_PACKAGE_NAME = python-coverage
PYTHON3_PACKAGE_NAME = python3-coverage
PYTHON2 = $(shell pyversions -vr)
PYTHON3 = $(shell py3versions -vr)
[…]

.PHONY: install-python%
install-python%: PACKAGE_NAME=$(if $(findstr 
${PYTHON3},%),${PYTHON3_PACKAGE_NAME},${PYTHON2_PACKAGE_NAME})
install-python%:
        python$* setup.py install --install-layout=deb \
            --install-data=debian/${PACKAGE_NAME}/usr/share/${PACKAGE_NAME} \
            --root=$(CURDIR)/debian/tmp

[…]
.PHONY: override_dh_auto_install
override_dh_auto_install: $(PYTHON2:%=install-python%) 
$(PYTHON3:%=install-python%)
override_dh_auto_install:
        dh_auto_install
=====

But that seems a baroque way of untangling the correct
‘debian/${PACKAGE_NAME}/usr/share/${PACKAGE_NAME}’ value, and it's not
working for me anyway.

Before I spend more time on this method, am I missing some Debhelper
option that can do the right thing for ‘--install-data’? Or some other
Debian practice that makes it easy to handle arch-independent files for
Python?

-- 
 \      “It seems intuitively obvious to me, which means that it might |
  `\                                           be wrong.” —Chris Torek |
_o__)                                                                  |
Ben Finney


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/7w8uzfqrhn....@benfinney.id.au

Reply via email to