Skip Menu |

This queue is for tickets about the CPANPLUS-Dist-Deb CPAN distribution.

Report information
The Basics
Id: 37879
Status: new
Priority: 0/
Queue: CPANPLUS-Dist-Deb

People
Owner: Nobody in particular
Requestors: andreas.marienborg [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.10
Fixed in: (no value)



Subject: the generated rules file only includes things installed under /usr
The attached patch adds an install_prefix dist-opts options, which defaults to /usr. It stores it as an accessor on the dist, and then the constants for the rules file have all been updated to use this new accessor where they used hardcoded /usr before. I also documented the option as part of the prepare docs. I did not write tests, since there where no rules tests to piggy back on :p
Subject: install_prefix.diff
diff -urH CPANPLUS-Dist-Deb-0.10.orig/lib/CPANPLUS/Dist/Deb/Constants.pm CPANPLUS-Dist-Deb-0.10/lib/CPANPLUS/Dist/Deb/Constants.pm --- CPANPLUS-Dist-Deb-0.10.orig/lib/CPANPLUS/Dist/Deb/Constants.pm 2008-07-23 12:06:21.000000000 +0000 +++ CPANPLUS-Dist-Deb-0.10/lib/CPANPLUS/Dist/Deb/Constants.pm 2008-07-23 12:33:49.000000000 +0000 @@ -180,6 +180,9 @@ use constant DEB_DEFAULT_PACKAGE_VERSION => 1; + +use constant DEB_DEFAULT_INSTALL_PREFIX + => '/usr'; use constant DEB_VERSION => sub {my $mod = shift or return; my $ver = shift || @@ -401,10 +404,10 @@ dh_testroot dh_clean -d -k - $(MAKE) install DESTDIR=$(TMP) PREFIX=/usr + $(MAKE) install DESTDIR=$(TMP) PREFIX=]. $self->status->dist->status->install_prefix .q[ @find . -type f | grep '/perllocal.pod$$' | xargs rm -f - dh_movefiles /usr + dh_movefiles ]. $self->status->dist->status->install_prefix .q[ touch install-stamp @@ -497,10 +500,10 @@ dh_testroot dh_clean -d -k - $(MAKE) install DESTDIR=$(TMP) PREFIX=/usr + $(MAKE) install DESTDIR=$(TMP) PREFIX=]. $self->status->dist->status->install_prefix .q[ -find . -type f | grep '/perllocal.pod$$' | xargs rm -f - dh_movefiles /usr + dh_movefiles ]. $self->status->dist->status->install_prefix .q[ touch install-stamp @@ -600,7 +603,7 @@ # remove it for now -find . -type f | grep '/.packlist$$' | xargs rm -f - dh_movefiles /usr + dh_movefiles ]. $self->status->dist->status->install_prefix .q[ touch install-stamp @@ -701,7 +704,7 @@ # remove it for now -find . -type f | grep '/.packlist$$' | xargs rm -f - dh_movefiles /usr + dh_movefiles ]. $self->status->dist->status->install_prefix .q[ touch install-stamp diff -urH CPANPLUS-Dist-Deb-0.10.orig/lib/CPANPLUS/Dist/Deb.pm CPANPLUS-Dist-Deb-0.10/lib/CPANPLUS/Dist/Deb.pm --- CPANPLUS-Dist-Deb-0.10.orig/lib/CPANPLUS/Dist/Deb.pm 2008-07-23 12:06:21.000000000 +0000 +++ CPANPLUS-Dist-Deb-0.10/lib/CPANPLUS/Dist/Deb.pm 2008-07-23 12:35:50.000000000 +0000 @@ -239,14 +239,15 @@ $status->mk_accessors(qw[rules compat changelog copyright control distdir debiandir package package_name package_filename readme prefix builddir _tmp_output_dir files - _prepare_args _create_args _install_args]); + _prepare_args _create_args _install_args + install_prefix]); ### XXX we might not be using _args properly! return 1; } =pod -=head2 $loc = $dist->prepare([perl => '/path/to/perl', distdir => '/path/to/build/debs', copyright => 'copyright_text', prereq_target => TARGET, force => BOOL, verbose => BOOL, skiptest => BOOL, prefix => 'prefix-', distribution => 'disttype', deb_version => INT]) +=head2 $loc = $dist->prepare([perl => '/path/to/perl', distdir => '/path/to/build/debs', copyright => 'copyright_text', prereq_target => TARGET, force => BOOL, verbose => BOOL, skiptest => BOOL, prefix => 'prefix-', distribution => 'disttype', deb_version => INT, install_prefix => '/usr']) C<prepare> preps a distribution for creation. This means it will create all meta data files required by C<dpkg-buildpackage> to build a C<.deb> @@ -259,6 +260,11 @@ will also ignore a bad return value from the C<test> stage and still allow the operation to return true. +You can specify install_prefix to change it from the default /usr. You +need to do this if your make install routine install things outside /usr. +You can for instance set it to / to include everything that gets installed +in the debian file. + Returns true on success and false on failure. You may then call C<< $deb->create >> on the object to create the @@ -288,7 +294,7 @@ my $args; my( $verbose,$force,$perl,$prereq_target,$distdir,$copyright,$prefix, - $keep_source,$distribution, $deb_version,$prereq_build); + $keep_source,$distribution, $deb_version,$prereq_build, $install_prefix); { local $Params::Check::ALLOW_UNKNOWN = 1; my $tmpl = { verbose => { default => $conf->get_conf('verbose'), @@ -308,6 +314,8 @@ deb_version => { default => DEB_DEFAULT_PACKAGE_VERSION, store => \$deb_version }, #keep_source => { default => 0, store => \$keep_source }, + install_prefix => { default => DEB_DEFAULT_INSTALL_PREFIX, + store => \$install_prefix }, prereq_build => { default => 0, store => \$prereq_build }, }; @@ -315,6 +323,8 @@ } ### store the prefix for later use + $dist->status->install_prefix( $install_prefix ); + $dist->status->prefix( $prefix ); $dist->status->package_name( DEB_PACKAGE_NAME->($self, $prefix) );