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

Bug#752475: hamlib: hardcodes /usr/lib/perl5



Control: tag -1 + patch

On Mon, 23 Jun 2014 23:58:57 +0300, Niko Tyni wrote:

> This package fails to build with perl_5.20.0-1 from experimental:
> 
>   # Move the appropriate files into the perl package and do some cleanups
>   mv /«PKGBUILDDIR»/debian/tmp/usr/lib/perl/`perl -V:version|cut -d\' -f2`/* \
>           /«PKGBUILDDIR»/debian/libhamlib2-perl/usr/lib/perl5
>   mv: cannot stat '/«PKGBUILDDIR»/debian/tmp/usr/lib/perl/5.20.0/*': No such file or directory
>   make: *** [install-other] Error 1
>   debian/rules:68: recipe for target 'install-other' failed
>   dpkg-buildpackage: error: fakeroot debian/rules binary-arch gave error exit status 2
> 
> I see the package is calling Makefile.PL with PREFIX="/usr" and
> bindings/Makefile.* uses install_site. Using INSTALLDIRS=vendor instead
> would probably be more correct.

Implemented in the attached patch with a patch to bindings/Makefile.*
and using $Config{vendorarch} in debian/rules.


Cheers,
gregor

-- 
 .''`.  Homepage: http://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
 : :' : Debian GNU/Linux user, admin, and developer  -  http://www.debian.org/
 `. `'  Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `-   NP: Richard O'Brian: Eddie
diff -Nru hamlib-1.2.15.3/debian/changelog hamlib-1.2.15.3/debian/changelog
--- hamlib-1.2.15.3/debian/changelog	2012-11-02 20:16:31.000000000 +0100
+++ hamlib-1.2.15.3/debian/changelog	2014-07-04 16:51:34.000000000 +0200
@@ -1,3 +1,13 @@
+hamlib (1.2.15.3-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix "hardcodes /usr/lib/perl5":
+    - add a patch to make the perl build system respect vendor dirs
+    - use dynamic perl path from $Config{vendorarch} in debian/rules
+    (Closes: #752475)
+
+ -- gregor herrmann <gregoa@debian.org>  Fri, 04 Jul 2014 16:08:43 +0200
+
 hamlib (1.2.15.3-1) unstable; urgency=low
 
   * New upstream release:
diff -Nru hamlib-1.2.15.3/debian/patches/perl-dirs.patch hamlib-1.2.15.3/debian/patches/perl-dirs.patch
--- hamlib-1.2.15.3/debian/patches/perl-dirs.patch	1970-01-01 01:00:00.000000000 +0100
+++ hamlib-1.2.15.3/debian/patches/perl-dirs.patch	2014-07-04 16:52:06.000000000 +0200
@@ -0,0 +1,48 @@
+Description: use vendor directories in perl build system
+Origin: vendor
+Forwarded: no
+Author: gregor herrmann <gregoa@debian.org>
+Last-Update: 2014-07-04
+
+--- a/bindings/Makefile.am
++++ b/bindings/Makefile.am
+@@ -32,7 +32,8 @@
+ 			CC="$(CC)"  \
+ 			OBJECT="hamlibperl_wrap.o" \
+ 			VERSION="$(PACKAGE_VERSION)" \
+-			LIBS="-L$(top_builddir)/src/.libs -lhamlib"
++			LIBS="-L$(top_builddir)/src/.libs -lhamlib" \
++			INSTALLDIRS="vendor"
+ 	sed -e 's/^LD_RUN_PATH.*/LD_RUN_PATH =/' Hamlib-pl.mk > Hamlib-pl-norpath.mk
+ 	mv Hamlib-pl-norpath.mk Hamlib-pl.mk
+ 
+@@ -52,7 +53,7 @@
+ 	$(MAKE) $(AM_MAKEFLAGS) -f Hamlib-pl.mk distcheck
+ 
+ install-perl: Hamlib-pl.mk
+-	$(MAKE) $(AM_MAKEFLAGS) -f Hamlib-pl.mk install_site
++	$(MAKE) $(AM_MAKEFLAGS) -f Hamlib-pl.mk install
+ 
+ ## ExtUtils::MakeMaker says uninstall is deprecated and won't remove the files
+ ## anyway, so we'll have to figure out another way to remove the installed files.
+--- a/bindings/Makefile.in
++++ b/bindings/Makefile.in
+@@ -807,7 +807,8 @@
+ 			CC="$(CC)"  \
+ 			OBJECT="hamlibperl_wrap.o" \
+ 			VERSION="$(PACKAGE_VERSION)" \
+-			LIBS="-L$(top_builddir)/src/.libs -lhamlib"
++			LIBS="-L$(top_builddir)/src/.libs -lhamlib" \
++			INSTALLDIRS="vendor"
+ 	sed -e 's/^LD_RUN_PATH.*/LD_RUN_PATH =/' Hamlib-pl.mk > Hamlib-pl-norpath.mk
+ 	mv Hamlib-pl-norpath.mk Hamlib-pl.mk
+ 
+@@ -826,7 +827,7 @@
+ 	$(MAKE) $(AM_MAKEFLAGS) -f Hamlib-pl.mk distcheck
+ 
+ install-perl: Hamlib-pl.mk
+-	$(MAKE) $(AM_MAKEFLAGS) -f Hamlib-pl.mk install_site
++	$(MAKE) $(AM_MAKEFLAGS) -f Hamlib-pl.mk install
+ 
+ uninstall-perl: ## Hamlib-pl.mk
+ 
diff -Nru hamlib-1.2.15.3/debian/patches/series hamlib-1.2.15.3/debian/patches/series
--- hamlib-1.2.15.3/debian/patches/series	2012-11-02 20:22:04.000000000 +0100
+++ hamlib-1.2.15.3/debian/patches/series	2014-07-04 16:25:19.000000000 +0200
@@ -0,0 +1 @@
+perl-dirs.patch
diff -Nru hamlib-1.2.15.3/debian/rules hamlib-1.2.15.3/debian/rules
--- hamlib-1.2.15.3/debian/rules	2012-08-22 00:31:11.000000000 +0200
+++ hamlib-1.2.15.3/debian/rules	2014-07-04 16:49:01.000000000 +0200
@@ -8,7 +8,7 @@
 PYVERS=$(shell pyversions -vr)
 PYDEFAULT=$(shell pyversions -vd)
 
-perlversion = `perl -V:version|cut -d\' -f2`
+PERL_ARCHLIB := $(shell perl -MConfig -e 'print $$Config{vendorarch}')
 
 # enable hardening flags (for debian/compat<9):
 configure_flags += $(shell f=`dpkg-buildflags --export=configure` && echo $$f)
@@ -66,11 +66,7 @@
 
 install-other:
 	# Move the appropriate files into the perl package and do some cleanups
-	mv $(CURDIR)/debian/tmp/usr/lib/perl/$(perlversion)/* \
-		$(CURDIR)/debian/libhamlib2-perl/usr/lib/perl5
-	rm -f $(CURDIR)/debian/libhamlib2-perl/usr/lib/perl5/auto/Hamlib/.packlist
-	rm -f $(CURDIR)/debian/libhamlib2-perl/usr/lib/perl5/auto/Hamlib/Hamlib.bs
-	rm -f $(CURDIR)/debian/libhamlib2-perl/usr/lib/perl5/perllocal.pod
+	dh_install -plibhamlib2-perl --sourcedir=$(CURDIR)/debian/tmp $(PERL_ARCHLIB)
 	cp $(CURDIR)/bindings/perltest.pl \
 		$(CURDIR)/debian/libhamlib2-perl/usr/share/doc/libhamlib2-perl/
 	# libhamlib2, libhamlib-dev, libhamlib2++c2, libhamlib++-dev,

Attachment: signature.asc
Description: Digital Signature


Reply to: