]>
Commit | Line | Data |
---|---|---|
19cb3b46 ER |
1 | # |
2 | # Conditional build: | |
721497a3 | 3 | %bcond_without web # make web package |
19cb3b46 | 4 | |
40f7ac2e ER |
5 | # on builders, build "web" only under php70 |
6 | %if 0%{?_pld_builder:1} && "%{?php_suffix}" != "70" | |
19cb3b46 ER |
7 | %undefine with_web |
8 | %endif | |
9 | ||
f4d04e1d | 10 | %define php_name php%{?php_suffix} |
0c8088ff | 11 | %define modname apcu |
0c8088ff | 12 | Summary: APCu - APC User Cache |
f4d04e1d | 13 | Name: %{php_name}-pecl-%{modname} |
40f7ac2e ER |
14 | Version: 5.1.8 |
15 | Release: 1 | |
0c8088ff ER |
16 | License: PHP 3.01 |
17 | Group: Development/Languages/PHP | |
d5da6b37 | 18 | Source0: https://pecl.php.net/get/%{modname}-%{version}.tgz |
40f7ac2e | 19 | # Source0-md5: 0ef8be2ee8acb4dba5a66b247a254995 |
0c8088ff | 20 | Source1: %{modname}.ini |
6faee651 ER |
21 | Source2: apache.conf |
22 | Source3: config.php | |
3428561a | 23 | Patch0: config.patch |
d5da6b37 | 24 | URL: https://pecl.php.net/package/APCu/ |
40f7ac2e | 25 | BuildRequires: %{php_name}-devel >= 4:7.0.0 |
b01e4cd5 | 26 | BuildRequires: libtool |
f4d04e1d | 27 | BuildRequires: rpmbuild(macros) >= 1.666 |
0c8088ff | 28 | %{?requires_php_extension} |
5d23fa5d | 29 | Provides: php(apcu) = %{version} |
3428561a | 30 | Obsoletes: php-pecl-apcu < 4.0.4-2 |
0c8088ff ER |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
32 | ||
6faee651 ER |
33 | %define _webapps /etc/webapps |
34 | %define _webapp %{modname} | |
35 | %define _sysconfdir %{_webapps}/%{_webapp} | |
36 | %define _appdir %{_datadir}/%{_webapp} | |
37 | ||
0c8088ff ER |
38 | %description |
39 | APCu is userland caching: APC stripped of opcode caching in | |
40 | preparation for the deployment of Zend Optimizer+ as the primary | |
41 | solution to opcode caching in future versions of PHP. | |
42 | ||
43 | APCu only supports userland caching (and dumping) of variables, | |
44 | providing an upgrade path for the future. When O+ takes over, many | |
45 | will be tempted to use 3rd party solutions to userland caching, | |
46 | possibly even distributed solutions; this would be a grave error. The | |
47 | tried and tested APC codebase provides far superior support for local | |
48 | storage of PHP variables. | |
49 | ||
d5da6b37 ER |
50 | %package devel |
51 | Summary: APCu developer files (header) | |
52 | Group: Development/Libraries | |
53 | Requires: %{php_name}-devel | |
54 | # does not require base | |
55 | ||
56 | %description devel | |
57 | These are the files needed to compile programs using Igbinary | |
58 | ||
6faee651 ER |
59 | %package -n apcu-panel |
60 | Summary: APCu control panel | |
61 | Group: Applications/Networking | |
877c50b0 | 62 | Requires: php(apcu) = %{version} |
6faee651 ER |
63 | Requires: php(gd) |
64 | Requires: webapps | |
65 | Requires: webserver(access) | |
66 | Requires: webserver(php) >= 5.0 | |
67 | %if "%{_rpmversion}" >= "5" | |
68 | BuildArch: noarch | |
69 | %endif | |
70 | ||
71 | %description -n apcu-panel | |
72 | This package provides the APCu control panel, with Webserver | |
73 | configuration, available on <http://localhost/apcu-panel/> | |
74 | ||
0c8088ff ER |
75 | %prep |
76 | %setup -qc | |
77 | mv %{modname}-%{version}/* . | |
6faee651 | 78 | %patch0 -p1 |
0c8088ff ER |
79 | cp -p %{SOURCE1} . |
80 | ||
81 | %build | |
b01e4cd5 | 82 | %{__libtoolize} |
0c8088ff ER |
83 | phpize |
84 | %configure \ | |
85 | --%{!?debug:dis}%{?debug:en}able-apcu-debug \ | |
b2a78e74 | 86 | --enable-apcu-spinlocks \ |
0c8088ff ER |
87 | --enable-apcu-mmap |
88 | %{__make} | |
89 | ||
90 | %install | |
91 | rm -rf $RPM_BUILD_ROOT | |
d5da6b37 ER |
92 | %{__make} install \ |
93 | EXTENSION_DIR=%{php_extensiondir} \ | |
94 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
95 | ||
96 | install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d | |
0c8088ff ER |
97 | cp -p %{modname}.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini |
98 | ||
6faee651 | 99 | # Install the Control Panel |
19cb3b46 | 100 | %if %{with web} |
6faee651 ER |
101 | install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}} |
102 | cp -p apc.php $RPM_BUILD_ROOT%{_appdir}/index.php | |
103 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf | |
104 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf | |
105 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/config.php | |
19cb3b46 | 106 | %endif |
6faee651 | 107 | |
0c8088ff ER |
108 | %clean |
109 | rm -rf $RPM_BUILD_ROOT | |
110 | ||
111 | %post | |
112 | %php_webserver_restart | |
113 | ||
114 | %postun | |
115 | if [ "$1" = 0 ]; then | |
116 | %php_webserver_restart | |
117 | fi | |
118 | ||
6faee651 ER |
119 | %triggerin -n apcu-panel -- apache1 < 1.3.37-3, apache1-base |
120 | %webapp_register apache %{_webapp} | |
121 | ||
122 | %triggerun -n apcu-panel -- apache1 < 1.3.37-3, apache1-base | |
123 | %webapp_unregister apache %{_webapp} | |
124 | ||
125 | %triggerin -n apcu-panel -- apache < 2.2.0, apache-base | |
126 | %webapp_register httpd %{_webapp} | |
127 | ||
128 | %triggerun -n apcu-panel -- apache < 2.2.0, apache-base | |
129 | %webapp_unregister httpd %{_webapp} | |
130 | ||
0c8088ff ER |
131 | %files |
132 | %defattr(644,root,root,755) | |
133 | %doc README.md NOTICE TECHNOTES.txt TODO INSTALL LICENSE | |
134 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini | |
135 | %attr(755,root,root) %{php_extensiondir}/%{modname}.so | |
6faee651 | 136 | |
d5da6b37 ER |
137 | %files devel |
138 | %defattr(644,root,root,755) | |
139 | %{_includedir}/php/ext/%{modname} | |
140 | ||
19cb3b46 | 141 | %if %{with web} |
6faee651 ER |
142 | %files -n apcu-panel |
143 | %defattr(644,root,root,755) | |
144 | %dir %attr(750,root,http) %{_sysconfdir} | |
145 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
146 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
147 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php | |
148 | %{_appdir} | |
19cb3b46 | 149 | %endif |