Need an override on install target with "dh --with python2"

Reported by Didier Roche on 2010-12-08
This bug affects 1 person
Affects Status Importance Assigned to Milestone
compizconfig-python (Ubuntu)
Barry Warsaw

Bug Description

As you can see here: http://bazaar.launchpad.net/~compiz/compizconfig-python/ubuntu/annotate/head:/debian/rules

I need an override on dh_auto_build and dh_auto_install to make that package build. If I don't use it, I get:
dh binary --with python2
 rm -f debian/python-compizconfig.substvars
 rm -f debian/python-compizconfig.*.debhelper
 rm -rf debian/python-compizconfig/
 install -d debian/python-compizconfig
 make -j1 install DESTDIR=/home/didrocks/work/compiz/compiz-config-python/build-area/compizconfig-python-
make[1]: entrant dans le répertoire « /home/didrocks/work/compiz/compiz-config-python/build-area/compizconfig-python- »
{'os2_home': {'purelib': '$usersite', 'headers': '$userbase/include/python$py_version_short/$dist_name', 'scripts': '$userbase/bin', 'data': '$userbase', 'platlib': '$usersite'}, 'nt_user': {'purelib': '$usersite', 'headers': '$userbase/Python$py_version_nodot/Include/$dist_name', 'scripts': '$userbase/Scripts', 'data': '$userbase', 'platlib': '$usersite'}, 'os2': {'purelib': '$base/Lib/site-packages', 'headers': '$base/Include/$dist_name', 'scripts': '$base/Scripts', 'data': '$base', 'platlib': '$base/Lib/site-packages'}, 'deb_system': {'purelib': '$base/lib/python$py_version_short/dist-packages', 'headers': '$base/include/python$py_version_short/$dist_name', 'scripts': '$base/bin', 'data': '$base', 'platlib': '$platbase/lib/python$py_version_short/dist-packages'}, 'mac': {'purelib': '$base/Lib/site-packages', 'headers': '$base/Include/$dist_name', 'scripts': '$base/Scripts', 'data': '$base', 'platlib': '$base/Lib/site-packages'}, 'unix_prefix': {'purelib': '$base/lib/python$py_version_short/site-packages', 'headers': '$base/include/python$py_version_short/$dist_name', 'scripts': '$base/bin', 'data': '$base', 'platlib': '$platbase/lib/python$py_version_short/site-packages'}, 'mac_user': {'purelib': '$usersite', 'headers': '$userbase/$py_version_short/include/$dist_name', 'scripts': '$userbase/bin', 'data': '$userbase', 'platlib': '$usersite'}, 'unix_local': {'purelib': '$base/local/lib/python$py_version_short/dist-packages', 'headers': '$base/local/include/python$py_version_short/$dist_name', 'scripts': '$base/local/bin', 'data': '$base/local', 'platlib': '$platbase/local/lib/python$py_version_short/dist-packages'}, 'nt': {'purelib': '$base/Lib/site-packages', 'headers': '$base/Include/$dist_name', 'scripts': '$base/Scripts', 'data': '$base', 'platlib': '$base/Lib/site-packages'}, 'unix_home': {'purelib': '$base/lib/python', 'headers': '$base/include/python/$dist_name', 'scripts': '$base/bin', 'data': '$base', 'platlib': '$base/lib/python'}, 'unix_user': {'purelib': '$usersite', 'headers': '$userbase/include/python$py_version_short/$dist_name', 'scripts': '$userbase/bin', 'data': '$userbase', 'platlib': '$usersite'}}
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: option --prefix not recognized
make[1]: *** [all] Erreur 1
make[1]: quittant le répertoire « /home/didrocks/work/compiz/compiz-config-python/build-area/compizconfig-python- »
dh_auto_install: make -j1 install DESTDIR=/home/didrocks/work/compiz/compiz-config-python/build-area/compizconfig-python- returned exit code 2
make: *** [binary] Erreur 29
dpkg-buildpackage: erreur: fakeroot debian/rules binary a produit une erreur de sortie de type 2
debuild: fatal error at line 1335:
dpkg-buildpackage -rfakeroot -D -us -uc -i -I failed
bzr: ERROR: The build failed.

Didier Roche (didrocks) on 2010-12-08
tags: added: python27
Barry Warsaw (barry) wrote :

On a local chroot:

Log for successful build of compizconfig-python_0.9.2.1-0ubuntu1 on amd64 (dist=natty)

Is this bug report still valid?

Changed in compizconfig-python (Ubuntu):
status: New → Incomplete
Didier Roche (didrocks) wrote :

What is your debian/rules? Did you try removing the override I added?

Barry Warsaw (barry) wrote :

More info:

It's true that 'python setup.py build' does not accept the --prefix argument, so the 'all:' rule in the top level Makefile is bogus. But actually, the entire Makefile is unnecessary. dh_python2 should just Do The Right Thing with the existing setup.py. See the attached branch, which successfully builds for me, but is probably not entire right. It removes the top level Makefile, but in order to do that, I had to pass --source-option=--include-removal to the dpkg-buildpackage call. However, in order to do *that* I had to change the source format to 3.0 (quilt). (source format 1 does not accept that option.)

My recommendation would be to remove the top level Makefile entirely and just let dh_python2 do its thing. This will also let you simplify debian/rules. See the linked branch for reference, or let me know and I'll put together a for-real branch for review.

Changed in compizconfig-python (Ubuntu):
status: Incomplete → Confirmed
importance: Undecided → Medium
milestone: none → natty-alpha-2
Barry Warsaw (barry) wrote :

Oh, if you want me to put together the branch, please assign the bug to me.

Barry Warsaw (barry) wrote :

Never mind the above. With Colin's help I have a fix. Will push a branch and submit a merge proposal momentarily.

Changed in compizconfig-python (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Barry Warsaw (barry)
Changed in compizconfig-python (Ubuntu):
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package compizconfig-python -

compizconfig-python ( natty; urgency=low

  * debian/rules: Simplify, and force the buildsystem to
    python_distutils so that the Makefile is ignored. It isn't
    correct because 'python setup.py build' does not accept the
    --prefix option, and it isn't needed anyway because dh_python2
    does the right thing. (LP: #687419)
 -- Barry Warsaw <email address hidden> Thu, 13 Jan 2011 00:19:16 -0500

Changed in compizconfig-python (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers