]> git.ipfire.org Git - location/libloc.git/commitdiff
Install Perl files to Perl vendor directory
authorPetr Písař <ppisar@redhat.com>
Tue, 4 Oct 2022 11:51:21 +0000 (13:51 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 29 Oct 2022 13:18:32 +0000 (13:18 +0000)
On Fedora, the original code placed files into /usr/lib64/perl5/5.36/.
That location is not recognized by Fedora perl.

It also supresses installation and uninstallaion of packlist and perlocal
inventory files. They cannot be reliably uninstalled without
corrupting them.

Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
configure.ac

index 049832f46f242caf297cae415d3b1591c62d7e91..7f0d8d045285df5bf234e3665ef0797a7c4480b6 100644 (file)
@@ -241,7 +241,8 @@ build-perl: src/libloc.la
        @test -e $(builddir)/src/perl/t/Location.t || ln -s --relative $(srcdir)/src/perl/t/Location.t $(builddir)/src/perl/t/
        @test -e $(builddir)/src/perl/typemap || ln -s --relative $(srcdir)/src/perl/typemap $(builddir)/src/perl/
 
-       cd $(builddir)/src/perl && $(PERL) Makefile.PL PREFIX="$(prefix)" \
+       cd $(builddir)/src/perl && $(PERL) Makefile.PL NO_PACKLIST=1 NO_PERLLOCAL=1 \
+               INSTALLDIRS=vendor \
                INC="-I$(abs_srcdir)/src" LIBS="-L$(abs_builddir)/src/.libs -lloc"
        cd $(builddir)/src/perl && $(MAKE)
        touch build-perl
@@ -253,20 +254,20 @@ check-perl: testdata.db build-perl
 
 .PHONY: install-perl
 install-perl: build-perl
-       cd $(builddir)/src/perl && $(MAKE) install DESTIDR=$(DESTDIR)
+       cd $(builddir)/src/perl && $(MAKE) install DESTDIR=$(DESTDIR)
 
 .PHONY: clean-perl
 clean-perl:
        cd $(builddir)/src/perl && $(MAKE) distclean
-       rm build-perl
+       rm -f build-perl
 
 .PHONY: uninstall-perl
 uninstall-perl:
-       rm -rvf \
-               $(DESTDIR)/$(prefix)/lib/*/perl/*/Location.pm \
-               $(DESTDIR)/$(prefix)/lib/*/perl/*/auto/Location \
-               $(DESTDIR)/$(prefix)/lib/*/perl/*/perllocal.pod \
-               $(DESTDIR)/$(prefix)/man/man3/Location.3pm
+       rm -vf \
+               $(DESTDIR)/@PERL_MODPATH@/Location.pm \
+               $(DESTDIR)/@PERL_MODPATH@/auto/Location/Location.so \
+               $(DESTDIR)/@PERL_MANPATH@/Location.3pm
+       -rmdir $(DESTDIR)/@PERL_MODPATH@/auto/Location
 
 bin_SCRIPTS = \
        src/scripts/location \
index 93ac7eb2a02763bc47781f4fc424671f006b7a56..f814974b07b45a6e162b4c86f4658a448c7f8b36 100644 (file)
@@ -175,10 +175,18 @@ PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}])
 AC_PATH_PROG(PERL, perl, no)
 AC_SUBST(PERL)
 
-AX_PROG_PERL_MODULES(ExtUtils::MakeMaker,, AC_MSG_WARN(Need some Perl modules))
+AX_PROG_PERL_MODULES(Config ExtUtils::MakeMaker,, AC_MSG_WARN(Need some Perl modules))
 
 AC_ARG_ENABLE(perl, AS_HELP_STRING([--disable-perl], [do not build the perl modules]), [],[enable_perl=yes])
 AM_CONDITIONAL(ENABLE_PERL, test "$enable_perl" = "yes")
+AS_IF([test "$enable_perl" = "yes"],
+      [
+       PERL_MODPATH=$($PERL -MConfig -e 'print $Config{installvendorarch}')
+       PERL_MANPATH=$($PERL -MConfig -e 'print $Config{installvendorman3dir}')
+       AC_SUBST(PERL_MODPATH)
+       AC_SUBST(PERL_MANPATH)
+       ],
+)
 
 dnl Checking for libresolv
 case "${host}" in
@@ -223,5 +231,8 @@ AC_MSG_RESULT([
         systemd support:        ${have_systemd}
 
        Bindings:
-         perl:                 ${enable_perl}
+         Perl:                 ${enable_perl}
+         Perl module path:     ${PERL_MODPATH}
+         Perl manual path:     ${PERL_MANPATH}
+      }
 ])