[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.3.3-59-gb6b4ca8



The following commit has been merged in the master branch:
commit eee3d7649a48c25b5ddc8abcd23c0bf90c04477d
Author: Niko Tyni <ntyni@debian.org>
Date:   Sat Feb 6 15:09:20 2010 +0200

    Check for deprecated Debian-specific Makefile.PL usage
    
    As discussed in #545904, about 250 perl library packages use an obsolete
    way of overriding the installation directory at build time.

diff --git a/checks/rules b/checks/rules
index a3ae42a..5af27af 100644
--- a/checks/rules
+++ b/checks/rules
@@ -144,9 +144,11 @@ my @current_targets;
 my %rules_per_target;
 my %debhelper_group;
 my $maybe_skipping;
+my $uses_makefile_pl = 0;
 while (<RULES>) {
     next if /^\s*\#/;
     $includes = 1 if m/^ *[s-]?include\s+/;
+    $uses_makefile_pl = 1 if m/Makefile\.PL/;
 
     # Check for DH_COMPAT settings outside of any rule, which are now
     # deprecated.  It's a bit easier structurally to do this here than in
@@ -169,6 +171,9 @@ while (<RULES>) {
     if (/^\s*DEB_AUTO_UPDATE_DEBIAN_CONTROL\s*=\s*yes/) {
         tag 'debian-rules-automatically-updates-control', "line $.";
     }
+    if ($uses_makefile_pl && /install.*PREFIX/ && !/DESTDIR/) {
+        tag 'debian-rules-perl-makemaker-prefix-is-deprecated', "line $.";
+    }
 
     # Keep track of whether this portion of debian/rules may be optional
     if (/^ifn?(eq|def)\s/) {
diff --git a/checks/rules.desc b/checks/rules.desc
index 9f3df07..801f291 100644
--- a/checks/rules.desc
+++ b/checks/rules.desc
@@ -158,3 +158,20 @@ Info: The specified package is required to run the clean target of
  <tt>debian/rules</tt> and therefore must be listed in Build-Depends, not
  Build-Depends-Indep, even if no architecture-dependent packages are
  built.
+
+Tag: debian-rules-perl-makemaker-prefix-is-deprecated
+Severity: normal
+Certainty: possible
+Info: The package appears to use an ExtUtils::MakeMaker (Makefile.PL)
+ build system and sets the temporary installation path by overriding
+ PREFIX when calling `make install'. This only works because of a Debian
+ specific ExtUtils::MakeMaker change that the maintainers of the Debian
+ perl package want to remove once the packages needing it are fixed.
+ .
+ The preferred way to set the installation directory is with DESTDIR.
+ Setting PREFIX should not be necessary at all. For example, the line
+  make install PREFIX=$(TMP)/usr          # WRONG
+ should be replaced with
+  make install DESTDIR=$(TMP)             # RIGHT
+ .
+ See http://bugs.debian.org/545904 for more details.
diff --git a/t/tests/rules-perl-makemaker/debian/Foo.pm b/t/tests/rules-perl-makemaker/debian/Foo.pm
new file mode 100644
index 0000000..533bb3c
--- /dev/null
+++ b/t/tests/rules-perl-makemaker/debian/Foo.pm
@@ -0,0 +1,3 @@
+package Foo;
+our $VERSION = '1.1';
+1;
diff --git a/t/tests/rules-perl-makemaker/debian/Makefile.PL b/t/tests/rules-perl-makemaker/debian/Makefile.PL
new file mode 100644
index 0000000..ccd0d80
--- /dev/null
+++ b/t/tests/rules-perl-makemaker/debian/Makefile.PL
@@ -0,0 +1,6 @@
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+    NAME	=> 'Foo',
+    VERSION_FROM => 'Foo.pm',
+);
diff --git a/debian/compat b/t/tests/rules-perl-makemaker/debian/debian/compat
similarity index 100%
copy from debian/compat
copy to t/tests/rules-perl-makemaker/debian/debian/compat
diff --git a/t/tests/files-empty/debian/debian/control.in b/t/tests/rules-perl-makemaker/debian/debian/control.in
similarity index 92%
copy from t/tests/files-empty/debian/debian/control.in
copy to t/tests/rules-perl-makemaker/debian/debian/control.in
index fc7a0e1..d52ef24 100644
--- a/t/tests/files-empty/debian/debian/control.in
+++ b/t/tests/rules-perl-makemaker/debian/debian/control.in
@@ -3,7 +3,7 @@ Priority: extra
 Section: {$section}
 Maintainer: {$author}
 Standards-Version: {$standards_version}
-Build-Depends: debhelper (>= 7.0.50~)
+Build-Depends: debhelper (>= 5)
 
 Package: {$srcpkg}
 Architecture: {$architecture}
diff --git a/t/tests/rules-perl-makemaker/debian/debian/rules b/t/tests/rules-perl-makemaker/debian/debian/rules
new file mode 100755
index 0000000..4559967
--- /dev/null
+++ b/t/tests/rules-perl-makemaker/debian/debian/rules
@@ -0,0 +1,63 @@
+#!/usr/bin/make -f
+
+#export DH_VERBOSE=1
+
+PERL ?= /usr/bin/perl
+
+PACKAGE = $(shell dh_listpackages)
+TMP     = $(CURDIR)/debian/$(PACKAGE)
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+
+	perl Makefile.PL verbose INSTALLDIRS=vendor
+
+	touch configure-stamp
+
+build: build-stamp
+build-stamp: configure-stamp
+	dh_testdir
+
+	$(MAKE) OPTIMIZE="-O2 -g -Wall"
+	$(MAKE) test
+
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+
+	[ ! -e Makefile ] || $(MAKE) distclean
+
+	dh_clean configure-stamp build-stamp
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	$(MAKE) install PREFIX=$(TMP)/usr
+
+	# Remove any empty directories
+	find $(TMP)/usr -type d -empty -print0 | xargs --no-run-if-empty --null rmdir -p --ignore-fail-on-non-empty
+
+binary-arch:
+
+binary-indep: build install
+	dh_testdir
+	dh_testroot
+	dh_installdocs
+	dh_installman
+	dh_installchangelogs
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_perl
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/t/tests/rules-perl-makemaker/desc b/t/tests/rules-perl-makemaker/desc
new file mode 100644
index 0000000..04e6615
--- /dev/null
+++ b/t/tests/rules-perl-makemaker/desc
@@ -0,0 +1,6 @@
+Testname: rules-perl-makemaker
+Sequence: 6000
+Version: 1.0
+Description: Check detection of PREFIX usage in Makefile.PL based packages
+Test-For: debian-rules-perl-makemaker-prefix-is-deprecated
+References: Debian Bug#545904
diff --git a/t/tests/rules-perl-makemaker/tags b/t/tests/rules-perl-makemaker/tags
new file mode 100644
index 0000000..96918df
--- /dev/null
+++ b/t/tests/rules-perl-makemaker/tags
@@ -0,0 +1 @@
+W: rules-perl-makemaker source: debian-rules-perl-makemaker-prefix-is-deprecated line 41

-- 
Debian package checker


Reply to: