perl 5.8.8: Move configuration files for libnet and cpan to /etc/perl to
authorJamie Lenehan <lenehan@twibble.org>
Thu, 26 Apr 2007 07:10:41 +0000 (07:10 +0000)
committerJamie Lenehan <lenehan@twibble.org>
Thu, 26 Apr 2007 07:10:41 +0000 (07:10 +0000)
match the debian configuration. It moves these configuration files to /etc/
to allow for read only /usr installations.

packages/perl/perl-5.8.8/58_debian_cpan_config_path.patch [new file with mode: 0644]
packages/perl/perl-5.8.8/60_debian_libnet_config_path.patch [new file with mode: 0644]
packages/perl/perl_5.8.8.bb

diff --git a/packages/perl/perl-5.8.8/58_debian_cpan_config_path.patch b/packages/perl/perl-5.8.8/58_debian_cpan_config_path.patch
new file mode 100644 (file)
index 0000000..b38c70c
--- /dev/null
@@ -0,0 +1,14 @@
+Set location of CPAN::Config to /etc/perl as /usr may not be writable.
+
+diff -Naur --exclude=debian perl-5.8.8.orig/lib/CPAN.pm perl-5.8.8/lib/CPAN.pm
+--- perl-5.8.8.orig/lib/CPAN.pm        2006-02-01 01:11:22.000000000 +1100
++++ perl-5.8.8/lib/CPAN.pm     2006-02-02 23:49:26.000000000 +1100
+@@ -1246,7 +1246,7 @@
+       $configpm = $INC{"CPAN/MyConfig.pm"};
+       $redo++;
+     } else {
+-      my($path_to_cpan) = File::Basename::dirname($INC{"CPAN.pm"});
++      my($path_to_cpan) = '/etc/perl';
+       my($configpmdir) = File::Spec->catdir($path_to_cpan,"CPAN");
+       my($configpmtest) = File::Spec->catfile($configpmdir,"Config.pm");
+       if (-d $configpmdir or File::Path::mkpath($configpmdir)) {
diff --git a/packages/perl/perl-5.8.8/60_debian_libnet_config_path.patch b/packages/perl/perl-5.8.8/60_debian_libnet_config_path.patch
new file mode 100644 (file)
index 0000000..7842ce1
--- /dev/null
@@ -0,0 +1,16 @@
+Set location of libnet.cfg to /etc/perl/Net as /usr may not be writable.
+
+diff -Naur --exclude=debian perl-5.8.8.orig/lib/Net/Config.pm perl-5.8.8/lib/Net/Config.pm
+--- perl-5.8.8.orig/lib/Net/Config.pm  2002-03-01 01:04:31.000000000 +1100
++++ perl-5.8.8/lib/Net/Config.pm       2006-02-03 00:00:55.000000000 +1100
+@@ -57,9 +57,8 @@
+ }
+ TRY_INTERNET_CONFIG
+-my $file = __FILE__;
++my $file = '/etc/perl/Net/libnet.cfg';
+ my $ref;
+-$file =~ s/Config.pm/libnet.cfg/;
+ if ( -f $file ) {
+     $ref = eval { local $SIG{__DIE__}; do $file };
+     if (ref($ref) eq 'HASH') {
index d97cd4c..68b7d6f 100644 (file)
@@ -5,7 +5,7 @@ LICENSE = "Artistic|GPL"
 PRIORITY = "optional"
 # We need gnugrep (for -I)
 DEPENDS = "virtual/db perl-native grep-native"
-PR = "r4"
+PR = "r5"
 
 # Major part of version
 PVM = "5.8"
@@ -20,6 +20,8 @@ SRC_URI = "ftp://ftp.funet.fi/pub/CPAN/src/perl-${PV}.tar.gz \
         file://generate-sh.patch;patch=1 \
         file://53_debian_mod_paths.patch;patch=1 \
         file://54_debian_perldoc-r.patch;patch=1 \
+        file://58_debian_cpan_config_path.patch;patch=1 \
+        file://60_debian_libnet_config_path.patch;patch=1 \
         file://62_debian_cpan_definstalldirs.patch;patch=1 \
         file://64_debian_enc2xs_inc.patch;patch=1 \
         file://config.sh \
@@ -49,7 +51,6 @@ do_configure() {
 
         # Generate configuration
         rm -f config.sh-${TARGET_ARCH}-${TARGET_OS}
-        touch config.sh-${TARGET_ARCH}-${TARGET_OS}
         for i in ${WORKDIR}/config.sh \
                  ${WORKDIR}/config.sh-${@siteinfo_get_bits(d)} \
                  ${WORKDIR}/config.sh-${@siteinfo_get_bits(d)}-${@siteinfo_get_endianess(d)}; do
@@ -66,9 +67,10 @@ do_configure() {
         #done
 
         # Update some paths in the configuration
-        sed -i -e 's,@DESTDIR@,${D},g' config.sh-${TARGET_ARCH}-${TARGET_OS}
-        sed -i -e 's,@ARCH@,${TARGET_ARCH}-${TARGET_OS},g' config.sh-${TARGET_ARCH}-${TARGET_OS}
-        sed -i -e "s%/usr/include/%${STAGING_INCDIR}/%g" config.sh-${TARGET_ARCH}-${TARGET_OS}
+        sed -i -e 's,@DESTDIR@,${D},g' \
+               -e 's,@ARCH@,${TARGET_ARCH}-${TARGET_OS},g' \
+               -e "s%/usr/include/%${STAGING_INCDIR}/%g" \
+            config.sh-${TARGET_ARCH}-${TARGET_OS}
 
         if test "${MACHINE}" != "native"; then
             # These are strewn all over the source tree