home *** CD-ROM | disk | FTP | other *** search
- #!/usr/bin/perl -w
-
- =head1 NAME
-
- dh_pycentral - use the python-central framework to handle Python modules and extensions
-
- =cut
-
- use strict;
- use File::Find;
- use Debian::Debhelper::Dh_Lib;
-
- =head1 SYNOPSIS
-
- B<dh_pycentral> [S<I<debhelper options>>] [B<-n>]
-
- =head1 DESCRIPTION
-
- dh_pycentral is a debhelper program that will scan your package, detect
- public Python modules and move them in /usr/share/pycentral so that
- python-central can byte-compile those for all supported Python versions.
- Extensions are kept into the original installation location.
-
- Moving the files to the pycentral location can be disabled by setting
- the environment varibale DH_PYCENTRAL to a string containing the
- string B<nomove>.
-
- You must have filled the XS-Python-Version header to indicate the
- set of python versions that are going to be supported. dh_pycentral
- expects the XB-Python-Version for each binary package it is supposed
- to work on.
-
- =head1 OPTIONS
-
- =over 4
-
- =item B<-n>, B<--noscripts>
-
- Do not modify postinst/postrm scripts.
-
- =back
-
- =head1 CONFORMS TO
-
- Python policy as of 2006-06-10
-
- =cut
-
- init();
-
-
- foreach my $package (@{$dh{DOPACKAGES}}) {
- my $tmp = tmpdir($package);
-
- # Move *.py files if needed
- doit("pycentral debhelper $package $tmp");
-
- # Check that we have *.py files!
- my $found = 0;
- find sub {
- return if $File::Find::dir =~ m|^$tmp/usr/share/doc/|;
- return unless -f and /\.py$/;
- $found++;
- }, $tmp;
-
- if ($found or -d "$tmp/usr/share/pycentral") {
- addsubstvar($package, "python:Depends", "python-central", ">= 0.5");
- if (! $dh{NOSCRIPTS}) {
- autoscript($package,"postinst","postinst-pycentral","s%#PACKAGE#%$package%");
- autoscript($package,"prerm","prerm-pycentral","s%#PACKAGE#%$package%");
- }
- }
- }
-
- =head1 SEE ALSO
-
- L<debhelper(7)>
-
- This program is a part of python-central but is made to work with debhelper.
-
- =head1 AUTHORS
-
- Raphael Hertzog <hertzog@debian.org>
-
- =cut
-