/[packages]/updates/3/php-apc/current/SPECS/php-apc.spec
ViewVC logotype

Annotation of /updates/3/php-apc/current/SPECS/php-apc.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 403250 - (hide annotations) (download)
Fri Mar 15 14:09:26 2013 UTC (11 years, 1 month ago) by oden
Original Path: cauldron/php-apc/current/SPECS/php-apc.spec
File size: 6119 byte(s)
- rebuilt for php-5.4.13
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 oden 339955 Version: 3.1.14
14 oden 403250 Release: %mkrel 7
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 oden 344747 Source2: php-apc.config.php
21 spuhler 17155 Patch0: APC-3.1.3p1-default_lock_dir.diff
22 oden 344747 Patch1: APC-3.1.13-default_config.diff
23 spuhler 17155 BuildRequires: php-devel >= 3:5.2.0
24     Conflicts: php-afterburner php-mmcache php-eaccelerator
25     Epoch: 1
26    
27     %description
28     APC was conceived of to provide a way of boosting the performance of PHP on
29     heavily loaded sites by providing a way for scripts to be cached in a compiled
30     state, so that the overhead of parsing and compiling can be almost completely
31     eliminated. There are commercial products which provide this functionality, but
32     they are neither open-source nor free. Our goal was to level the playing field
33     by providing an implementation that allows greater flexibility and is
34     universally accessible.
35    
36     NOTE!: %{name} has to be loaded last, very important!
37    
38     This package comes with four different flavours of APC (use only one of them):
39    
40     o apc-mmap.so - mmap (fcntl) based locks (default)
41     o apc-sem.so - IPC semamphore based locks
42     o apc-spinlocks.so - Hardware-dependent implementation of spinlocks
43     o apc-pthread.so - NPTL pthread mutex based locks
44 oden 336088 o apc-mmap+mutex.so - mmap (fcntl) and pthread mutex based locks
45 spuhler 17155
46     %package admin
47     Summary: Web admin GUI for %{realname}
48     Group: Development/PHP
49     Requires: apache-mod_php
50     Requires: %{name}
51    
52     %description admin
53     This package contains a Web admin GUI for %{realname}.
54    
55     To access the web GUI please open up your favourite web browser and point to:
56    
57     http://localhost/%{name}/
58    
59     %prep
60    
61     %setup -q -n APC-%{version}
62     [ "../package*.xml" != "/" ] && mv ../package*.xml .
63    
64     %patch0 -p0
65 oden 344747 %patch1 -p0
66 spuhler 17155
67     cp %{SOURCE1} %{inifile}
68 oden 344747 cp %{SOURCE2} php-apc.config.php
69 spuhler 17155
70     %build
71     %serverbuild
72    
73     phpize
74    
75     mkdir -p build-apc-mmap
76     pushd build-apc-mmap
77     ln -s ../configure .
78     %configure2_5x \
79     --enable-%{modname}=shared,%{_prefix} \
80     --enable-apc-filehits \
81     --disable-apc-pthreadmutex \
82 oden 336088 --disable-apc-pthreadrwlocks \
83 spuhler 17155 --disable-apc-sem \
84     --disable-apc-spinlocks \
85     --enable-apc-mmap \
86     --enable-apc-memprotect
87    
88     %make
89     popd
90    
91     mkdir -p build-apc-sem
92     pushd build-apc-sem
93     ln -s ../configure .
94     %configure2_5x \
95     --enable-%{modname}=shared,%{_prefix} \
96     --enable-apc-filehits \
97     --disable-apc-pthreadmutex \
98 oden 336088 --disable-apc-pthreadrwlocks \
99 spuhler 17155 --disable-apc-mmap \
100     --disable-apc-spinlocks \
101     --enable-apc-sem \
102     --enable-apc-memprotect
103    
104     %make
105     popd
106    
107     mkdir -p build-apc-spinlocks
108     pushd build-apc-spinlocks
109     ln -s ../configure .
110     %configure2_5x \
111     --enable-%{modname}=shared,%{_prefix} \
112     --enable-apc-filehits \
113     --disable-apc-pthreadmutex \
114 oden 336088 --disable-apc-pthreadrwlocks \
115 spuhler 17155 --disable-apc-sem \
116     --disable-apc-mmap \
117     --disable-apc-memprotect \
118     --enable-apc-spinlocks
119    
120     %make
121     popd
122    
123     mkdir -p build-apc-pthread
124     pushd build-apc-pthread
125     ln -s ../configure .
126     %configure2_5x \
127     --enable-%{modname}=shared,%{_prefix} \
128     --enable-apc-filehits \
129 oden 336088 --enable-apc-pthreadrwlocks \
130 spuhler 17155 --disable-apc-spinlocks \
131     --disable-apc-mmap \
132     --disable-apc-sem \
133     --disable-apc-memprotect
134 oden 336088 %make
135     popd
136 spuhler 17155
137 oden 336088 mkdir -p build-apc-mmap+mutex
138     pushd build-apc-mmap+mutex
139     ln -s ../configure .
140     %configure2_5x \
141     --enable-%{modname}=shared,%{_prefix} \
142     --enable-apc-filehits \
143     --enable-apc-mmap \
144     --enable-apc-pthreadmutex
145 spuhler 17155 %make
146     popd
147    
148     %install
149     rm -rf %{buildroot}
150    
151     install -d %{buildroot}%{_libdir}/php/extensions
152 oden 344747 install -d %{buildroot}%{_sysconfdir}/%{name}
153 spuhler 17155 install -d %{buildroot}%{_sysconfdir}/php.d
154 oden 344747 install -d %{buildroot}%{_datadir}/%{name}
155 spuhler 17155 install -d %{buildroot}/var/lib/php-apc
156    
157     install -m0644 %{inifile} %{buildroot}%{_sysconfdir}/php.d/%{inifile}
158    
159     install -m0755 build-apc-mmap/modules/apc.so %{buildroot}%{_libdir}/php/extensions/apc-mmap.so
160     install -m0755 build-apc-sem/modules/apc.so %{buildroot}%{_libdir}/php/extensions/apc-sem.so
161     install -m0755 build-apc-spinlocks/modules/apc.so %{buildroot}%{_libdir}/php/extensions/apc-spinlocks.so
162     install -m0755 build-apc-pthread/modules/apc.so %{buildroot}%{_libdir}/php/extensions/apc-pthread.so
163 oden 336088 install -m0755 build-apc-mmap+mutex/modules/apc.so %{buildroot}%{_libdir}/php/extensions/apc-mmap+mutex.so
164 spuhler 17155
165     install -d -m 755 %{buildroot}%{webappconfdir}
166     cat > %{buildroot}%{webappconfdir}/%{name}.conf << EOF
167 oden 344747 Alias /%{name} %{_datadir}/%{name}
168 spuhler 17155
169 oden 344747 <Directory "%{_datadir}/%{name}">
170 oden 336087 %if %{mgaversion} < 3
171 spuhler 17155 Order deny,allow
172     Deny from all
173     Allow from 127.0.0.1
174 oden 336087 %endif
175     %if %{mgaversion} >= 3
176     Require local granted
177     %endif
178 spuhler 17155 ErrorDocument 403 "Access denied per %{webappconfdir}/%{name}.conf"
179     </Directory>
180     EOF
181    
182 oden 344747 install -m0644 apc.php %{buildroot}%{_datadir}/%{name}/index.php
183     install -m0644 php-apc.config.php %{buildroot}%{_sysconfdir}/%{name}/config.php
184 spuhler 17155
185 oden 344747 cat > README.urpmi << EOF
186     The actual configuration file is /etc/php-apc/config.php.
187     EOF
188    
189     %post admin
190     # generate random secret
191     secret=%_get_password 46
192    
193     # blowfish secret
194     perl -pi -e "s|_PASSWORD_|$secret|g" %{_sysconfdir}/%{name}/config.php
195    
196 spuhler 17155 %clean
197     rm -rf %{buildroot}
198    
199     %files
200     %defattr(-,root,root)
201     %doc tests CHANGELOG INSTALL LICENSE NOTICE TECHNOTES.txt TODO package*.xml
202     %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/php.d/%{inifile}
203     %attr(0755,root,root) %{_libdir}/php/extensions/apc-mmap.so
204     %attr(0755,root,root) %{_libdir}/php/extensions/apc-sem.so
205     %attr(0755,root,root) %{_libdir}/php/extensions/apc-spinlocks.so
206     %attr(0755,root,root) %{_libdir}/php/extensions/apc-pthread.so
207 oden 336088 %attr(0755,root,root) %{_libdir}/php/extensions/apc-mmap+mutex.so
208 spuhler 17155 %attr(0755,apache,apache) /var/lib/php-apc
209    
210     %files admin
211     %defattr(-,root,root)
212 oden 344747 %doc README.urpmi
213 spuhler 17155 %config(noreplace) %{webappconfdir}/%{name}.conf
214 oden 344747 %attr(0640,root,apache) %config(noreplace) %{_sysconfdir}/%{name}/config.php
215     %dir %{_datadir}/%{name}
216     %{_datadir}/%{name}/index.php

  ViewVC Help
Powered by ViewVC 1.1.30