[Build-common-hackers] Bug#639098: Bug#639098: python-distutils.mk needs DEB_PYTHON_DESTDIR when non-python packages are created by the same source

Jonas Smedegaard dr at jones.dk
Wed Aug 24 09:48:56 UTC 2011


On 11-08-24 at 04:30am, Rafael Cunha de Almeida wrote:
> I attached a very simple example package in order to make this bug 
> easier to talk about. The source package name is foo and it provides 
> two packages: foo and python-foo.
> 
> Package foo has only one binary, also called foo. It is installed to 
> /usr/bin/foo using foo.install file.
> 
> Package python-foo has a python package called foolizer and a module 
> foo inside it. It can be installed using distutils.
> 
> At first I set up my debian/rules like this:
> 
>   #!/usr/bin/make -f
>   
>   include /usr/share/cdbs/1/rules/debhelper.mk
>   
>   DEB_PYTHON_MODULE_PACKAGES = python-foo
>   
>   include /usr/share/cdbs/1/class/python-distutils.mk
> 
> it did not work (actually, at first I tried without
> DEB_PYTHON_MODULE_PACKAGES, but it didn't work either). After some
> debugging, I found out that this would work:
> 
>   #!/usr/bin/make -f
>   
>   include /usr/share/cdbs/1/rules/debhelper.mk
>   
>   DEB_PYTHON_MODULE_PACKAGES = python-foo
>   DEB_PYTHON_DESTDIR = $(CURDIR)/debian/python-foo
>   
>   include /usr/share/cdbs/1/class/python-distutils.mk
> 
> If I don't set DEB_PYTHON_DESTDIR, then the destination directory for
> python modules becomes debian/tmp. That never gets added into python-foo
> package. By setting that variable, it is properly installed in
> debian/python-foo and it gets included in python-foo package.
> 
> It seems odd to me, because if I remove package foo from debian/control,
> then all works even without setting DEB_PYTHON_DESTDIR or
> DEB_PYTHON_MODULE_PACKAGES (actually, DEB_PYTHON_MODULE_PACKAGES never
> seems to be necessary). Perhaps that's even the proper way. But why does
> it need to be that way? Can't it be deduced from
> DEB_PYTHON_MODULE_PACKAGES?

You need not set DEB_PYTHON_MODULE_PACKAGES when you are packaging 
Python modules and follow the Debian Python Policy about package names: 
python-distutils.mk by default act only on binary packages starting with 
python-* and python3-*.

So just drop that superfluous DEB_PYTHON_MODULE_PACKAGES line.

Default behaviour of python-distutils.mk is to install into debian/tmp 
when there is only a single binary package, and into debian/$(package) 
when there are more than one.

Default behaviour of debhelper.mk is to use files from debian/tmp when 
there is only a single binary package, and not do anything by default 
when there are more than one.

You need to "spell it out" to debhelper which pieces should go where in 
which binary package.

Or use something like this, to rely on debhelper figuring it out for 
you:

DEB_DH_INSTALL_ARGS = --sourcedir=debian/tmp


Hope that helps,

 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/build-common-hackers/attachments/20110824/5a535a96/attachment.pgp>


More information about the Build-common-hackers mailing list