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