File php-pecl-apc.spec of Package php-pecl-apc
1
%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
2
%global php_extdir %(php-config --extension-dir 2>/dev/null || echo %{_libdir}/php4)
3
%global php_zendabiver %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP Extension => //p') | tail -1)
4
%global php_version %((echo 0; php-config --version 2>/dev/null) | tail -1)
5
%global pecl_name APC
6
7
Summary: APC caches and optimizes PHP intermediate code
8
Name: php-pecl-apc
9
Version: 3.1.13
10
Release: 1%{?dist}
11
License: PHP
12
Group: Development/Languages
13
URL: http://pecl.php.net/package/APC
14
Source: http://pecl.php.net/get/APC-%{version}.tgz
15
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
16
Conflicts: php-mmcache php-eaccelerator
17
BuildRequires: php-devel >= 5.1.0, httpd-devel, php-pear, pcre-devel, which
18
Requires(post): %{__pecl}
19
Requires(postun): %{__pecl}
20
%if %{defined php_zend_api}
21
# Require clean ABI/API versions if available (Fedora)
22
Requires: php(zend-abi) = %{php_zend_api}
23
Requires: php(api) = %{php_core_api}
24
%else
25
%if "%{rhel}" == "5"
26
# RHEL5 where we have php-common providing the Zend ABI the "old way"
27
Requires: php-zend-abi = %{php_zendabiver}
28
%else
29
# RHEL4 where we have no php-common and nothing providing the Zend ABI...
30
Requires: php = %{php_version}
31
%endif
32
%endif
33
Provides: php-pecl(%{pecl_name}) = %{version}
34
35
Requires(post): %{__pecl}
36
Requires(postun): %{__pecl}
37
38
%description
39
APC is a free, open, and robust framework for caching and optimizing PHP
40
intermediate code.
41
42
43
%prep
44
%setup -q -c
45
46
47
%build
48
cd APC-%{version}
49
%{_bindir}/phpize
50
%configure --enable-apc-mmap --with-php-config=%{_bindir}/php-config
51
%{__make} %{?_smp_mflags}
52
53
54
%install
55
pushd APC-%{version}
56
%{__rm} -rf %{buildroot}
57
%{__make} install INSTALL_ROOT=%{buildroot}
58
59
# Fix the charset of NOTICE
60
iconv -f iso-8859-1 -t utf8 NOTICE >NOTICE.utf8
61
mv NOTICE.utf8 NOTICE
62
63
popd
64
# Install the package XML file
65
%{__mkdir_p} %{buildroot}%{pecl_xmldir}
66
%{__install} -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
67
68
# Drop in the bit of configuration
69
%{__mkdir_p} %{buildroot}%{_sysconfdir}/php.d
70
%{__cat} > %{buildroot}%{_sysconfdir}/php.d/apc.ini << 'EOF'
71
; Enable apc extension module
72
extension = apc.so
73
74
; Options for the APC module version >= 3.1.3
75
; See http://www.php.net/manual/en/apc.configuration.php
76
77
; This can be set to 0 to disable APC.
78
apc.enabled=1
79
; The number of shared memory segments to allocate for the compiler cache.
80
apc.shm_segments=1
81
; The size of each shared memory segment with M/G suffix.
82
apc.shm_size=64M
83
; A "hint" about the number of distinct source files that will be included or
84
; requested on your web server. Set to zero or omit if you're not sure;
85
apc.num_files_hint=1024
86
; Just like num_files_hint, a "hint" about the number of distinct user cache
87
; variables to store. Set to zero or omit if you're not sure;
88
apc.user_entries_hint=4096
89
; The number of seconds a cache entry is allowed to idle in a slot in case this
90
; cache entry slot is needed by another entry.
91
apc.ttl=7200
92
; use the SAPI request start time for TTL
93
apc.use_request_time=1
94
; The number of seconds a user cache entry is allowed to idle in a slot in case
95
; this cache entry slot is needed by another entry.
96
apc.user_ttl=7200
97
; The number of seconds that a cache entry may remain on the garbage-collection list.
98
apc.gc_ttl=3600
99
; On by default, but can be set to off and used in conjunction with positive
100
; apc.filters so that files are only cached if matched by a positive filter.
101
apc.cache_by_default=1
102
; A comma-separated list of POSIX extended regular expressions.
103
apc.filters
104
; The mktemp-style file_mask to pass to the mmap module
105
apc.mmap_file_mask=/tmp/apc.XXXXXX
106
; This file_update_protection setting puts a delay on caching brand new files.
107
apc.file_update_protection=2
108
; Setting this enables APC for the CLI version of PHP (Mostly for testing and debugging).
109
apc.enable_cli=0
110
; Prevents large files from being cached
111
apc.max_file_size=1M
112
; Whether to stat the main script file and the fullpath includes.
113
apc.stat=1
114
; Vertification with ctime will avoid problems caused by programs such as svn or rsync by making
115
; sure inodes havn't changed since the last stat. APC will normally only check mtime.
116
apc.stat_ctime=0
117
; Whether to canonicalize paths in stat=0 mode or fall back to stat behaviour
118
apc.canonicalize=0
119
; With write_lock enabled, only one process at a time will try to compile an
120
; uncached script while the other processes will run uncached
121
apc.write_lock=1
122
; Logs any scripts that were automatically excluded from being cached due to early/late binding issues.
123
apc.report_autofilter=0
124
; RFC1867 File Upload Progress hook handler
125
apc.rfc1867=0
126
apc.rfc1867_prefix =upload_
127
apc.rfc1867_name=APC_UPLOAD_PROGRESS
128
apc.rfc1867_freq=0
129
apc.rfc1867_ttl=3600
130
; Optimize include_once and require_once calls and avoid the expensive system calls used.
131
apc.include_once_override=0
132
apc.lazy_classes=00
133
apc.lazy_functions=0
134
; Enables APC handling of signals, such as SIGSEGV, that write core files when signaled.
135
; APC will attempt to unmap the shared memory segment in order to exclude it from the core file
136
apc.coredump_unmap=0
137
; Records a md5 hash of files.
138
apc.file_md5=0
139
; not documented
140
apc.preload_path
141
EOF
142
143
144
%check
145
cd %{pecl_name}-%{version}
146
TEST_PHP_EXECUTABLE=$(which php) php run-tests.php \
147
-n -q -d extension_dir=modules \
148
-d extension=apc.so
149
150
151
%if 0%{?pecl_install:1}
152
%post
153
%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
154
%endif
155
156
157
%if 0%{?pecl_uninstall:1}
158
%postun
159
if [ $1 -eq 0 ] ; then
160
%{pecl_uninstall} %{pecl_name} >/dev/null || :
161
fi
162
%endif
163
164
165
%clean
166
%{__rm} -rf %{buildroot}
167
168
169
%files
170
%defattr(-, root, root, 0755)
171
%doc APC-%{version}/TECHNOTES.txt APC-%{version}/CHANGELOG APC-%{version}/LICENSE
172
%doc APC-%{version}/NOTICE APC-%{version}/TODO APC-%{version}/apc.php
173
%doc APC-%{version}/INSTALL
174
%config(noreplace) %{_sysconfdir}/php.d/apc.ini
175
%{php_extdir}/apc.so
176
%{pecl_xmldir}/%{name}.xml
177
%{_includedir}/php/ext/apc/apc_serializer.h
178
179
%changelog
180
* Mon May 16 2011 Carsten Schoene <cs@linux-administrator.com> - 3.1.9-1
181
- update to 3.1.9
182
183
* Mon May 16 2011 Carsten Schoene <cs@linux-administrator.com> - 3.1.8-1
184
- update to 3.1.8
185
186
* Sun Dec 12 2010 Andy Thompson <andy@webtatic.com> - 3.1.6-1
187
- update to 3.1.6
188
189
* Tue Aug 17 2010 Andy Thompson <andy@webtatic.com> - 3.1.4-2
190
- fix default apc.shm_size value
191
192
* Sat Aug 07 2010 Andy Thompson <andy@webtatic.com> - 3.1.4-1
193
- update to 3.1.4
194
195
* Fri Aug 14 2009 Remi Collet <Fedora@FamilleCollet.com> - 3.1.3p1-1
196
- update to 3.1.3 patch1 (beta, for PHP 5.3 support)
197
- add test suite (disabled for http://pecl.php.net/bugs/bug.php?id=16793)
198
- add use_request_time, lazy_classes, lazy_functions options (apc.ini)
199
200
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.2-2
201
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
202
203
* Sun Jul 12 2009 Remi Collet <Fedora@FamilleCollet.com> - 3.1.2-1
204
- update to 3.1.2 (beta) - PHP 5.3 support
205
- use setup -q -c
206
207
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.19-2
208
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
209
210
* Wed Jun 25 2008 Tim Jackson <rpm@timj.co.uk> - 3.0.19-1
211
- Update to 3.0.19
212
- Fix PHP Zend API/ABI dependencies to work on EL-4/5
213
- Fix "License" tag
214
- Fix encoding of "NOTICE" file
215
- Add registration via PECL
216
217
* Mon Feb 18 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 3.0.14-3
218
- Autorebuild for GCC 4.3
219
220
* Tue Aug 28 2007 Fedora Release Engineering <rel-eng at fedoraproject dot org> - 3.0.14-2
221
- Rebuild for selinux ppc32 issue.
222
223
* Thu Jun 28 2007 Chris Chabot <chabotc@xs4all.nl> - 3.0.14-1
224
- Updated to 3.0.14
225
- Included new php api snipplets
226
227
* Fri Sep 15 2006 Chris Chabot <chabotc@xs4all.nl> - 3.0.12-5
228
- Updated to new upstream version
229
230
* Mon Sep 11 2006 Chris Chabot <chabotc@xs4all.nl> - 3.0.10-5
231
- FC6 rebuild
232
233
* Sun Aug 13 2006 Chris Chabot <chabotc@xs4all.nl> - 3.0.10-4
234
- FC6T2 rebuild
235
236
* Mon Jun 19 2006 - Chris Chabot <chabotc@xs4all.nl> - 3.0.10-3
237
- Renamed to php-pecl-apc and added provides php-apc
238
- Removed php version string from the package version
239
240
* Mon Jun 19 2006 - Chris Chabot <chabotc@xs4all.nl> - 3.0.10-2
241
- Trimmed down BuildRequires
242
- Added Provices php-pecl(apc)
243
244
* Sun Jun 18 2006 - Chris Chabot <chabotc@xs4all.nl> - 3.0.10-1
245
- Initial package, templated on already existing php-json
246
and php-eaccelerator packages
247