Przeglądaj źródła

Move variables automatically modified at build time to a new style perl
module.

Guillem Jover 19 lat temu
rodzic
commit
0fd3df5984
6 zmienionych plików z 42 dodań i 0 usunięć
  1. 9 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 1 0
      debian/dpkg.install
  4. 2 0
      m4/perl.m4
  5. 17 0
      scripts/Dpkg.pm
  6. 11 0
      scripts/Makefile.am

+ 9 - 0
ChangeLog

@@ -1,3 +1,12 @@
+2007-07-21  Guillem Jover  <guillem@debian.org>
+
+	* m4/perl.m4 (DPKG_PROG_PERL): Add support for user overridable
+	PERL_LIBDIR variable, autodetected from the system installation.
+	* scripts/Makefile.am (perllibdir): New variable.
+	(nobase_dist_perllib_DATA): Likewise.
+	(install-data-hook): New target.
+	* scripts/Dpkg.pm: New file.
+
 2007-07-03  Frank Lichtenheld  <djpig@debian.org>
 
 	* configure.ac: Bump version to 1.14.6~.

+ 2 - 0
debian/changelog

@@ -14,6 +14,8 @@ dpkg (1.14.6) UNRELEASED; urgency=low
       and remove leftover string from man page split.
     - Split option descriptions so that it gets easier to distinguish.
     - Unify author and copyright information formatting.
+  * Move variables automatically modified at build time to a new style perl
+    module.
 
   [ Updated scripts translations ]
   * French (Frédéric Bothamy, Christian Perrier).

+ 1 - 0
debian/dpkg.install

@@ -35,6 +35,7 @@ usr/share/man/*/*/start-stop-daemon.8
 usr/share/man/*/start-stop-daemon.8
 usr/share/man/*/*/update-alternatives.8
 usr/share/man/*/update-alternatives.8
+usr/share/perl5
 var/lib/dpkg/alternatives
 var/lib/dpkg/info
 var/lib/dpkg/parts

+ 2 - 0
m4/perl.m4

@@ -4,4 +4,6 @@
 AC_DEFUN([DPKG_PROG_PERL],
 [AC_ARG_VAR([PERL], [Perl interpreter])dnl
 AC_PATH_PROG([PERL], [perl], [/usr/bin/perl])dnl
+AC_ARG_VAR([PERL_LIBDIR], [Perl library directory])dnl
+PERL_LIBDIR=`$PERL -MConfig -e 'print $Config{vendorlib}'`dnl
 ])# DPKG_PROG_PERL

+ 17 - 0
scripts/Dpkg.pm

@@ -0,0 +1,17 @@
+package Dpkg;
+
+use strict;
+use warnings;
+
+use base qw(Exporter);
+our @EXPORT = qw($version $progname $admindir $dpkglibdir $pkgdatadir);
+
+our ($progname) = $0 =~ m:.*/(.*):;
+
+# The following lines are automatically fixed at install time
+our $version = "1.14";
+our $admindir = "/var/lib/dpkg";
+our $dpkglibdir = ".";
+our $pkgdatadir = "..";
+
+1;

+ 11 - 0
scripts/Makefile.am

@@ -53,6 +53,9 @@ CLEANFILES = \
 	$(bin_SCRIPTS) $(sbin_SCRIPTS) $(changelog_SCRIPTS) \
 	install-info install-info-stamp
 
+perllibdir = $(PERL_LIBDIR)
+nobase_dist_perllib_DATA = \
+	Dpkg.pm
 
 dist_pkglib_SCRIPTS = \
 	controllib.pl \
@@ -94,6 +97,14 @@ install-data-local:
 	$(mkdir_p) $(DESTDIR)$(sysconfdir)/alternatives
 	$(INSTALL_DATA) $(srcdir)/README.alternatives $(DESTDIR)$(sysconfdir)/alternatives/README
 
+# Ideally we'd use 'sed -i', but unfortunately that's not portable.
+install-data-hook:
+	cp -p $(DESTDIR)$(perllibdir)/Dpkg.pm \
+	      $(DESTDIR)$(perllibdir)/Dpkg.pm.tmp
+	$(do_perl_subst) <$(DESTDIR)$(perllibdir)/Dpkg.pm.tmp \
+	                 >$(DESTDIR)$(perllibdir)/Dpkg.pm
+	rm $(DESTDIR)$(perllibdir)/Dpkg.pm.tmp
+
 uninstall-local:
 	rm -f $(DESTDIR)$(sysconfdir)/alternatives/README
 	rm -f $(DESTDIR)$(sbindir)/install-info