1 # DO NOT MODIFY CONTENTS OF PACKAGE - AGAINST LICENSE AND MAKES IT UNDISTRIBUTABLE
2 # AND ALSO IT IS ALREADY STRIPPED.
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
12 License: Zend License, distributable only if unmodified and for free (see LICENSE)
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)
28 Zend Guard - PHP code guard.
30 %description -l pl.UTF-8
31 Zend Guard - optymalizator kodu PHP.
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
37 Requires: %{name} = %{version}-%{release}
38 Requires: php%{?php_suffix}-common >= 4:5.4
39 Requires: php%{?php_suffix}-common < 4:5.5
41 %description -n php%{?php_suffix}-%{name}
42 Zend Guard for PHP 5.x.
44 %description -n php%{?php_suffix}-%{name} -l pl.UTF-8
45 Zend Guard dla PHP 5.x.
51 %{__tar} --strip-components=1 -zxf %{SOURCE0}
54 %{__tar} --strip-components=1 -zxf %{SOURCE1}
57 cat <<'EOF' > zendguardloader.ini
58 ; ZendGuardLoader user settings.
61 ;zend_loader.disable_licensing=0
62 ;zend_loader.obfuscation_level_support=3
63 ;zend_loader.license_path=
66 cat <<'EOF' > zendguardloaderpack.ini
67 ; ZendGuardLoader package settings. Overwritten with each upgrade.
68 ; if you need to add options, edit %{name}.ini instead
70 zend_guard.version=%{version}
71 zend_extension=%{_libdir}/Zend/lib/GuardLoader-%{version}/php-5.4.x/ZendGuardLoader.so
75 rm -rf $RPM_BUILD_ROOT
76 install -d $RPM_BUILD_ROOT{%{_bindir},%{_sysconfdir}/php%{?php_suffix}}
79 install -D $d/ZendGuardLoader.so $RPM_BUILD_ROOT%{_libdir}/Zend/lib/GuardLoader-%{version}/$d/ZendGuardLoader.so
82 ln -s %{_sysconfdir}/php%{?php_suffix} $RPM_BUILD_ROOT%{_libdir}/Zend%{_sysconfdir}
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
89 rm -rf $RPM_BUILD_ROOT
91 %preun -n php%{?php_suffix}-%{name}
92 if [ "$1" = "0" ]; then
93 %php_webserver_restart
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}
102 %php_webserver_restart
105 #if [ "$1" = 1 ]; then
106 #%%banner -e %{name} <<EOF
107 #Remember to read %{_docdir}/%{name}-%{version}/LICENSE.gz!
112 %defattr(644,root,root,755)
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}
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