r21750 - in /trunk/dh-make-perl: debian/changelog dh-make-perl rules.dh7.noxs rules.dh7.xs
dmn at users.alioth.debian.org
dmn at users.alioth.debian.org
Mon Jun 16 18:46:21 UTC 2008
Author: dmn
Date: Mon Jun 16 18:46:21 2008
New Revision: 21750
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=21750
Log:
* add --dh <ver> switch, controlling the set of rules files to use and
desired debhelper compatibility level. Defaults to 5
* add rules.dh7.{xs,noxs}
Added:
trunk/dh-make-perl/rules.dh7.noxs
trunk/dh-make-perl/rules.dh7.xs
Modified:
trunk/dh-make-perl/debian/changelog
trunk/dh-make-perl/dh-make-perl
Modified: trunk/dh-make-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/debian/changelog?rev=21750&op=diff
==============================================================================
--- trunk/dh-make-perl/debian/changelog (original)
+++ trunk/dh-make-perl/debian/changelog Mon Jun 16 18:46:21 2008
@@ -1,7 +1,13 @@
dh-make-perl (0.46) UNRELEASED; urgency=low
+ [ gregor herrmann ]
* Replace "::" with "-" in $perlname in all cases, otherwise the URLs in
debian/watch and debian/control's Homepage field are wrong.
+
+ [ Damyan Ivanov ]
+ * add --dh <ver> switch, controlling the set of rules files to use and
+ desired debhelper compatibility level. Defaults to 5
+ * add rules.dh7.{xs,noxs}
-- gregor herrmann <gregoa at debian.org> Sun, 18 May 2008 16:12:47 +0200
Modified: trunk/dh-make-perl/dh-make-perl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/dh-make-perl?rev=21750&op=diff
==============================================================================
--- trunk/dh-make-perl/dh-make-perl (original)
+++ trunk/dh-make-perl/dh-make-perl Mon Jun 16 18:46:21 2008
@@ -86,7 +86,7 @@
package main;
my (@stdmodules, $min_perl_version, $debstdversion, $priority, $section,
$depends, $bdepends, $bdependsi, $maintainer, $arch, $closes, $date,
- $debiandir, $startdir, $dh_compat, $datadir, $homedir, $email);
+ $debiandir, $startdir, $datadir, $homedir, $email);
our %overrides;
$debstdversion = '3.7.3';
@@ -99,11 +99,9 @@
# is replaced below by calling substitute_perl_dependency
$min_perl_version = '5.6.10-12';
$bdependsi = "perl (>= $min_perl_version)";
-$bdepends = 'debhelper (>= 5)';
$arch = 'all';
$date = `date -R`;
$startdir = getcwd();
-$dh_compat = 5;
$datadir = '/usr/share/dh-make-perl';
$homedir = "$ENV{HOME}/.dh-make-perl";
@@ -119,7 +117,9 @@
my ($module_build);
my (@docs, @examples, $changelog, @args);
-my %opts;
+my %opts = (
+ 'dh' => 5,
+);
my $mod_cpan_version;
@@ -132,9 +132,10 @@
'cpan-mirror=s', 'dbflags=s', 'depends=s', 'desc=s',
'exclude|i:s{,}', 'help', 'install!', 'nometa', 'notest',
'pkg-perl!', 'requiredeps', 'version=s', 'e=s', 'email=s',
- 'p=s', 'packagename=s', 'refresh|R',
+ 'p=s', 'packagename=s', 'refresh|R', 'dh=i'
) or die usage_instructions();
+$bdepends = "debhelper (>= $opts{dh})";
@stdmodules = get_stdmodules();
# Help requested? Nice, we can just die! Isn't it helpful?
@@ -264,7 +265,7 @@
[ --exclude|-i [REGEX] ] [ --notest ] [ --nometa ]
[ --requiredeps ] [ --core-ok ] [ --basepkgs PKGSLIST ]
[ --closes ITPBUG ] [ --packagename|-p PACKAGENAME ]
- [ --email|-e EMAIL ] [ --pkg-perl ]
+ [ --email|-e EMAIL ] [ --pkg-perl ] [ --dh <ver> ]
USAGE
}
@@ -910,24 +911,42 @@
my ($rules_file, $changelog_file, $docs, $examples, $test_line, $fh, @content);
($rules_file, $changelog_file, $docs, $examples) = @_;
- $test_line = ($module_build eq 'Module-Build') ?
- '$(PERL) Build test' : '$(MAKE) test';
- $test_line = "#$test_line" if $opts{notest};
-
- $fh = _file_rw($rules_file);
- @content = $fh->getlines;
-
- $fh->seek(0, 0) || die "Can't rewind $rules_file: $!";
- $fh->truncate(0)|| die "Can't truncate $rules_file: $!";
- for (@content) {
+ if( $opts{dh} < 7 )
+ {
+ $test_line = ($module_build eq 'Module-Build') ?
+ '$(PERL) Build test' : '$(MAKE) test';
+ $test_line = "#$test_line" if $opts{notest};
+
+ $fh = _file_rw($rules_file);
+ @content = $fh->getlines;
+
+ $fh->seek(0, 0) || die "Can't rewind $rules_file: $!";
+ $fh->truncate(0)|| die "Can't truncate $rules_file: $!";
+ for (@content) {
s/#CHANGES#/$changelog_file/g;
s/#EXAMPLES#/join " ", @examples/eg;
s/\s+dh_installexamples\s+$//g; # no need for empty dh_installexamples
- s/#DOCS#/join " ", @docs/eg;
+ s/#DOCS#/join " ", @docs/eg;
s/#TEST#/$test_line/g;
$fh->print($_);
- }
- $fh->close;
+ }
+ $fh->close;
+ }
+ else
+ {
+ if( @examples )
+ {
+ open F, '>>', "$maindir/debian/$pkgname.examples" or die $!;
+ print F "$_\n" foreach @examples;
+ close F;
+ }
+ if( @docs )
+ {
+ open F, '>>', "$maindir/debian/$pkgname.docs" or die $!;
+ print F "$_\n" foreach @docs;
+ close F;
+ }
+ }
}
sub create_control {
@@ -985,7 +1004,11 @@
sub create_rules {
my ($file, $rulesname, $error);
($file) = shift;
- $rulesname = $arch eq 'all'?"rules.$module_build.noxs":"rules.$module_build.xs";
+ $rulesname = (
+ ($opts{dh} eq 7)
+ ? $arch eq 'all'?'rules.dh7.noxs' :'rules.dh7.xs'
+ : $arch eq 'all'?"rules.$module_build.noxs":"rules.$module_build.xs"
+ );
for my $source (("$homedir/$rulesname", "$datadir/$rulesname")) {
copy($source, $file) && do {
@@ -1000,7 +1023,7 @@
sub create_compat {
my $fh = _file_w(shift);
- $fh->print("$dh_compat\n");
+ $fh->print("$opts{dh}\n");
$fh->close;
}
@@ -1274,10 +1297,10 @@
=item B<--bdepends> I<BUILD-DEPENDS>
Manually specify the string to be used for the module's build-dependencies
-(that is, the packages and their versions that have to be installed in order
-to successfully build the package). Keep in mind that packages generated by
-dh-make-perl require debhelper (>= 5) to be specified as a build
-dependency. Same note as for --depends applies here - Use only when needed.
+(that is, the packages and their versions that have to be installed in order to
+successfully build the package). Keep in mind that packages generated by
+dh-make-perl require debhelper to be specified as a build dependency. Same note
+as for --depends applies here - Use only when needed.
=item B<--bdependsi> I<BUILD-DEPENDS-INDEP>
@@ -1373,6 +1396,15 @@
=back
+=item B<--dh ver>
+
+Set desired debhelper version. If C<ver> is 7, generated debian/rules is
+minimalisting, using the auto-mode of debhelper. Also, any additional
+documentation and examples are listed in additinal files under debian/, instead
+of being listed in debian/rules
+
+=back
+
=head1 DESCRIPTION
B<dh-make-perl> will create the files required to build
Added: trunk/dh-make-perl/rules.dh7.noxs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/rules.dh7.noxs?rev=21750&op=file
==============================================================================
--- trunk/dh-make-perl/rules.dh7.noxs (added)
+++ trunk/dh-make-perl/rules.dh7.noxs Mon Jun 16 18:46:21 2008
@@ -1,0 +1,17 @@
+#!/usr/bin/make -f
+
+build:
+ dh $@
+
+clean:
+ dh $@
+
+install: build
+ dh $@
+
+binary-arch:
+
+binary-indep: install
+ dh $@
+
+binary: binary-arch binary-indep
Added: trunk/dh-make-perl/rules.dh7.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/rules.dh7.xs?rev=21750&op=file
==============================================================================
--- trunk/dh-make-perl/rules.dh7.xs (added)
+++ trunk/dh-make-perl/rules.dh7.xs Mon Jun 16 18:46:21 2008
@@ -1,0 +1,17 @@
+#!/usr/bin/make -f
+
+build:
+ dh $@
+
+clean:
+ dh $@
+
+install: build
+ dh $@
+
+binary-arch: install
+ dh $@
+
+binary-indep:
+
+binary: binary-arch binary-indep
More information about the Pkg-perl-cvs-commits
mailing list