Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/eselect-php:master commit in: src/
Date: Fri, 11 Dec 2015 00:40:38
Message-Id: 1449755125.f835773f9365d1f5fe46079df7cb7477f200f2ed.mjo@gentoo
1 commit: f835773f9365d1f5fe46079df7cb7477f200f2ed
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 10 13:45:25 2015 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 10 13:45:25 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/eselect-php.git/commit/?id=f835773f
7
8 Use fixed ".so" suffix for libphp instead of computing it.
9
10 The only supported way to run PHP/Apache these days is as a dynamic
11 shared object (DSO). The DSO will have an ".so" suffix, so we don't
12 need to probe to see if libphp*.a exists.
13
14 This also avoids a hidden dependency on libz, for whose static library
15 we were probing.
16
17 src/php.eselect.in | 30 +++++++-----------------------
18 1 file changed, 7 insertions(+), 23 deletions(-)
19
20 diff --git a/src/php.eselect.in b/src/php.eselect.in
21 index 363dc1d..5bbb491 100644
22 --- a/src/php.eselect.in
23 +++ b/src/php.eselect.in
24 @@ -65,22 +65,6 @@ get_active_libdir() {
25 echo /usr/lib
26 }
27
28 -get_libname() {
29 - # probe on a well-known library
30 - local lib ret=.so
31 - for lib in "${EROOT}"$(get_active_libdir)/libz.* ; do
32 - case "${lib##*/}" in
33 - libz.a) ret=.a ;; # some platforms use .a as ext
34 - libz.*.*) continue ;;
35 - libz.*)
36 - ret=${lib##*libz}
37 - break
38 - ;;
39 - esac
40 - done
41 - echo ${ret}
42 -}
43 -
44 cleanup() {
45 local target=$(find_targets_$1 | tail -n 1)
46 [[ -z $target ]] &&
47 @@ -102,7 +86,7 @@ find_targets_apache2() {
48 local libs target libdir
49 for target in $(find_targets); do
50 for libdir in $(get_libdirs); do
51 - libs="${EROOT}${libdir}/$target/apache2/libphp[57]$(get_libname)"
52 + libs="${EROOT}${libdir}/$target/apache2/libphp[57].so"
53 for lib in $libs; do
54 [[ -f "${lib}" ]] && echo $target
55 done
56 @@ -161,12 +145,12 @@ get_active_fpm() {
57
58 get_active_apache2() {
59 local libs target ver
60 - libs="${EROOT}$(get_active_libdir)/apache2/modules/libphp[57]$(get_libname)"
61 + libs="${EROOT}$(get_active_libdir)/apache2/modules/libphp[57].so"
62
63 # This sed expression finds the "display name" of the PHP version
64 # corresponding to a copy of libphp. For example, it parses the
65 # string "php5.6" out of "/usr/lib64/php5.6/apache2/libphp5.so".
66 - ver="s:.*/usr/.*/\(php[0-9]\.[0-9]\)/apache2/libphp[57]$(get_libname):\1:p"
67 + ver="s:.*/usr/.*/\(php[0-9]\.[0-9]\)/apache2/libphp[57].so:\1:p"
68 for lib in $libs; do
69 if [[ -L "${lib}" ]] ; then
70 target=$(canonicalise "${lib}")
71 @@ -254,10 +238,10 @@ set_apache2() {
72 local libdir t=$(resolv_target apache2 $1)
73 [[ -z $t ]] && die -q "Bad target"
74 for libdir in $(get_libdirs); do
75 - rm -f "${EROOT}${libdir}"/apache2/modules/libphp{5,7}$(get_libname)
76 - @LN_S@ --force ../../$t/apache2/libphp${t:3:1}$(get_libname) \
77 - "${EROOT}"${libdir}/apache2/modules/ || \
78 - die -q "Failed to set symlink for ${EPREFIX}${libdir}/apache2/modules/libphp${t:3:1}$(get_libname)"
79 + rm -f "${EROOT}${libdir}/apache2/modules/libphp[57].so"
80 + @LN_S@ --force "../../$t/apache2/libphp${t:3:1}.so" \
81 + "${EROOT}${libdir}/apache2/modules/" || \
82 + die -q "Failed to set symlink for ${EPREFIX}${libdir}/apache2/modules/libphp${t:3:1}.so"
83 done
84 echo "You have to run \`${EPREFIX}/etc/init.d/apache2 restart' for the changes to take effect"
85 }