From e80f2517a230b73b1de554e6fe19e81947c2b665 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Peter=20M=C3=BCller?= <peter.mueller@ipfire.org>
Date: Tue, 31 Jan 2023 10:04:31 +0000
Subject: [PATCH] Revert "Install Perl files to Perl vendor directory"

This reverts commit b26c2109eaf229d8c297266f12cd4757d7f14eb8.
---
 Makefile.am  | 17 ++++++++---------
 configure.ac | 12 +-----------
 2 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 7f0d8d0..049832f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -241,8 +241,7 @@ 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 NO_PACKLIST=1 NO_PERLLOCAL=1 \
-		INSTALLDIRS=vendor \
+	cd $(builddir)/src/perl && $(PERL) Makefile.PL PREFIX="$(prefix)" \
 		INC="-I$(abs_srcdir)/src" LIBS="-L$(abs_builddir)/src/.libs -lloc"
 	cd $(builddir)/src/perl && $(MAKE)
 	touch build-perl
@@ -254,20 +253,20 @@ check-perl: testdata.db build-perl
 
 .PHONY: install-perl
 install-perl: build-perl
-	cd $(builddir)/src/perl && $(MAKE) install DESTDIR=$(DESTDIR)
+	cd $(builddir)/src/perl && $(MAKE) install DESTIDR=$(DESTDIR)
 
 .PHONY: clean-perl
 clean-perl:
 	cd $(builddir)/src/perl && $(MAKE) distclean
-	rm -f build-perl
+	rm build-perl
 
 .PHONY: uninstall-perl
 uninstall-perl:
-	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
+	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
 
 bin_SCRIPTS = \
 	src/scripts/location \
diff --git a/configure.ac b/configure.ac
index 96e6b0e..f6d30f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -175,18 +175,10 @@ PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}])
 AC_PATH_PROG(PERL, perl, no)
 AC_SUBST(PERL)
 
-AX_PROG_PERL_MODULES(Config ExtUtils::MakeMaker,, AC_MSG_WARN(Need some Perl modules))
+AX_PROG_PERL_MODULES(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
@@ -232,6 +224,4 @@ AC_MSG_RESULT([
 
 	Bindings:
 	  Perl:			${enable_perl}
-	  Perl module path:     ${PERL_MODPATH}
-	  Perl manual path:     ${PERL_MANPATH}
 ])
-- 
2.35.3

