1 |
commit: 2d1409ebcf3819cbfbeb189ba2da350777477dd4 |
2 |
Author: Ole Markus With <o.with <AT> sportradar <DOT> com> |
3 |
AuthorDate: Mon Feb 28 12:22:20 2011 +0000 |
4 |
Commit: Ole Markus With <olemarkus <AT> olemarkus <DOT> org> |
5 |
CommitDate: Mon Feb 28 12:22:20 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/php.git;a=commit;h=2d1409eb |
7 |
|
8 |
Added prefix support |
9 |
|
10 |
--- |
11 |
eselect-php/php.eselect | 30 +++++++++++++++--------------- |
12 |
1 files changed, 15 insertions(+), 15 deletions(-) |
13 |
|
14 |
diff --git a/eselect-php/php.eselect b/eselect-php/php.eselect |
15 |
index c410954..27808d6 100644 |
16 |
--- a/eselect-php/php.eselect |
17 |
+++ b/eselect-php/php.eselect |
18 |
@@ -21,7 +21,7 @@ get_libdir() { |
19 |
} |
20 |
|
21 |
find_targets() { |
22 |
- for dir in $(get_libdir)/php*.*; do |
23 |
+ for dir in "${EPREFIX}"$(get_libdir)/php*.*; do |
24 |
t=$(basename $dir) |
25 |
has $t $dirs || dirs="${dirs} $t" |
26 |
done |
27 |
@@ -30,42 +30,42 @@ find_targets() { |
28 |
|
29 |
find_targets_apache2() { |
30 |
for target in $(find_targets); do |
31 |
- [[ -f $(get_libdir)/$target/apache2/libphp5.so ]] && echo $target |
32 |
+ [[ -f ${EPREFIX}$(get_libdir)/$target/apache2/libphp5.so ]] && echo $target |
33 |
done |
34 |
} |
35 |
|
36 |
find_targets_cli() { |
37 |
for target in $(find_targets); do |
38 |
- [[ -f $(get_libdir)/$target/bin/php ]] && echo $target |
39 |
+ [[ -f ${EPREFIX}$(get_libdir)/$target/bin/php ]] && echo $target |
40 |
done |
41 |
} |
42 |
|
43 |
find_targets_fpm() { |
44 |
for target in $(find_targets); do |
45 |
- [[ -f $(get_libdir)/$target/bin/php-fpm ]] && echo $target |
46 |
+ [[ -f ${EPREFIX}$(get_libdir)/$target/bin/php-fpm ]] && echo $target |
47 |
done |
48 |
} |
49 |
|
50 |
find_targets_cgi() { |
51 |
for target in $(find_targets); do |
52 |
- [[ -f $(get_libdir)/$target/bin/php-cgi ]] && echo $target |
53 |
+ [[ -f ${EPREFIX}$(get_libdir)/$target/bin/php-cgi ]] && echo $target |
54 |
done |
55 |
} |
56 |
|
57 |
get_active_cli() { |
58 |
- readlink -e /usr/bin/php | sed -ne "s:$(get_libdir)/\(php[0-9]\.[0-9][0-9]*\)/bin/php:\1:p" |
59 |
+ readlink -e "${EPREFIX}"/usr/bin/php | sed -ne "s:$(get_libdir)/\(php[0-9]\.[0-9][0-9]*\)/bin/php:\1:p" |
60 |
} |
61 |
|
62 |
get_active_cgi() { |
63 |
- readlink -e /usr/bin/php-cgi | sed -ne "s:$(get_libdir)/\(php[0-9]\.[0-9]\)/bin/php-cgi:\1:p" |
64 |
+ readlink -e "${EPREFIX}"/usr/bin/php-cgi | sed -ne "s:$(get_libdir)/\(php[0-9]\.[0-9]\)/bin/php-cgi:\1:p" |
65 |
} |
66 |
|
67 |
get_active_fpm() { |
68 |
- readlink -e /usr/bin/php-fpm | sed -ne "s:$(get_libdir)/\(php[0-9]\.[0-9]\)/bin/php-fpm:\1:p" |
69 |
+ readlink -e "${EPREFIX}"/usr/bin/php-fpm | sed -ne "s:$(get_libdir)/\(php[0-9]\.[0-9]\)/bin/php-fpm:\1:p" |
70 |
} |
71 |
|
72 |
get_active_apache2() { |
73 |
- readlink -e $(get_libdir)/apache2/modules/libphp5.so | sed -ne "s:$(get_libdir)/\(php[0-9]\.[0-9]\)/apache2/libphp5.so:\1:p" |
74 |
+ readlink -e "${EPREFIX}"$(get_libdir)/apache2/modules/libphp5.so | sed -ne "s:$(get_libdir)/\(php[0-9]\.[0-9]\)/apache2/libphp5.so:\1:p" |
75 |
} |
76 |
|
77 |
resolv_target() { |
78 |
@@ -130,9 +130,9 @@ list_fpm() { |
79 |
set_apache2() { |
80 |
local t=$(resolv_target apache2 $1) |
81 |
[[ -z $t ]] && die -q "Bad target" |
82 |
- ln -sf $(get_libdir)/$t/apache2/libphp5.so $(get_libdir)/apache2/modules/ || \ |
83 |
+ ln -sf "${EPREFIX}"$(get_libdir)/$t/apache2/libphp5.so $(get_libdir)/apache2/modules/ || \ |
84 |
die -q "Failed to set symlink for libphp5.so" |
85 |
- echo "You have to run \`/etc/init.d/apache2 restart' for the changes to take effect" |
86 |
+ echo "You have to run \`${EPREFIX}/etc/init.d/apache2 restart' for the changes to take effect" |
87 |
} |
88 |
|
89 |
set_cli() { |
90 |
@@ -140,7 +140,7 @@ set_cli() { |
91 |
[[ -z $t ]] && die -q "Bad target" |
92 |
local file |
93 |
for file in php phpize php-config; do |
94 |
- ln -sf $(get_libdir)/$t/bin/$file /usr/bin/$file || \ |
95 |
+ ln -sf "${EPREFIX}"$(get_libdir)/$t/bin/$file /usr/bin/$file || \ |
96 |
die -q "Failed to create symlink for ${file}" |
97 |
done |
98 |
} |
99 |
@@ -149,16 +149,16 @@ set_cgi() { |
100 |
t=$(resolv_target cgi $1) |
101 |
[[ -z $t ]] && die -q "Bad target" |
102 |
local file |
103 |
- ln -sf $(get_libdir)/$t/bin/php-cgi /usr/bin/php-cgi || \ |
104 |
+ ln -sf "${EPREFIX}"$(get_libdir)/$t/bin/php-cgi /usr/bin/php-cgi || \ |
105 |
die -q "Failed to create symlink for php-cgi" |
106 |
} |
107 |
|
108 |
set_fpm() { |
109 |
local t=$(resolv_target fpm $1) |
110 |
[[ -z $t ]] && die -q "Bad target" |
111 |
- ln -sf $(get_libdir)/$t/bin/php-fpm /usr/bin/php-fpm || \ |
112 |
+ ln -sf "${EPREFIX}"$(get_libdir)/$t/bin/php-fpm /usr/bin/php-fpm || \ |
113 |
die -q "Failed to create symlink for the php-fpm binary" |
114 |
- echo "You have to run \`/etc/init.d/php-fpm restart' for the changes to take effect" |
115 |
+ echo "You have to run \`${EPREFIX}/etc/init.d/php-fpm restart' for the changes to take effect" |
116 |
} |
117 |
## set action |