Help!

dpkg-gencontrol: warning: unknown substitution variable ${..


Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Python RSS
Next:  Please remove live-package from Etch  
Author Message
Ben Finney
External


Since: May 12, 2005
Posts: 2



PostPosted: Mon Mar 19, 2007 4:01 am    Post subject: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}
Archived from groups: linux>debian>maint>python (more info?)

Howdy all,

I'm attempting to package a Python package according to the
python-central instructions
<URL:http://python-modules.alioth.debian.org/python-central_howto.txt>. When
building the package, I get the following output:

=====
[...]
dh_pycentral
dh_link
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}
dh_md5sums
dh_builddeb
=====

This is referring to the debian/control Depends field:

Depends: ${python:Depends}

Earlier, I had

Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}

and 'dpkg-gencontrol' complained about every one of those.

Searching for information about this, I've seen references to
'packagename.substvars' that should be created during package
building. What is it that should be creating these? A missing 'dh_foo'
command?

--
\ "I hate it when my foot falls asleep during the day, because |
`\ that means it's gonna be up all night." -- Steven Wright |
_o__) |
Ben Finney


--
To UNSUBSCRIBE, email to debian-python-REQUEST DeleteThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster DeleteThis @lists.debian.org
Back to top
Raphael Hertzog
External


Since: May 28, 2005
Posts: 461



PostPosted: Mon Mar 19, 2007 12:03 pm    Post subject: Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends} [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Mon, 19 Mar 2007, Ben Finney wrote:
> Searching for information about this, I've seen references to
> 'packagename.substvars' that should be created during package
> building. What is it that should be creating these? A missing 'dh_foo'
> command?

dh_pycentral should do it for you... what's the content of the package ?

If it uses private modules, you should indicate the directory where they
are stored as parameter to dh_pycentral.

Cheers,
--
Raphaël Hertzog

Premier livre français sur Debian GNU/Linux :
http://www.ouaza.com/livre/admin-debian/


--
To UNSUBSCRIBE, email to debian-python-REQUEST DeleteThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster DeleteThis @lists.debian.org
Back to top
Ben Finney
External


Since: Jun 02, 2006
Posts: 125



PostPosted: Mon Mar 19, 2007 5:02 pm    Post subject: Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends} [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Raphael Hertzog <hertzog RemoveThis @debian.org> writes:

> On Mon, 19 Mar 2007, Ben Finney wrote:
> > [dpkg-gencontrol complains about unknown substitution variables]
>
> dh_pycentral should do it for you...

I am using dh_pycentral (as noted in my original message).

Or do you mean that, since I'm using dh_pycentral, I should not use
dh_gencontrol?

> what's the content of the package ?
>
> If it uses private modules, you should indicate the directory where
> they are stored as parameter to dh_pycentral.

What are "private modules"? I've never heard that term used in Python.

--
\ "I think there is a world market for maybe five computers." -- |
`\ Thomas Watson, chairman of IBM, 1943 |
_o__) |
Ben Finney


--
To UNSUBSCRIBE, email to debian-python-REQUEST RemoveThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster RemoveThis @lists.debian.org
Back to top
Raphael Hertzog
External


Since: May 28, 2005
Posts: 461



PostPosted: Mon Mar 19, 2007 6:02 pm    Post subject: Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends} [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi,

On Tue, 20 Mar 2007, Ben Finney wrote:
> Raphael Hertzog <hertzog.RemoveThis@debian.org> writes:
>
> > On Mon, 19 Mar 2007, Ben Finney wrote:
> > > [dpkg-gencontrol complains about unknown substitution variables]
> >
> > dh_pycentral should do it for you...
>
> I am using dh_pycentral (as noted in my original message).
>
> Or do you mean that, since I'm using dh_pycentral, I should not use
> dh_gencontrol?

No I didn't mean that, I just told that dh_pycentral is supposed to
create the substvar for you but since it doesn't I need you to answer this
question:
> > what's the content of the package ?

Because the substvar are generated based on what python scripts and python
modules are found and where they are located... try running the build with
DH_VERBOSE=1 to have more info about what dh_pycentral finds.

Otherwise please put up the package online somewhere so that we can check
what's wrong...

> > If it uses private modules, you should indicate the directory where
> > they are stored as parameter to dh_pycentral.
>
> What are "private modules"? I've never heard that term used in Python.

Python modules (or extensions) installed in a non-public/standard directory.

Check http://wiki.debian.org/DebianPython/NewPolicy

Cheers,
--
Raphaël Hertzog

Premier livre français sur Debian GNU/Linux :
http://www.ouaza.com/livre/admin-debian/


--
To UNSUBSCRIBE, email to debian-python-REQUEST.RemoveThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.RemoveThis@lists.debian.org
Back to top
Raphael Hertzog
External


Since: May 28, 2005
Posts: 461



PostPosted: Mon Mar 19, 2007 6:02 pm    Post subject: Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends} [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, 20 Mar 2007, Ben Finney wrote:
> > > and 'dpkg-gencontrol' complained about every one of those.
> >
> > This is a misfeature of dpkg-gencontrol.
>
> Is 'dh_gencontrol' not useful then? If not, why is it in the
> boilerplate created by 'dh_make'? If it is useful, what am I doing
> differently that it triggering its misfeatures?

Please read man dh_gencontrol... of course that it's still required. A
debian package without a control file is not a Debian package.

dpkg-gencontrol spits outs useless warnings but the work done is still
essential to the creation of a Debian package.

Cheers,
--
Raphaël Hertzog

Premier livre français sur Debian GNU/Linux :
http://www.ouaza.com/livre/admin-debian/


--
To UNSUBSCRIBE, email to debian-python-REQUEST RemoveThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster RemoveThis @lists.debian.org
Back to top
Ben Finney
External


Since: Jun 02, 2006
Posts: 125



PostPosted: Mon Mar 19, 2007 6:02 pm    Post subject: Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends} [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Joey Hess <joeyh.DeleteThis@debian.org> writes:

> Ben Finney wrote:
> > Earlier, I had
> > Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}
>
> By removing misc:Depends, you are simply potentially shooting
> yourself in the foot.

Fair enough.

> > and 'dpkg-gencontrol' complained about every one of those.
>
> This is a misfeature of dpkg-gencontrol.

Is 'dh_gencontrol' not useful then? If not, why is it in the
boilerplate created by 'dh_make'? If it is useful, what am I doing
differently that it triggering its misfeatures?

--
\ "My theory of evolution is that Darwin was adopted." -- Steven |
`\ Wright |
_o__) |
Ben Finney


--
To UNSUBSCRIBE, email to debian-python-REQUEST.DeleteThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.DeleteThis@lists.debian.org
Back to top
Ben Finney
External


Since: Jun 02, 2006
Posts: 125



PostPosted: Mon Mar 19, 2007 7:02 pm    Post subject: Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends} [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Raphael Hertzog <hertzog.DeleteThis@debian.org> writes:

> No I didn't mean that, I just told that dh_pycentral is supposed to
> create the substvar for you but since it doesn't I need you to
> answer this question:
> > > what's the content of the package ?

Pure Python modules, which should be installed to the system
site-packages for use by the application.

> Because the substvar are generated based on what python scripts and
> python modules are found and where they are located... try running
> the build with DH_VERBOSE=1 to have more info about what
> dh_pycentral finds.

=====
....
dh_pycentral
List of versions supported according to XS-Python-Version: 2.4 2.5 2.6 100.0
Pyversions field: 2.4-
"pycentral debhelper gracie debian/gracie"
Pyversions analysis gives: min=2.4, max= (2.4 2.5 2.6)
(grep -s -v python:Versions debian/gracie.substvars; echo python:Versions=\>=2.4) > debian/gracie.substvars.new
mv debian/gracie.substvars.new debian/gracie.substvars
dh_link
....
=====

> Otherwise please put up the package online somewhere so that we can
> check what's wrong...

You can now get it (across my slow link) with Bazaar:

$ bzr branch http://vcs.whitetree.org/bzr/public/gracie/gracie.debian/

> Python modules (or extensions) installed in a non-public/standard
> directory.

I haven't specified any special locations for modules; I'm attempting
to package a single pure-Python egg, to be installed in the standard
location.

--
\ "None can love freedom heartily, but good men; the rest love |
`\ not freedom, but license." -- John Milton |
_o__) |
Ben Finney


--
To UNSUBSCRIBE, email to debian-python-REQUEST.DeleteThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.DeleteThis@lists.debian.org
Back to top
Raphael Hertzog
External


Since: May 28, 2005
Posts: 461



PostPosted: Mon Mar 19, 2007 8:01 pm    Post subject: Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends} [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, 20 Mar 2007, Ben Finney wrote:
> > > > what's the content of the package ?
>
> Pure Python modules, which should be installed to the system
> site-packages for use by the application.

No the package doesn't contain that, only those files:
drwxr-xr-x root/root 0 2007-03-19 23:31 ./
drwxr-xr-x root/root 0 2007-03-19 23:31 ./usr/
drwxr-xr-x root/root 0 2007-03-19 23:31 ./usr/bin/
drwxr-xr-x root/root 0 2007-03-19 23:31 ./usr/sbin/
drwxr-xr-x root/root 0 2007-03-19 23:31 ./usr/share/
drwxr-xr-x root/root 0 2007-03-19 23:31 ./usr/share/doc/
drwxr-xr-x root/root 0 2007-03-19 23:31 ./usr/share/doc/gracie/
-rw-r--r-- root/root 1152 2007-03-19 23:27 ./usr/share/doc/gracie/copyright
-rw-r--r-- root/root 157 2007-03-19 23:27 ./usr/share/doc/gracie/changelog.Debian.gz
drwxr-xr-x root/root 0 2007-03-19 23:31 ./var/
drwxr-xr-x root/root 0 2007-03-19 23:31 ./var/lib/
drwxr-xr-x root/root 0 2007-03-19 23:31 ./var/lib/gracie/
drwxr-xr-x root/root 0 2007-03-19 23:31 ./etc/
drwxr-xr-x root/root 0 2007-03-19 23:31 ./etc/default/
-rw-r--r-- root/root 232 2007-03-19 23:27 ./etc/default/gracie
drwxr-xr-x root/root 0 2007-03-19 23:31 ./etc/init.d/
-rwxr-xr-x root/root 1474 2007-03-19 23:27 ./etc/init.d/gracie
drwxr-xr-x root/root 0 2007-03-19 23:31 ./etc/pam.d/
-rw-r--r-- root/root 181 2007-03-19 23:27 ./etc/pam.d/gracie

That's because you're calling "dh_clean -k" which removes what has been
installed...

Here's a minimal diff of changes:
=== modified file 'debian/control'
--- debian/control 2007-03-19 06:22:59 +0000
+++ debian/control 2007-03-19 22:29:46 +0000
@@ -2,7 +2,7 @@
Section: web
Priority: extra
Maintainer: Ben Finney <ben+debian@benfinney.id.au>
-Build-Depends: debhelper (>= 5.0.3Cool,
+Build-Depends: debhelper (>= 5.0.3Cool, docbook-to-man,
python-all-dev (>= 2.3.5-11),
python-central (>= 0.5.6),
python-setuptools (>= 0.6b3-1)

=== modified file 'debian/rules'
--- debian/rules 2007-03-19 06:44:04 +0000
+++ debian/rules 2007-03-19 22:37:56 +0000
@@ -46,7 +46,6 @@
install: build ${PYVERS:%=install-python%}
dh_testdir
dh_testroot
- dh_clean -k
dh_installdirs
dh_installinit
dh_installpam

But there's more to clean in that package. It's arch: all and should not
be built with all python versions like you're doing. Thus there's no need
to build-depend on python-all-dev but only python-dev, etc.

There's a bashishm in debian/rules:
mv debian/${PACKAGE_NAME}/usr/lib/python$*/site-packages/${MODULE_NAME}{-${DEB_UPSTREAM_VERSION}-py$*,}.egg-info

Cheers,
--
Raphaël Hertzog

Premier livre français sur Debian GNU/Linux :
http://www.ouaza.com/livre/admin-debian/


--
To UNSUBSCRIBE, email to debian-python-REQUEST.DeleteThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.DeleteThis@lists.debian.org
Back to top
Ben Finney
External


Since: Jun 02, 2006
Posts: 125



PostPosted: Mon Mar 19, 2007 8:01 pm    Post subject: Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends} [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks for your suggestions.

Raphael Hertzog <hertzog RemoveThis @debian.org> writes:

> [package contains only files from the debian/ directory]
>
> That's because you're calling "dh_clean -k" [at the start of the
> 'install' rule] which removes what has been installed...

Strange. That's another one placed in debian/rules by 'dh_make'. Under
what circumstances would that be a good thing to do at the start of
the 'install' rule?

> Here's a minimal diff of changes:

> === modified file 'debian/control'
> ...
> -Build-Depends: debhelper (>= 5.0.3Cool,
> +Build-Depends: debhelper (>= 5.0.3Cool, docbook-to-man,

Done.

> === modified file 'debian/rules'
> ...
> install: build ${PYVERS:%=install-python%}
> dh_testdir
> dh_testroot
> - dh_clean -k
> dh_installdirs
> dh_installinit
> dh_installpam

I've now moved 'dh_clean -k' to the end of the 'binary' rule.

> There's a bashishm in debian/rules:
> mv debian/${PACKAGE_NAME}/usr/lib/python$*/site-packages/${MODULE_NAME}{-${DEB_UPSTREAM_VERSION}-py$*,}.egg-info

That was my optimisation. Fixed now.


> But there's more to clean in that package. It's arch: all and should
> not be built with all python versions like you're doing. Thus
> there's no need to build-depend on python-all-dev but only
> python-dev, etc.

I admit to being confused between the recipes for building a Python
package for 'arch: any' and 'arch: all'. You're saying I need to make
this change:

-Build-Depends: python-all-dev
+Build-Depends: python-dev

What other changes do I need to make for an 'arch: all' Python
package?

--
\ "When you go in for a job interview, I think a good thing to |
`\ ask is if they ever press charges." -- Jack Handey |
_o__) |
Ben Finney


--
To UNSUBSCRIBE, email to debian-python-REQUEST RemoveThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster RemoveThis @lists.debian.org
Back to top
Ben Finney
External


Since: Jun 02, 2006
Posts: 125



PostPosted: Mon Mar 19, 2007 10:01 pm    Post subject: Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends} [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Josselin Mouette <joss RemoveThis @debian.org> writes:

> Le lundi 19 mars 2007 à 23:44 +0100, Raphael Hertzog a écrit :
> > === modified file 'debian/rules'
> > --- debian/rules 2007-03-19 06:44:04 +0000
> > +++ debian/rules 2007-03-19 22:37:56 +0000
> > @@ -46,7 +46,6 @@
> > install: build ${PYVERS:%=install-python%}
> > dh_testdir
> > dh_testroot
> > - dh_clean -k
> > dh_installdirs
> > dh_installinit
> > dh_installpam
>
> Nope, dh_clean -k is fine. It's just that installation should start
> after calling it, not in the build target.

Isn't that what is shown above (before the patch removes the line)?

After moving 'dh_clean -k' from the 'install' target to the 'binary'
target, the package now builds properly for me (AFAICT). Where are you
saying that line should be moved to?

--
\ "Some mornings, it's just not worth chewing through the leather |
`\ straps." -- Emo Philips |
_o__) |
Ben Finney


--
To UNSUBSCRIBE, email to debian-python-REQUEST RemoveThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster RemoveThis @lists.debian.org
Back to top
Raphael Hertzog
External


Since: May 28, 2005
Posts: 461



PostPosted: Tue Mar 20, 2007 4:00 am    Post subject: Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends} [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, 20 Mar 2007, Josselin Mouette wrote:
> Le lundi 19 mars 2007 à 23:44 +0100, Raphael Hertzog a écrit :
> > === modified file 'debian/rules'
> > --- debian/rules 2007-03-19 06:44:04 +0000
> > +++ debian/rules 2007-03-19 22:37:56 +0000
> > @@ -46,7 +46,6 @@
> > install: build ${PYVERS:%=install-python%}
> > dh_testdir
> > dh_testroot
> > - dh_clean -k
> > dh_installdirs
> > dh_installinit
> > dh_installpam
>
> Nope, dh_clean -k is fine. It's just that installation should start
> after calling it, not in the build target.

Installation currently happens in "install-pythonX.Y" which is called before the
"install" target since it's a dependency. Thus dh_clean -k removes what's
installed.

Since the package is "arch: all" the python setup.py call should simply be
placed in the install target and the targets install-pythonX.Y should be
removed.

Cheers,
--
Raphaël Hertzog

Premier livre français sur Debian GNU/Linux :
http://www.ouaza.com/livre/admin-debian/


--
To UNSUBSCRIBE, email to debian-python-REQUEST DeleteThis @lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster DeleteThis @lists.debian.org
Back to top
Ben Finney
External


Since: Jun 02, 2006
Posts: 125



PostPosted: Tue Mar 20, 2007 9:01 am    Post subject: Using python-central for pure-Python package (was: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Raphael Hertzog <hertzog.RemoveThis@debian.org> writes:

> On Tue, 20 Mar 2007, Josselin Mouette wrote:
> > Nope, dh_clean -k is fine. It's just that installation should
> > start after calling it, not in the build target.
>
> Installation currently happens in "install-pythonX.Y" which is
> called before the "install" target since it's a dependency. Thus
> dh_clean -k removes what's installed.

I see what you're saying now.

> Since the package is "arch: all" the python setup.py call should
> simply be placed in the install target and the targets
> install-pythonX.Y should be removed.

Part of that target is to rename the generated egg-info directory;
Setuptools creates it as 'foo-N.M-pyX.Y.egg-info', but the
python-central documentation seems to indicate this should be renamed
to 'foo.egg-info':

# install only one Egg dir (without python's version number)
mv debian/${PACKAGE_NAME}/usr/lib/python$*/site-packages/${MODULE_NAME}-${DEB_UPSTREAM_VERSION}-py$*.egg-info \
debian/${PACKAGE_NAME}/usr/lib/python$*/site-packages/${MODULE_NAME}.egg-info

How can this be done properly without knowing the exact name
(including Python version) that Setuptools will create?

--
\ "The most common of all follies is to believe passionately in |
`\ the palpably not true. It is the chief occupation of mankind." |
_o__) -- Henry L. Mencken |
Ben Finney


--
To UNSUBSCRIBE, email to debian-python-REQUEST.RemoveThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.RemoveThis@lists.debian.org
Back to top
Raphael Hertzog
External


Since: May 28, 2005
Posts: 461



PostPosted: Tue Mar 20, 2007 10:02 am    Post subject: Re: Using python-central for pure-Python package (was: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, 20 Mar 2007, Ben Finney wrote:
> Part of that target is to rename the generated egg-info directory;
> Setuptools creates it as 'foo-N.M-pyX.Y.egg-info', but the
> python-central documentation seems to indicate this should be renamed
> to 'foo.egg-info':
>
> # install only one Egg dir (without python's version number)
> mv debian/${PACKAGE_NAME}/usr/lib/python$*/site-packages/${MODULE_NAME}-${DEB_UPSTREAM_VERSION}-py$*.egg-info \
> debian/${PACKAGE_NAME}/usr/lib/python$*/site-packages/${MODULE_NAME}.egg-info
>
> How can this be done properly without knowing the exact name
> (including Python version) that Setuptools will create?

Move that to the install target as well and replace "$*" with the version
of the current python (`pyversions -dv`).

Cheers,
--
Raphaël Hertzog

Premier livre français sur Debian GNU/Linux :
http://www.ouaza.com/livre/admin-debian/


--
To UNSUBSCRIBE, email to debian-python-REQUEST.DeleteThis@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.DeleteThis@lists.debian.org
Back to top
Ben Finney
External


Since: Jun 02, 2006
Posts: 125



PostPosted: Tue Mar 20, 2007 11:02 pm    Post subject: Re: Using python-central for pure-Python package [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Raphael Hertzog <hertzog.TakeThisOut@debian.org> writes:

> Move that to the install target as well and replace "$*" with the
> version of the current python (`pyversions -dv`).

Thanks. That works, but raises other issues I thought we'd addressed.

I'll start a new thread with my questions.

--
\ "The man who is denied the opportunity of taking decisions of |
`\ importance begins to regard as important the decisions he is |
_o__) allowed to take." -- C. Northcote Parkinson |
Ben Finney


--
To UNSUBSCRIBE, email to debian-python-REQUEST.TakeThisOut@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster.TakeThisOut@lists.debian.org
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Python All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum