[SLL] DEB packaging question

Derek Simkowiak dereks at realloc.net
Sun Feb 8 21:13:57 PST 2009


[Cross-posted to ubuntu-devel]

    Hello,
    I'm having a problem building a DEB.  I'm using Python's distutils,
although, for this particular package there, is no actual python code.
It is just "data" files.  I'm trying to use the instructions at
https://wiki.ubuntu.com/PackagingGuide/Python.

    I'm trying to build a very simple package, but it looks like the
build fails because dpkg-buildpackage is using the package name
"PACKAGE" and the version "VERSION".

    Here is a short shell session illustrating the problem.  First, here
is my setup.py and a successful tarball build:

dereks at laptop:~$ cd vm-shell-client/
dereks at laptop:~/vm-shell-client$ ls
bin  etc  MANIFEST.in  setup.py
dereks at laptop:~/vm-shell-client$ cat setup.py
#!/usr/bin/env python

from distutils.core import setup
from glob import glob

setup(name='vm-shell-client',
    version='0.1',
    description='vm-shell client commands',
    long_description='vm-shell client commands\n Config file at
/etc/vm-shell.conf',
    author='Derek Simkowiak',
    author_email='ubuntu at cool-st.com',
    url='http://vm-shell.cool-st.com/',
    data_files = [
        ( '/usr/bin', glob( 'bin/*' ) ),
        ( '/etc', glob( 'etc/*' ) ),
    ],
)

dereks at laptop:~/vm-shell-client$ cat MANIFEST.in
recursive-include bin *
recursive-include etc *
dereks at laptop:~/vm-shell-client$ python setup.py sdist
running sdist
[...snip...]
creating dist
tar -cf dist/vm-shell-client-0.1.tar vm-shell-client-0.1
gzip -f9 dist/vm-shell-client-0.1.tar
removing 'vm-shell-client-0.1' (and everything under it)
dereks at laptop:~/vm-shell-client$ cd dist/
dereks at laptop:~/vm-shell-client/dist$ ls
vm-shell-client-0.1.tar.gz


    So far, so good.  Note that I have the "name" and "version" in the
setup.py, and that the tarball was named correctly (with both package
name and version number).  Now here is what happens when I try to build
a DEB from that, using CDBS (you'll see here my "control" and "rules"
files):


dereks at laptop:~/vm-shell-client/dist$ gzip -dc
vm-shell-client-0.1.tar.gz | tar xfBp -
dereks at laptop:~/vm-shell-client/dist$ mv vm-shell-client-0.1.tar.gz
vm-shell-client-0.1.orig.tar.gz
dereks at laptop:~/vm-shell-client/dist$ cd vm-shell-client-0.1/
dereks at laptop:~/vm-shell-client/dist/vm-shell-client-0.1$ cp -af ~/debian ./
dereks at laptop:~/vm-shell-client/dist/vm-shell-client-0.1$ cat
debian/control
Source: vm-shell-client
Section: Utilities
Priority: optional
Maintainer: Derek Simkowiak <ubuntu at cool-st.com>
Build-Depends: cdbs (>=0.4.49), debhelper (>= 5), python-central (>=0.5.6)
XS-Python-Version: >=2.4
Standards-Version: 3.7.2

Package: vm-shell-client
Architecture: all
XB-Python-Version: ${python:Versions}
Depends: openssh-client, bash, ${python:Depends}, ${misc:Depends}
Description: Run vm-shell commands directly from bash
Config file at /etc/vm-shell.conf
dereks at laptop:~/vm-shell-client/dist/vm-shell-client-0.1$ cat debian/rules
#!/usr/bin/make -f

DEB_PYTHON_SYSTEM=pycentral

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk

# Add here any variable or target overrides you need.
dereks at laptop:~/vm-shell-client/dist/vm-shell-client-0.1$ export
DISTUTILS_DEBUG=1
dereks at laptop:~/vm-shell-client/dist/vm-shell-client-0.1$
dpkg-buildpackage -us -uc
dpkg-buildpackage: set CFLAGS to default value: -g -O2
dpkg-buildpackage: set CPPFLAGS to default value:
dpkg-buildpackage: set LDFLAGS to default value: -Wl,-Bsymbolic-functions
dpkg-buildpackage: set FFLAGS to default value: -g -O2
dpkg-buildpackage: set CXXFLAGS to default value: -g -O2
dpkg-buildpackage: source package PACKAGE
dpkg-buildpackage: source version VERSION
dpkg-buildpackage: source changed by Derek Simkowiak
<dereks at laptop.cool-st.com>
dpkg-buildpackage: host architecture i386
fakeroot debian/rules clean
test -x debian/rules
dh_testroot
dh_clean
dh_clean: Compatibility levels before 4 are deprecated.
cd . && python setup.py clean -a
Distribution.parse_config_files():
options (after parsing config files):
no commands known yet
options (after parsing command line):
option dict for 'clean' command:
  {'all': ('command line', 1)}
running clean
Distribution.get_command_obj(): creating 'clean' command object
  setting options for 'clean' command:
    all = 1 (from command line)
Distribution.get_command_obj(): creating 'build' command object
Distribution.get_command_obj(): creating 'bdist' command object
'build/lib' does not exist -- can't clean it
'build/bdist.linux-i686' does not exist -- can't clean it
'build/scripts-2.5' does not exist -- can't clean it
rm -f python-build-stamp-*
find . -name '*.pyc' -exec rm '{}' ';'
dpkg-source -b vm-shell-client-0.1
dpkg-source: error: source package name `PACKAGE' contains illegal
character `P'
dpkg-buildpackage: failure: dpkg-source -b vm-shell-client-0.1 gave
error exit status 255
dereks at laptop:~/vm-shell-client/dist/vm-shell-client-0.1$

    These lines (pasted from the above) seem to indicate that it's using
the literal values "PACKAGE" and "VERSION":

dpkg-buildpackage: source package PACKAGE
dpkg-buildpackage: source version VERSION
dpkg-source: error: source package name `PACKAGE' contains illegal
character `P'

    Why is it not pulling the package name and version correctly from my
setup.py?  Have I misinterpreted the error message?  How to troubleshoot?

    I'm happy to read any docs, but it is surprisingly difficult to find
information about packaging with Google.  The URL above is the clearest
single explanation I've found... and it's not working for me.

    Any assistance is greatly appreciated.


Thank You,
Derek





More information about the linux-list mailing list