LP#1638377: Allow perl to be installed in non-standard locations
authorMike Rylander <mrylander@gmail.com>
Wed, 17 Aug 2016 17:25:35 +0000 (13:25 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Wed, 15 Mar 2017 20:43:16 +0000 (16:43 -0400)
Add --with-perlbase configure option to specify
an alternative location for installing the Perl modules. This
can be useful for setups that want to run the Perl modules
from a shared filesystem or environments that need to run
multiple versions of OpenSRF simultaneously.

Users of --with-perlbase are responsible for ensuring that
PERL5LIB is set appropriately.

To test
-------
[1] Use --with-perlbase during the configure step, e.g.,

    ./configure --with-perlbase /tmp/perl

[2] Run make; make check; sudo make install
[3] Verify that the Perl modules are installed under
    /tmp/perl.
[4] Make a change to a Perl source file, then
    go to src/perlmods, then run sudo ./Build install. Verify
    that it remembers the --with-perlbase directory
    and installs the updated module there.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>

Makefile.am
Open-ILS/src/perlmods/Makefile.am
configure.ac

index 51b512c..e11134c 100644 (file)
@@ -23,6 +23,7 @@ export REPORTERDIR=@localstatedir@/reporter
 export SOCK=@localstatedir@/lock
 export PID=@localstatedir@/run
 export LOG=@localstatedir@/log
+export PERL_BASE=@PERL_BASE@
 
 
 
index b443110..ea27663 100644 (file)
@@ -32,7 +32,7 @@ install: build-perl
        ./Build install
 
 build-perl: lib/OpenILS/Utils/Cronscript.pm
-       perl Build.PL --destdir $(DESTDIR) || make -s build-perl-fail
+       @if [ "${PERL_BASE}" = 'x' ]; then perl Build.PL --destdir $(DESTDIR) || make -s build-perl-fail; else perl Build.PL --install_base ${PERL_BASE} --destdir $(DESTDIR) || make -s build-perl-fail; fi;
 
 lib/OpenILS/Utils/Cronscript.pm: Makefile lib/OpenILS/Utils/Cronscript.pm.in
        $(do_subst) lib/OpenILS/Utils/Cronscript.pm.in > "$@"
index 74e6b3b..d49a437 100644 (file)
@@ -218,6 +218,12 @@ AC_ARG_WITH([dbi],
 [DBI_LIBS=${withval}],
 [DBI_LIBS=/usr/lib/x86_64-linux-gnu/dbd/])
 
+AC_ARG_WITH([perlbase],
+[  --with-perlbase=path        base location to install Perl modules (default based on Config.pm)],
+[PERL_BASE=${withval}],
+[PERL_BASE=x])
+AC_SUBST([PERL_BASE])
+
 # If the passed in value doesn't work, fall back to reasonable defaults
 # Distributions are starting to package a good version of libdbi / libdbd
 if ! test -d "$DBI_LIBS"; then