]>
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 | |
07f78484 AM |
7 | Summary: Zend Guard - PHP code guard |
8 | Summary(pl.UTF-8): Zend Guard - optymalizator kodu PHP | |
9 | Name: ZendGuardLoader | |
10 | Version: 5.5.0 | |
11 | Release: 0.1 | |
6e34f38c | 12 | License: Zend License, distributable only if unmodified and for free (see LICENSE) |
ef055b0a | 13 | Group: Libraries |
07f78484 AM |
14 | Source0: http://downloads.zend.com/guard/5.5.0/%{name}-php-5.3-linux-glibc23-i386.tar.gz |
15 | # Source0-md5: f53e51ecb59e390be5551ff7cc8576b0 | |
16 | Source1: http://downloads.zend.com/guard/5.5.0/%{name}-php-5.3-linux-glibc23-x86_64.tar.gz | |
17 | # Source1-md5: 9408297e9e38d5ce2cca92c619b5ad50 | |
18 | URL: http://www.zend.com/products/zend_guard | |
7506c84b | 19 | BuildRequires: rpmbuild(macros) >= 1.344 |
675c3d75 | 20 | BuildRequires: tar >= 1:1.15.1 |
675c3d75 | 21 | Requires(triggerpostun): sed >= 4.0 |
fe31c67f | 22 | ExclusiveArch: %{ix86} %{x8664} |
ef055b0a | 23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
24 | ||
25 | %description | |
07f78484 | 26 | Zend Guard - PHP code guard. |
ef055b0a | 27 | |
7461c8a2 | 28 | %description -l pl.UTF-8 |
07f78484 | 29 | Zend Guard - optymalizator kodu PHP. |
eadf622e | 30 | |
675c3d75 | 31 | %package -n php-%{name} |
07f78484 AM |
32 | Summary: Zend Guard for PHP 5.x |
33 | Summary(pl.UTF-8): Zend Guard dla PHP 5.x | |
675c3d75 ER |
34 | Group: Libraries |
35 | Requires: %{name} = %{version}-%{release} | |
07f78484 | 36 | Requires: php-common >= 4:5.3 |
675c3d75 ER |
37 | |
38 | %description -n php-%{name} | |
07f78484 | 39 | Zend Guard for PHP 5.x. |
eadf622e | 40 | |
7461c8a2 | 41 | %description -n php-%{name} -l pl.UTF-8 |
07f78484 | 42 | Zend Guard dla PHP 5.x. |
675c3d75 | 43 | |
ef055b0a | 44 | %prep |
6e34f38c | 45 | %setup -q -c |
46 | ||
47 | %ifarch %{ix86} | |
675c3d75 | 48 | %{__tar} --strip-components=1 -zxf %{SOURCE0} |
6e34f38c | 49 | %endif |
fe31c67f | 50 | %ifarch %{x8664} |
675c3d75 | 51 | %{__tar} --strip-components=1 -zxf %{SOURCE1} |
6e34f38c | 52 | %endif |
ef055b0a | 53 | |
07f78484 AM |
54 | cat <<'EOF' > zendguard.ini |
55 | ; ZendGuard user settings. | |
b1be7adf | 56 | [Zend] |
07f78484 | 57 | zend_guard.optimization_level=15 |
b1be7adf ER |
58 | EOF |
59 | ||
07f78484 AM |
60 | cat <<'EOF' > pack.ini |
61 | ; ZendGuard package settings. Overwritten with each upgrade. | |
b1be7adf ER |
62 | ; if you need to add options, edit %{name}.ini instead |
63 | [Zend] | |
07f78484 AM |
64 | zend_guard.version=%{version} |
65 | zend_extension_manager.guard=%{_libdir}/Zend/lib/Guard-%{version} | |
66 | zend_extension_manager.guard_ts=%{_libdir}/Zend/lib/Guard_TS-%{version} | |
b1be7adf ER |
67 | zend_extension=%{_libdir}/Zend/lib/ZendExtensionManager.so |
68 | zend_extension_ts=%{_libdir}/Zend/lib/ZendExtensionManager_TS.so | |
69 | EOF | |
70 | ||
ef055b0a | 71 | %install |
72 | rm -rf $RPM_BUILD_ROOT | |
07f78484 AM |
73 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_sysconfdir}/php} |
74 | ||
75 | install -D php-*/ZendGuardLoader.so $RPM_BUILD_ROOT%{_libdir}/Zend/lib/Guard-%{version}/php-$d/ZendGuardLoader.so | |
76 | ||
77 | ln -s %{_sysconfdir}/php $RPM_BUILD_ROOT%{_libdir}/Zend%{_sysconfdir} | |
047fc85c | 78 | ln -s %{_bindir} $RPM_BUILD_ROOT%{_libdir}/Zend/bin |
ef055b0a | 79 | |
07f78484 AM |
80 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/php/conf.d |
81 | install zendguard.ini $RPM_BUILD_ROOT%{_sysconfdir}/php/conf.d/zendguard.ini | |
82 | install pack.ini $RPM_BUILD_ROOT%{_sysconfdir}/php/conf.d/zendguard_pack.ini | |
675c3d75 | 83 | |
69133cfa JB |
84 | %clean |
85 | rm -rf $RPM_BUILD_ROOT | |
86 | ||
675c3d75 | 87 | %preun -n php-%{name} |
5a74951f | 88 | if [ "$1" = "0" ]; then |
7506c84b | 89 | %php_webserver_restart |
ef055b0a | 90 | fi |
91 | ||
675c3d75 | 92 | %post -n php-%{name} |
07f78484 | 93 | # let %{_prefix}/lib/Zend%{_sysconfdir} point to php's config dir. php which installed first wins. |
675c3d75 | 94 | # not sure how critical is existence of this etc link at all. |
07f78484 AM |
95 | if [ ! -L %{_libdir}/Zend%{_sysconfdir} ]; then |
96 | ln -snf %{_sysconfdir}/php %{_libdir}/Zend%{_sysconfdir} | |
675c3d75 | 97 | fi |
7506c84b | 98 | %php_webserver_restart |
5a74951f | 99 | |
675c3d75 ER |
100 | %post |
101 | if [ "$1" = 1 ]; then | |
102 | %banner -e %{name} <<EOF | |
103 | Remember to read %{_docdir}/%{name}-%{version}/LICENSE.gz! | |
104 | EOF | |
ef055b0a | 105 | fi |
675c3d75 | 106 | |
675c3d75 ER |
107 | %triggerpostun -- %{name} < 2.5.10a-0.20 |
108 | if [ -f /etc/php/php.ini ]; then | |
07f78484 AM |
109 | cp -f /etc/php/conf.d/ZendGuard.ini{,.rpmnew} |
110 | sed -ne '/^\(zend_\|\[Zend\]\)/{/^zend_extension\(_manager\.guard\)\?\(_ts\)\?=/d;p}' /etc/php/php.ini > /etc/php/conf.d/ZendGuard.ini | |
675c3d75 ER |
111 | cp -f /etc/php/php.ini{,.rpmsave} |
112 | sed -i -e '/^\(zend_\|\[Zend\]\)/d' /etc/php/php.ini | |
113 | fi | |
ef055b0a | 114 | |
ef055b0a | 115 | %files |
116 | %defattr(644,root,root,755) | |
675c3d75 | 117 | %doc data/doc/* LICENSE |
6e34f38c | 118 | %attr(755,root,root) %{_bindir}/zendid |
6e34f38c | 119 | %dir %{_libdir}/Zend |
675c3d75 | 120 | %dir %{_libdir}/Zend/lib |
07f78484 AM |
121 | %dir %{_libdir}/Zend/lib/Guard-%{version} |
122 | %dir %{_libdir}/Zend/lib/Guard-%{version}/php-* | |
123 | %dir %{_libdir}/Zend/lib/Guard_TS-%{version} | |
124 | %dir %{_libdir}/Zend/lib/Guard_TS-%{version}/php-* | |
125 | %attr(755,root,root) %{_libdir}/Zend/lib/Guard-%{version}/php-*/ZendGuard.so | |
126 | %attr(755,root,root) %{_libdir}/Zend/lib/Guard_TS-%{version}/php-*/ZendGuard.so | |
675c3d75 ER |
127 | %attr(755,root,root) %{_libdir}/Zend/lib/ZendExtensionManager.so |
128 | %attr(755,root,root) %{_libdir}/Zend/lib/ZendExtensionManager_TS.so | |
6e34f38c | 129 | %{_libdir}/Zend/bin |
07f78484 | 130 | %ghost %{_libdir}/Zend%{_sysconfdir} |
675c3d75 ER |
131 | |
132 | %files -n php-%{name} | |
133 | %defattr(644,root,root,755) | |
07f78484 AM |
134 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php/conf.d/zendguard.ini |
135 | %config %verify(not md5 mtime size) %{_sysconfdir}/php/conf.d/zendguard_pack.ini | |
136 | %{_sysconfdir}/php/poweredbyguard.gif |