]>
Commit | Line | Data |
---|---|---|
1 | # DO NOT MODIFY CONTENTS OF PACKAGE - AGAINST LICENSE AND MAKES IT UNDISTRIBUTABLE | |
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 | |
7 | Summary: Zend Guard - PHP code guard | |
8 | Summary(pl.UTF-8): Zend Guard - optymalizator kodu PHP | |
9 | Name: ZendGuardLoader | |
10 | Version: 6.0.0 | |
11 | Release: 1 | |
12 | License: Zend License, distributable only if unmodified and for free (see LICENSE) | |
13 | Group: Libraries | |
14 | # http://mewbies.com/zend_ioncube/zend_guard_direct_download_links.txt | |
15 | Source0: http://downloads.zend.com/guard/6.0.0/%{name}-70429-PHP-5.4-linux-glibc23-i386.tar.gz | |
16 | # Source0-md5: 9a25ff3c2fa4cb37602ba6d6491e859e | |
17 | Source1: http://downloads.zend.com/guard/6.0.0/%{name}-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz | |
18 | # Source1-md5: 09d0da0046eb70c3d704db1e0074098e | |
19 | URL: http://www.zend.com/products/zend_guard | |
20 | BuildRequires: rpmbuild(macros) >= 1.344 | |
21 | BuildRequires: tar >= 1:1.15.1 | |
22 | BuildRequires: php%{?php_suffix}-devel >= 4:5.4 | |
23 | Requires(triggerpostun): sed >= 4.0 | |
24 | ExclusiveArch: %{ix86} %{x8664} | |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
27 | %description | |
28 | Zend Guard - PHP code guard. | |
29 | ||
30 | %description -l pl.UTF-8 | |
31 | Zend Guard - optymalizator kodu PHP. | |
32 | ||
33 | %package -n php%{?php_suffix}-%{name} | |
34 | Summary: Zend Guard for PHP 5.x | |
35 | Summary(pl.UTF-8): Zend Guard dla PHP 5.x | |
36 | Group: Libraries | |
37 | Requires: %{name} = %{version}-%{release} | |
38 | Requires: php%{?php_suffix}-common >= 4:5.4 | |
39 | Requires: php%{?php_suffix}-common < 4:5.5 | |
40 | ||
41 | %description -n php%{?php_suffix}-%{name} | |
42 | Zend Guard for PHP 5.x. | |
43 | ||
44 | %description -n php%{?php_suffix}-%{name} -l pl.UTF-8 | |
45 | Zend Guard dla PHP 5.x. | |
46 | ||
47 | %prep | |
48 | %setup -q -c | |
49 | ||
50 | %ifarch %{ix86} | |
51 | %{__tar} --strip-components=1 -zxf %{SOURCE0} | |
52 | %endif | |
53 | %ifarch %{x8664} | |
54 | %{__tar} --strip-components=1 -zxf %{SOURCE1} | |
55 | %endif | |
56 | ||
57 | cat <<'EOF' > zendguardloader.ini | |
58 | ; ZendGuardLoader user settings. | |
59 | [Zend] | |
60 | zend_loader.enable=1 | |
61 | ;zend_loader.disable_licensing=0 | |
62 | ;zend_loader.obfuscation_level_support=3 | |
63 | ;zend_loader.license_path= | |
64 | EOF | |
65 | ||
66 | cat <<'EOF' > zendguardloaderpack.ini | |
67 | ; ZendGuardLoader package settings. Overwritten with each upgrade. | |
68 | ; if you need to add options, edit %{name}.ini instead | |
69 | [Zend] | |
70 | zend_guard.version=%{version} | |
71 | zend_extension=%{_libdir}/Zend/lib/GuardLoader-%{version}/php-5.4.x/ZendGuardLoader.so | |
72 | EOF | |
73 | ||
74 | %install | |
75 | rm -rf $RPM_BUILD_ROOT | |
76 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_sysconfdir}/php%{?php_suffix}} | |
77 | ||
78 | for d in php-*; do | |
79 | install -D $d/ZendGuardLoader.so $RPM_BUILD_ROOT%{_libdir}/Zend/lib/GuardLoader-%{version}/$d/ZendGuardLoader.so | |
80 | done | |
81 | ||
82 | ln -s %{_sysconfdir}/php%{?php_suffix} $RPM_BUILD_ROOT%{_libdir}/Zend%{_sysconfdir} | |
83 | ||
84 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/php%{?php_suffix}/conf.d | |
85 | install zendguardloader.ini $RPM_BUILD_ROOT%{_sysconfdir}/php%{?php_suffix}/conf.d/zendguardloader.ini | |
86 | install zendguardloaderpack.ini $RPM_BUILD_ROOT%{_sysconfdir}/php%{?php_suffix}/conf.d/zendguardloader_pack.ini | |
87 | ||
88 | %clean | |
89 | rm -rf $RPM_BUILD_ROOT | |
90 | ||
91 | %preun -n php%{?php_suffix}-%{name} | |
92 | if [ "$1" = "0" ]; then | |
93 | %php_webserver_restart | |
94 | fi | |
95 | ||
96 | %post -n php%{?php_suffix}-%{name} | |
97 | # let %{_prefix}/lib/Zend%{_sysconfdir} point to php's config dir. php which installed first wins. | |
98 | # not sure how critical is existence of this etc link at all. | |
99 | if [ ! -L %{_libdir}/Zend%{_sysconfdir} ]; then | |
100 | ln -snf %{_sysconfdir}/php%{?php_suffix} %{_libdir}/Zend%{_sysconfdir} | |
101 | fi | |
102 | %php_webserver_restart | |
103 | ||
104 | #%%post | |
105 | #if [ "$1" = 1 ]; then | |
106 | #%%banner -e %{name} <<EOF | |
107 | #Remember to read %{_docdir}/%{name}-%{version}/LICENSE.gz! | |
108 | #EOF | |
109 | #fi | |
110 | ||
111 | %files | |
112 | %defattr(644,root,root,755) | |
113 | %doc README.txt | |
114 | %dir %{_libdir}/Zend | |
115 | %dir %{_libdir}/Zend/lib | |
116 | %dir %{_libdir}/Zend/lib/GuardLoader-%{version} | |
117 | %dir %{_libdir}/Zend/lib/GuardLoader-%{version}/php-* | |
118 | %attr(755,root,root) %{_libdir}/Zend/lib/GuardLoader-%{version}/php-*/ZendGuardLoader.so | |
119 | %ghost %{_libdir}/Zend%{_sysconfdir} | |
120 | ||
121 | %files -n php%{?php_suffix}-%{name} | |
122 | %defattr(644,root,root,755) | |
123 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php%{?php_suffix}/conf.d/zendguardloader.ini | |
124 | %config %verify(not md5 mtime size) %{_sysconfdir}/php%{?php_suffix}/conf.d/zendguardloader_pack.ini |