]>
Commit | Line | Data |
---|---|---|
5a74951f | 1 | # DO NOT MODIFY CONTENTS OF PACKAGE - AGAINST LICENSE AND MAKES IT UNDISTRIBUTABLE |
6e34f38c | 2 | # AND ALSO IT IS ALREADY STRIPPED. |
3 | ||
4 | %define no_install_post_strip 1 | |
5 | %define no_install_post_compress_docs 1 | |
6 | %define no_install_post_chrpath 1 | |
5d40dd5f | 7 | Summary: Zend Optimizer - PHP code optimizer |
8 | Summary(pl): Zend Optimizer - optymalizator kodu PHP | |
ef055b0a | 9 | Name: ZendOptimizer |
c1409c36 | 10 | Version: 2.5.10a |
8054e742 | 11 | Release: 0.30 |
6e34f38c | 12 | License: Zend License, distributable only if unmodified and for free (see LICENSE) |
ef055b0a | 13 | Group: Libraries |
c1409c36 | 14 | Source0: http://downloads.zend.com/optimizer/2.5.10/%{name}-%{version}-linux-glibc21-i386.tar.gz |
15 | # Source0-md5: 3064cb6d33f0d4800cf84b8a5521cd48 | |
16 | Source1: http://downloads.zend.com/optimizer/2.5.10/%{name}-%{version}-linux-glibc23-x86_64.tar.gz | |
17 | # Source1-md5: 6d7e50b1875fb77eff7d0cc6ff45db32 | |
ef055b0a | 18 | URL: http://www.zend.com/zend/optimizer.php |
fe31c67f | 19 | BuildRequires: rpmbuild(macros) >= 1.213 |
675c3d75 ER |
20 | BuildRequires: tar >= 1:1.15.1 |
21 | # circular dependency, so ones upgraded are forced to choose php and | |
22 | # ones that want to install specific for specific version need not to | |
23 | # install ZendOptimizer separately | |
24 | Requires: %{name}(php) = %{version}-%{release} | |
25 | Requires(triggerpostun): sed >= 4.0 | |
fe31c67f | 26 | ExclusiveArch: %{ix86} %{x8664} |
ef055b0a | 27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
28 | ||
29 | %description | |
e4ce32ec | 30 | Zend Optimizer - PHP code optimizer. |
ef055b0a | 31 | |
32 | %description -l pl | |
e4ce32ec | 33 | Zend Optimizer - optymalizator kodu PHP. |
ef055b0a | 34 | |
675c3d75 ER |
35 | %package -n php4-%{name} |
36 | Summary: Zend Optimizer for PHP 4.x. | |
37 | Group: Libraries | |
38 | Requires: %{name} = %{version}-%{release} | |
39 | Requires: php4-common >= 3:4.0.6 | |
40 | Provides: %{name}(php) = %{version}-%{release} | |
41 | ||
42 | %description -n php4-%{name} | |
43 | Zend Optimizer for PHP 4.x. | |
44 | ||
45 | %package -n php-%{name} | |
46 | Summary: Zend Optimizer for PHP 5.x. | |
47 | Group: Libraries | |
48 | Requires: %{name} = %{version}-%{release} | |
49 | Requires: php-common >= 4:5.0.0 | |
50 | Provides: %{name}(php) = %{version}-%{release} | |
51 | ||
52 | %description -n php-%{name} | |
53 | Zend Optimizer for PHP 5.x. | |
54 | ||
ef055b0a | 55 | %prep |
6e34f38c | 56 | %setup -q -c |
57 | ||
58 | %ifarch %{ix86} | |
675c3d75 | 59 | %{__tar} --strip-components=1 -zxf %{SOURCE0} |
6e34f38c | 60 | %endif |
fe31c67f | 61 | %ifarch %{x8664} |
675c3d75 | 62 | %{__tar} --strip-components=1 -zxf %{SOURCE1} |
6e34f38c | 63 | %endif |
ef055b0a | 64 | |
65 | %install | |
66 | rm -rf $RPM_BUILD_ROOT | |
675c3d75 | 67 | install -d $RPM_BUILD_ROOT{%{_bindir},/etc/php4,/etc/php} |
6e34f38c | 68 | |
69 | cd data | |
675c3d75 ER |
70 | for a in *_comp; do |
71 | d=$(basename $a _comp | tr _ .) | |
72 | install -D $a/ZendOptimizer.so $RPM_BUILD_ROOT%{_libdir}/Zend/lib/Optimizer-%{version}/php-$d/ZendOptimizer.so | |
73 | done | |
74 | for a in *_comp/TS; do | |
75 | d=$(basename $(dirname $a) _comp | tr _ .) | |
76 | install -D $a/ZendOptimizer.so $RPM_BUILD_ROOT%{_libdir}/Zend/lib/Optimizer_TS-%{version}/php-$d/ZendOptimizer.so | |
77 | done | |
78 | ||
6e34f38c | 79 | install zendid $RPM_BUILD_ROOT%{_bindir} |
80 | install poweredbyoptimizer.gif $RPM_BUILD_ROOT%{_sysconfdir}/php | |
675c3d75 | 81 | install poweredbyoptimizer.gif $RPM_BUILD_ROOT%{_sysconfdir}/php4 |
6e34f38c | 82 | install *.so $RPM_BUILD_ROOT%{_libdir}/Zend/lib |
675c3d75 | 83 | ln -s %{_sysconfdir}/php $RPM_BUILD_ROOT%{_libdir}/Zend/etc |
047fc85c | 84 | ln -s %{_bindir} $RPM_BUILD_ROOT%{_libdir}/Zend/bin |
ef055b0a | 85 | |
675c3d75 ER |
86 | cat <<'EOF' > zendoptimizer.ini |
87 | ; ZendOptimizer user settings. | |
88 | [Zend] | |
89 | zend_optimizer.optimization_level=15 | |
90 | EOF | |
91 | ||
92 | cat <<'EOF' > pack.ini | |
8054e742 | 93 | ; ZendOptimizer package settings. Overwritten with each upgrade. |
675c3d75 ER |
94 | ; if you need to add options, edit %{name}.ini instead |
95 | [Zend] | |
96 | zend_optimizer.version=%{version} | |
97 | zend_extension_manager.optimizer=%{_libdir}/Zend/lib/Optimizer-%{version} | |
98 | zend_extension_manager.optimizer_ts=%{_libdir}/Zend/lib/Optimizer_TS-%{version} | |
99 | zend_extension=%{_libdir}/Zend/lib/ZendExtensionManager.so | |
100 | zend_extension_ts=%{_libdir}/Zend/lib/ZendExtensionManager_TS.so | |
101 | EOF | |
102 | ||
103 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/php{,4}/conf.d | |
104 | install zendoptimizer.ini $RPM_BUILD_ROOT/etc/php4/conf.d/%{name}.ini | |
105 | install zendoptimizer.ini $RPM_BUILD_ROOT/etc/php/conf.d/%{name}.ini | |
106 | install pack.ini $RPM_BUILD_ROOT/etc/php4/conf.d/%{name}_pack.ini | |
107 | install pack.ini $RPM_BUILD_ROOT/etc/php/conf.d/%{name}_pack.ini | |
108 | ||
69133cfa JB |
109 | %clean |
110 | rm -rf $RPM_BUILD_ROOT | |
111 | ||
675c3d75 ER |
112 | %preun -n php4-%{name} |
113 | if [ "$1" = "0" ]; then | |
114 | [ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service -q apache restart | |
115 | [ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service -q httpd restart | |
116 | fi | |
117 | ||
118 | %post -n php4-%{name} | |
119 | # let /usr/lib/Zend/etc point to php's config dir. php which installed first wins. | |
120 | # not sure how critical is existence of this etc link at all. | |
121 | if [ ! -L %{_libdir}/Zend/etc ]; then | |
122 | ln -snf /etc/php4 %{_libdir}/Zend/etc | |
123 | fi | |
124 | [ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service -q apache restart | |
125 | [ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service -q httpd restart | |
126 | ||
6e34f38c | 127 | |
675c3d75 | 128 | %preun -n php-%{name} |
5a74951f | 129 | if [ "$1" = "0" ]; then |
675c3d75 ER |
130 | [ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart |
131 | [ ! -f /etc/httpd/httpd.conf/??_mod_php.conf ] || %service -q httpd restart | |
ef055b0a | 132 | fi |
133 | ||
675c3d75 ER |
134 | %post -n php-%{name} |
135 | # let /usr/lib/Zend/etc point to php's config dir. php which installed first wins. | |
136 | # not sure how critical is existence of this etc link at all. | |
137 | if [ ! -L %{_libdir}/Zend/etc ]; then | |
138 | ln -snf /etc/php %{_libdir}/Zend/etc | |
139 | fi | |
140 | [ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart | |
141 | [ ! -f /etc/httpd/httpd.conf/??_mod_php.conf ] || %service -q httpd restart | |
5a74951f | 142 | |
675c3d75 ER |
143 | %post |
144 | if [ "$1" = 1 ]; then | |
145 | %banner -e %{name} <<EOF | |
146 | Remember to read %{_docdir}/%{name}-%{version}/LICENSE.gz! | |
147 | EOF | |
ef055b0a | 148 | fi |
675c3d75 ER |
149 | |
150 | %triggerpostun -n php4-%{name} -- %{name} < 2.5.10a-0.20 | |
151 | if [ -f /etc/php4/php.ini ]; then | |
152 | cp -f /etc/php4/conf.d/ZendOptimizer.ini{,.rpmnew} | |
153 | sed -ne '/^\(zend_\|\[Zend\]\)/{/^zend_extension\(_manager\.optimizer\)\?\(_ts\)\?=/d;p}' /etc/php4/php.ini > /etc/php4/conf.d/ZendOptimizer.ini | |
154 | cp -f /etc/php4/php.ini{,.rpmsave} | |
155 | sed -i -e '/^\(zend_\|\[Zend\]\)/d' /etc/php4/php.ini | |
ef055b0a | 156 | fi |
6e34f38c | 157 | |
675c3d75 ER |
158 | %triggerpostun -- %{name} < 2.5.10a-0.20 |
159 | if [ -f /etc/php/php.ini ]; then | |
160 | cp -f /etc/php/conf.d/ZendOptimizer.ini{,.rpmnew} | |
161 | sed -ne '/^\(zend_\|\[Zend\]\)/{/^zend_extension\(_manager\.optimizer\)\?\(_ts\)\?=/d;p}' /etc/php/php.ini > /etc/php/conf.d/ZendOptimizer.ini | |
162 | cp -f /etc/php/php.ini{,.rpmsave} | |
163 | sed -i -e '/^\(zend_\|\[Zend\]\)/d' /etc/php/php.ini | |
164 | fi | |
ef055b0a | 165 | |
ef055b0a | 166 | %files |
167 | %defattr(644,root,root,755) | |
675c3d75 | 168 | %doc data/doc/* LICENSE |
6e34f38c | 169 | %attr(755,root,root) %{_bindir}/zendid |
6e34f38c | 170 | %dir %{_libdir}/Zend |
675c3d75 | 171 | %dir %{_libdir}/Zend/lib |
5a74951f | 172 | %dir %{_libdir}/Zend/lib/Optimizer-%{version} |
675c3d75 | 173 | %dir %{_libdir}/Zend/lib/Optimizer-%{version}/php-* |
5a74951f | 174 | %dir %{_libdir}/Zend/lib/Optimizer_TS-%{version} |
675c3d75 ER |
175 | %dir %{_libdir}/Zend/lib/Optimizer_TS-%{version}/php-* |
176 | %attr(755,root,root) %{_libdir}/Zend/lib/Optimizer-%{version}/php-*/ZendOptimizer.so | |
177 | %attr(755,root,root) %{_libdir}/Zend/lib/Optimizer_TS-%{version}/php-*/ZendOptimizer.so | |
178 | %attr(755,root,root) %{_libdir}/Zend/lib/ZendExtensionManager.so | |
179 | %attr(755,root,root) %{_libdir}/Zend/lib/ZendExtensionManager_TS.so | |
6e34f38c | 180 | %{_libdir}/Zend/bin |
675c3d75 ER |
181 | %ghost %{_libdir}/Zend/etc |
182 | ||
183 | %files -n php4-%{name} | |
184 | %defattr(644,root,root,755) | |
185 | %config(noreplace) %verify(not md5 mtime size) /etc/php4/conf.d/%{name}.ini | |
186 | %config %verify(not md5 mtime size) /etc/php4/conf.d/%{name}_pack.ini | |
187 | /etc/php4/poweredbyoptimizer.gif | |
188 | ||
189 | %files -n php-%{name} | |
190 | %defattr(644,root,root,755) | |
191 | %config(noreplace) %verify(not md5 mtime size) /etc/php/conf.d/%{name}.ini | |
192 | %config %verify(not md5 mtime size) /etc/php/conf.d/%{name}_pack.ini | |
193 | /etc/php/poweredbyoptimizer.gif |