From ee5db59fcb66b7fb4685e87f0dd73062b472c24d Mon Sep 17 00:00:00 2001 From: "Philipp A. Hartmann" Date: Mon, 27 Aug 2012 13:23:04 +0200 Subject: [PATCH] Makefile.PL: handle PREFIX consistently This patch fixes the handling of the PREFIX variable in the generated Makefile. The following issues are addressed: * drop explicit PREFIX in WriteMakefile call By default, the local $Config{prefix} setting should be fine. This allows to specify either PREFIX or INSTALL_BASE as Makefile.PL parameter, depending on the user needs. * use PREFIX in extra_install target Previously, pristine-tar, pristine-gz, pristine-bz2, pristine-xz, and zgz were always installed to /usr/bin (if $DESTDIR was not set). Also, the man pages were always installed to /usr/share/man/man1. * call $(MAKE) and pass PREFIX to the build of suse-bzip2 Although PREFIX is not really used during the build of suse-bzip2, it should be passed to the build to enable e.g. the inclusion of the "correct" location during the linking process. Reported-by: Torsten Maehne Signed-off-by: Philipp A. Hartmann --- Makefile.PL | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index d11e396..c1ffad4 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -19,7 +19,7 @@ extra_build: zgz/zgz pristine-tar.spec pod2man -c pristine-bz2 pristine-bz2 > pristine-bz2.1 pod2man -c pristine-xz pristine-xz > pristine-xz.1 pod2man -c zgz zgz/zgz.pod > zgz.1 - make -C pit/suse-bzip2 + $(MAKE) -C pit/suse-bzip2 PREFIX=$(PREFIX) ZGZ_SOURCES = zgz/zgz.c zgz/gzip/*.c zgz/old-bzip2/*.c zgz/zgz: $(ZGZ_SOURCES) @@ -30,17 +30,17 @@ pit/suse-bzip2/suse-bzip2: $(SUSE_BZIP2_SOURCES) gcc -Wall -O2 -o $@ $(SUSE_BZIP2_SOURCES) extra_install: - install -d $(DESTDIR)/usr/bin - install -d $(DESTDIR)/usr/share/man/man1 - install pristine-tar pristine-gz pristine-bz2 pristine-xz zgz/zgz $(DESTDIR)/usr/bin - install -m 0644 *.1 $(DESTDIR)/usr/share/man/man1 + install -d $(DESTDIR)$(PREFIX)/bin + install -d $(DESTDIR)$(PREFIX)/share/man/man1 + install pristine-tar pristine-gz pristine-bz2 pristine-xz zgz/zgz $(DESTDIR)$(PREFIX)/bin + install -m 0644 *.1 $(DESTDIR)$(PREFIX)/share/man/man1 install -d $(DESTDIR)$(ZGZ_LIB)/suse-bzip2 install pit/suse-bzip2/bzip2 $(DESTDIR)$(ZGZ_LIB)/suse-bzip2 install pit/suse-bzip2/libbz2* $(DESTDIR)$(ZGZ_LIB)/suse-bzip2 -extra_clean: pristine-tar.spec +extra_clean: rm -f *.1 zgz/zgz - make clean -C pit/suse-bzip2 + $(MAKE) clean -C pit/suse-bzip2 PREFIX=$(PREFIX) pristine-tar.spec: sed -i "s/Version:.*/Version: $$(perl -e '$$_=<>;print m/\((.*?)\)/' 'Pristine', - PREFIX => "/usr/local", MAN1PODS => {}, MAN3PODS => {}, PMLIBDIRS => ["Pristine"], -- 2.34.1