/[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 336087 - (hide annotations) (download)
Sat Dec 29 13:05:03 2012 UTC (11 years, 3 months ago) by oden
Original Path: cauldron/php-apc/current/SPECS/php-apc.spec
File size: 4917 byte(s)
- adapt the apache config

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

  ViewVC Help
Powered by ViewVC 1.1.30