commit:     f4a2678217a23ce0db353173f74a556039b5b08d
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 22 02:12:37 2016 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Fri Jan 22 02:12:37 2016 +0000
URL:        https://gitweb.gentoo.org/proj/eselect-php.git/commit/?id=f4a26782

Use uppercase @BINDIR@, @LIBDIR@, etc. for autotools substitution.

The last few commits introduced a problem: by passing
php.eselect.in.in through autoconf, we unwittingly replace things like
@bindir@ with ${exec_prefix}. This is because lowercase @bindir@
gets defined for automake and is intended to be based on the other
directory variables like @exec_prefix@. Since we're replacing them
after the fact in the Makefile, this commit avoids the autoconf
mangling by making them all uppercase.

 Makefile.am            |  6 +++---
 src/70_mod_php.conf.in |  2 +-
 src/php.eselect.in.in  | 18 +++++++++---------
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9487f1b..1d1132e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,9 +8,9 @@ nodist_apacheconf_DATA = $(srcdir)/src/70_mod_php.conf
 # localstatedir within our script and conf file. The example is taken
 # from the autoconf documentation and can be found in the
 # "Installation Directory Variables" section.
-edit = sed -e 's|@bindir[@]|$(bindir)|g' \
-           -e 's|@libdir[@]|$(libdir)|g' \
-           -e 's|@localstatedir[@]|$(localstatedir)|g'
+edit = sed -e 's|@BINDIR[@]|$(bindir)|g' \
+           -e 's|@LIBDIR[@]|$(libdir)|g' \
+           -e 's|@LOCALSTATEDIR[@]|$(localstatedir)|g'
 
 $(nodist_eselect_DATA) $(nodist_apacheconf_DATA): Makefile
        rm -f $@ $@.tmp

diff --git a/src/70_mod_php.conf.in b/src/70_mod_php.conf.in
index 4b97354..a9d348d 100644
--- a/src/70_mod_php.conf.in
+++ b/src/70_mod_php.conf.in
@@ -4,7 +4,7 @@
        # php5_module to php7_module so we can't blindly load whatever
        # is there. Instead we let eselect-php manage a small
        # configuration file that loads the appropriate module.
-       Include "@localstatedir@/lib/eselect-php/mod_php.conf"
+       Include "@LOCALSTATEDIR@/lib/eselect-php/mod_php.conf"
 
        # Tell apache that mod_php should handle PHP files.
        #

diff --git a/src/php.eselect.in.in b/src/php.eselect.in.in
index e1edb42..d3428bd 100644
--- a/src/php.eselect.in.in
+++ b/src/php.eselect.in.in
@@ -88,7 +88,7 @@ sapi_active_link_target_dir() {
        local sapi="${1}"
        local target="${2}"
 
-       local link_target_dir="@libdir@/${target}/bin"
+       local link_target_dir="@LIBDIR@/${target}/bin"
        if [[ "${sapi}" == "apache2" ]] ; then
                link_target_dir+="/../apache2"
        fi
@@ -116,11 +116,11 @@ sapi_active_link_dir() {
        local sapi="${1}"
 
        case "${sapi}" in
-               apache2) echo "@libdir@/apache2/modules" ;;
-               cli)     echo "@bindir@" ;;
-               fpm)     echo "@bindir@" ;;
-               cgi)     echo "@bindir@" ;;
-               phpdbg)  echo "@bindir@" ;;
+               apache2) echo "@LIBDIR@/apache2/modules" ;;
+               cli)     echo "@BINDIR@" ;;
+               fpm)     echo "@BINDIR@" ;;
+               cgi)     echo "@BINDIR@" ;;
+               phpdbg)  echo "@BINDIR@" ;;
                *)       die "invalid SAPI name: ${sapi}" ;;
        esac
 }
@@ -198,7 +198,7 @@ cleanup_sapi() {
        fi
 
        if [[ "${sapi}" == "apache2" ]] ; then
-               rm -f "@libdir@"/apache2/modules/libphp[57].so \
+               rm -f "@LIBDIR@"/apache2/modules/libphp[57].so \
                   || die "failed to remove old libphp.so symlink"
        fi
 
@@ -258,7 +258,7 @@ find_sapi_targets() {
        esac
 
        for target in $(find_targets); do
-               local pattern="@libdir@/${target}/${pattern_suffix}"
+               local pattern="@LIBDIR@/${target}/${pattern_suffix}"
 
                for file in $pattern; do
                        [[ -f "${file}" ]] && echo "${target}"
@@ -313,7 +313,7 @@ get_sapi_active_target() {
 #
 write_mod_php_conf() {
        local target="${1}"
-       local conf_dir="@localstatedir@/lib/eselect-php"
+       local conf_dir="@LOCALSTATEDIR@/lib/eselect-php"
        local conf_path="${conf_dir}/mod_php.conf"
 
        @MKDIR_P@ "${conf_dir}" || die "failed to create ${conf_dir}"

Reply via email to