1 |
spuhler |
17155 |
%define _disable_ld_no_undefined 1 |
2 |
|
|
|
3 |
|
|
%define realname apc (Alternative PHP Cache) |
4 |
|
|
%define modname apc |
5 |
|
|
%define dirname %{modname} |
6 |
|
|
%define soname %{modname}.so |
7 |
|
|
%define inifile 99_%{modname}.ini |
8 |
|
|
|
9 |
|
|
%define _requires_exceptions pear( |
10 |
|
|
|
11 |
|
|
Summary: The %{realname} module for PHP |
12 |
|
|
Name: php-%{modname} |
13 |
colin |
129786 |
Version: 3.1.9 |
14 |
tv |
84938 |
Release: %mkrel 1 |
15 |
spuhler |
17155 |
Group: Development/PHP |
16 |
|
|
License: PHP License |
17 |
|
|
URL: http://pecl.php.net/package/APC |
18 |
|
|
Source0: http://pecl.php.net/get/APC-%{version}.tgz |
19 |
|
|
Source1: apc.ini |
20 |
|
|
Patch0: APC-3.1.3p1-default_lock_dir.diff |
21 |
colin |
129786 |
Patch1: php-apc-3.1.9-fix-fcntl-pecl-bug-22688.patch |
22 |
spuhler |
17155 |
BuildRequires: php-devel >= 3:5.2.0 |
23 |
|
|
Conflicts: php-afterburner php-mmcache php-eaccelerator |
24 |
|
|
Epoch: 1 |
25 |
|
|
|
26 |
|
|
%description |
27 |
|
|
APC was conceived of to provide a way of boosting the performance of PHP on |
28 |
|
|
heavily loaded sites by providing a way for scripts to be cached in a compiled |
29 |
|
|
state, so that the overhead of parsing and compiling can be almost completely |
30 |
|
|
eliminated. There are commercial products which provide this functionality, but |
31 |
|
|
they are neither open-source nor free. Our goal was to level the playing field |
32 |
|
|
by providing an implementation that allows greater flexibility and is |
33 |
|
|
universally accessible. |
34 |
|
|
|
35 |
|
|
NOTE!: %{name} has to be loaded last, very important! |
36 |
|
|
|
37 |
|
|
This package comes with four different flavours of APC (use only one of them): |
38 |
|
|
|
39 |
|
|
o apc-mmap.so - mmap (fcntl) based locks (default) |
40 |
|
|
o apc-sem.so - IPC semamphore based locks |
41 |
|
|
o apc-spinlocks.so - Hardware-dependent implementation of spinlocks |
42 |
|
|
o apc-pthread.so - NPTL pthread mutex based locks |
43 |
|
|
|
44 |
|
|
%package admin |
45 |
|
|
Summary: Web admin GUI for %{realname} |
46 |
|
|
Group: Development/PHP |
47 |
|
|
Requires: apache-mod_php |
48 |
|
|
Requires: %{name} |
49 |
|
|
|
50 |
|
|
%description admin |
51 |
|
|
This package contains a Web admin GUI for %{realname}. |
52 |
|
|
|
53 |
|
|
To access the web GUI please open up your favourite web browser and point to: |
54 |
|
|
|
55 |
|
|
http://localhost/%{name}/ |
56 |
|
|
|
57 |
|
|
%prep |
58 |
|
|
|
59 |
|
|
%setup -q -n APC-%{version} |
60 |
|
|
[ "../package*.xml" != "/" ] && mv ../package*.xml . |
61 |
|
|
|
62 |
|
|
%patch0 -p0 |
63 |
colin |
129786 |
%patch1 -p3 |
64 |
spuhler |
17155 |
|
65 |
|
|
cp %{SOURCE1} %{inifile} |
66 |
|
|
|
67 |
|
|
%build |
68 |
|
|
%serverbuild |
69 |
|
|
|
70 |
|
|
phpize |
71 |
|
|
|
72 |
|
|
mkdir -p build-apc-mmap |
73 |
|
|
pushd build-apc-mmap |
74 |
|
|
ln -s ../configure . |
75 |
|
|
%configure2_5x \ |
76 |
|
|
--enable-%{modname}=shared,%{_prefix} \ |
77 |
|
|
--enable-apc-filehits \ |
78 |
|
|
--disable-apc-pthreadmutex \ |
79 |
|
|
--disable-apc-sem \ |
80 |
|
|
--disable-apc-spinlocks \ |
81 |
|
|
--enable-apc-mmap \ |
82 |
|
|
--enable-apc-memprotect |
83 |
|
|
|
84 |
|
|
%make |
85 |
|
|
popd |
86 |
|
|
|
87 |
|
|
mkdir -p build-apc-sem |
88 |
|
|
pushd build-apc-sem |
89 |
|
|
ln -s ../configure . |
90 |
|
|
%configure2_5x \ |
91 |
|
|
--enable-%{modname}=shared,%{_prefix} \ |
92 |
|
|
--enable-apc-filehits \ |
93 |
|
|
--disable-apc-pthreadmutex \ |
94 |
|
|
--disable-apc-mmap \ |
95 |
|
|
--disable-apc-spinlocks \ |
96 |
|
|
--enable-apc-sem \ |
97 |
|
|
--enable-apc-memprotect |
98 |
|
|
|
99 |
|
|
%make |
100 |
|
|
popd |
101 |
|
|
|
102 |
|
|
mkdir -p build-apc-spinlocks |
103 |
|
|
pushd build-apc-spinlocks |
104 |
|
|
ln -s ../configure . |
105 |
|
|
%configure2_5x \ |
106 |
|
|
--enable-%{modname}=shared,%{_prefix} \ |
107 |
|
|
--enable-apc-filehits \ |
108 |
|
|
--disable-apc-pthreadmutex \ |
109 |
|
|
--disable-apc-sem \ |
110 |
|
|
--disable-apc-mmap \ |
111 |
|
|
--disable-apc-memprotect \ |
112 |
|
|
--enable-apc-spinlocks |
113 |
|
|
|
114 |
|
|
%make |
115 |
|
|
popd |
116 |
|
|
|
117 |
|
|
mkdir -p build-apc-pthread |
118 |
|
|
pushd build-apc-pthread |
119 |
|
|
ln -s ../configure . |
120 |
|
|
%configure2_5x \ |
121 |
|
|
--enable-%{modname}=shared,%{_prefix} \ |
122 |
|
|
--enable-apc-filehits \ |
123 |
|
|
--disable-apc-spinlocks \ |
124 |
|
|
--disable-apc-mmap \ |
125 |
|
|
--disable-apc-sem \ |
126 |
|
|
--disable-apc-memprotect |
127 |
|
|
|
128 |
|
|
%make |
129 |
|
|
popd |
130 |
|
|
|
131 |
|
|
%install |
132 |
|
|
rm -rf %{buildroot} |
133 |
|
|
|
134 |
|
|
install -d %{buildroot}%{_libdir}/php/extensions |
135 |
|
|
install -d %{buildroot}%{_sysconfdir}/php.d |
136 |
|
|
install -d %{buildroot}/var/www/%{name} |
137 |
|
|
install -d %{buildroot}/var/lib/php-apc |
138 |
|
|
|
139 |
|
|
install -m0644 %{inifile} %{buildroot}%{_sysconfdir}/php.d/%{inifile} |
140 |
|
|
|
141 |
|
|
install -m0755 build-apc-mmap/modules/apc.so %{buildroot}%{_libdir}/php/extensions/apc-mmap.so |
142 |
|
|
install -m0755 build-apc-sem/modules/apc.so %{buildroot}%{_libdir}/php/extensions/apc-sem.so |
143 |
|
|
install -m0755 build-apc-spinlocks/modules/apc.so %{buildroot}%{_libdir}/php/extensions/apc-spinlocks.so |
144 |
|
|
install -m0755 build-apc-pthread/modules/apc.so %{buildroot}%{_libdir}/php/extensions/apc-pthread.so |
145 |
|
|
|
146 |
|
|
install -d -m 755 %{buildroot}%{webappconfdir} |
147 |
|
|
cat > %{buildroot}%{webappconfdir}/%{name}.conf << EOF |
148 |
|
|
Alias /%{name} /var/www/%{name} |
149 |
|
|
|
150 |
|
|
<Directory "/var/www/%{name}"> |
151 |
|
|
Order deny,allow |
152 |
|
|
Deny from all |
153 |
|
|
Allow from 127.0.0.1 |
154 |
|
|
ErrorDocument 403 "Access denied per %{webappconfdir}/%{name}.conf" |
155 |
|
|
</Directory> |
156 |
|
|
EOF |
157 |
|
|
|
158 |
|
|
install -m0644 apc.php %{buildroot}/var/www/%{name}/index.php |
159 |
|
|
|
160 |
|
|
%post |
161 |
|
|
if [ -f /var/lock/subsys/httpd ]; then |
162 |
|
|
%{_initrddir}/httpd restart >/dev/null || : |
163 |
|
|
fi |
164 |
|
|
|
165 |
|
|
%postun |
166 |
|
|
if [ "$1" = "0" ]; then |
167 |
|
|
if [ -f /var/lock/subsys/httpd ]; then |
168 |
|
|
%{_initrddir}/httpd restart >/dev/null || : |
169 |
|
|
fi |
170 |
|
|
fi |
171 |
|
|
|
172 |
|
|
|
173 |
|
|
%clean |
174 |
|
|
rm -rf %{buildroot} |
175 |
|
|
|
176 |
|
|
%files |
177 |
|
|
%defattr(-,root,root) |
178 |
|
|
%doc tests CHANGELOG INSTALL LICENSE NOTICE TECHNOTES.txt TODO package*.xml |
179 |
|
|
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/php.d/%{inifile} |
180 |
|
|
%attr(0755,root,root) %{_libdir}/php/extensions/apc-mmap.so |
181 |
|
|
%attr(0755,root,root) %{_libdir}/php/extensions/apc-sem.so |
182 |
|
|
%attr(0755,root,root) %{_libdir}/php/extensions/apc-spinlocks.so |
183 |
|
|
%attr(0755,root,root) %{_libdir}/php/extensions/apc-pthread.so |
184 |
|
|
%attr(0755,apache,apache) /var/lib/php-apc |
185 |
|
|
|
186 |
|
|
%files admin |
187 |
|
|
%defattr(-,root,root) |
188 |
|
|
%config(noreplace) %{webappconfdir}/%{name}.conf |
189 |
|
|
%dir /var/www/%{name} |
190 |
|
|
/var/www/%{name}/index.php |
191 |
|
|
|
192 |
|
|
|