Re: Using python-central for pure-Python package (was: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends})

2007-03-20 Thread Raphael Hertzog
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 [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Using python-central for pure-Python package (was: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends})

2007-03-20 Thread Ben Finney
Raphael Hertzog <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}

2007-03-19 Thread Raphael Hertzog
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/rules2007-03-19 06:44:04 +
> > +++ debian/rules2007-03-19 22:37:56 +
> > @@ -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 [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}

2007-03-19 Thread Ben Finney
Josselin Mouette <[EMAIL PROTECTED]> writes:

> Le lundi 19 mars 2007 à 23:44 +0100, Raphael Hertzog a écrit :
> > === modified file 'debian/rules'
> > --- debian/rules2007-03-19 06:44:04 +
> > +++ debian/rules2007-03-19 22:37:56 +
> > @@ -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 [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}

2007-03-19 Thread Josselin Mouette
Le lundi 19 mars 2007 à 23:44 +0100, Raphael Hertzog a écrit :
> === modified file 'debian/rules'
> --- debian/rules2007-03-19 06:44:04 +
> +++ debian/rules2007-03-19 22:37:56 +
> @@ -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.

-- 
 .''`.
: :' :  We are debian.org. Lower your prices, surrender your code.
`. `'   We will add your hardware and software distinctiveness to
  `-our own. Resistance is futile.


signature.asc
Description: Ceci est une partie de message	numériquement signée


Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}

2007-03-19 Thread Ben Finney
Thanks for your suggestions.

Raphael Hertzog <[EMAIL PROTECTED]> 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.38),
> +Build-Depends: debhelper (>= 5.0.38), 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 [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}

2007-03-19 Thread Raphael Hertzog
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 +
+++ debian/control  2007-03-19 22:29:46 +
@@ -2,7 +2,7 @@
 Section: web
 Priority: extra
 Maintainer: Ben Finney <[EMAIL PROTECTED]>
-Build-Depends: debhelper (>= 5.0.38),
+Build-Depends: debhelper (>= 5.0.38), 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/rules2007-03-19 06:44:04 +
+++ debian/rules2007-03-19 22:37:56 +
@@ -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 [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}

2007-03-19 Thread Ben Finney
Raphael Hertzog <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}

2007-03-19 Thread Raphael Hertzog
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 [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}

2007-03-19 Thread Raphael Hertzog
Hi,

On Tue, 20 Mar 2007, Ben Finney wrote:
> Raphael Hertzog <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}

2007-03-19 Thread Ben Finney
Joey Hess <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}

2007-03-19 Thread Ben Finney
Raphael Hertzog <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}

2007-03-19 Thread Joey Hess
Ben Finney wrote:
> This is referring to the debian/control Depends field:
> 
> Depends: ${python:Depends}
> 
> Earlier, I had
> 
> Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}

By removing misc:Depends, you are simply potentially shooting yourself
in the foot. Debhelper could need to add a dependency via misc:Depends
at some point in the future, and the only way you'll find out about it
is if you notice it in the changelog. If you keep misc:Depends in the
control file, debhelper will automatically do the right thing in the
future.

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

This is a misfeature of dpkg-gencontrol.

-- 
see shy jo


signature.asc
Description: Digital signature


Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}

2007-03-19 Thread Raphael Hertzog
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 [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}

2007-03-19 Thread Pierre Habouzit
On Mon, Mar 19, 2007 at 06:07:56PM +1100, Ben Finney wrote:
> Howdy all,
> 
> I'm attempting to package a Python package according to the
> python-central instructions
> 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?

  you should use dh_pythonsupport (from python-support). (or
dh_pycentral from python-central). python-support comes with a very
friendly documentation in /usr/share/doc/python-support/README.Debian to
help you through python packaging.

-- 
·O·  Pierre Habouzit
··O[EMAIL PROTECTED]
OOOhttp://www.madism.org


pgptc4dXk9fnl.pgp
Description: PGP signature


dpkg-gencontrol: warning: unknown substitution variable ${python:Depends}

2007-03-18 Thread Ben Finney
Howdy all,

I'm attempting to package a Python package according to the
python-central instructions
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 [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]