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

2011-08-24 Thread Rafael Cunha de Almeida
On Wed, Aug 24, 2011 at 04:30:45AM +, Rafael Cunha de Almeida wrote:
 I attached a very simple example package in order to make this bug
 easier to talk about.

I used verb in the wrong tense. I should have said ``I will attach''.
I'm attaching it now (hopefully.)


foo.tar.gz
Description: Binary data


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

2011-08-24 Thread Jonas Smedegaard
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


signature.asc
Description: Digital signature


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

2011-08-23 Thread Rafael Cunha de Almeida
Package: cdbs
Version: 0.4.96
Severity: normal

Hello,

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?

The same thing happens on cdbs from squeeze (setting DEB_PYTHON_SYSTEM
properly, of course), but I don't know how taget both versions of the
package. So I'm reporting this on sid, which has the latest version.

[]'s
Rafael


-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages cdbs depends on:
ii  debhelper 8.9.6  helper programs for debian/rules

Versions of packages cdbs recommends:
ii  autotools-dev 20110511.1 Update infrastructure for config.{

Versions of packages cdbs suggests:
ii  devscripts2.11.1 scripts to make the life of a Debi

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org