-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmemcache-zynga.spec
372 lines (290 loc) · 13 KB
/
memcache-zynga.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
%{!?php_extdir: %{expand: %%global php_extdir %(php-config --extension-dir)}}
%global php_apiver %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1)
%global php_version %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP Version => //p') | tail -1)
%define pecl_name memcache-zynga
%define module_name memcache
%define log_dir /etc/pecl-log
Summary: Memcached extension with custom changes for zynga
Name: php-pecl-memcache-zynga
Version: 2.5.0.9
Release: %{?php_version}
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
Source: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
Source2: xml2changelog
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: php-devel >= 4.3.11, php-pear, zlib-devel
Requires(post): %{__pecl}
Requires(postun): %{__pecl}
Provides: php-pecl(%{pecl_name}) = %{version}-%{release}
%if %{?php_zend_api}0
Requires: php(zend-abi) = %{php_zend_api}
#Requires: php(api) = %{php_core_api}
%else
#Requires: php-api = %{php_apiver}
%endif
Requires: php >= %{php_version}, php-igbinary, minilzo
Conflicts: php-pecl(memcache)
%description
Memcached is a caching daemon designed especially for
dynamic web applications to decrease database load by
storing objects in memory.
This extension allows you to work with memcached through
handy OO and procedural interfaces.
Zynga customization - proxy support added
Memcache can be used as a PHP session handler.
%prep
%setup -c -q
%{_bindir}/php -n %{SOURCE2} package.xml >CHANGELOG
# avoid spurious-executable-perm
find . -type f -exec chmod -x {} \;
%build
cd %{pecl_name}-%{version}
phpize
chmod +x ./configure
%configure
%{__make} %{?_smp_mflags}
%install
cd %{pecl_name}-%{version}
%{__rm} -rf %{buildroot}
%{__make} install INSTALL_ROOT=%{buildroot}
# Drop in the bit of configuration
%{__mkdir_p} %{buildroot}%{_sysconfdir}/php.d
%{__cat} > %{buildroot}%{_sysconfdir}/php.d/%{module_name}.ini << 'EOF'
; Enable %{pecl_name} extension module
extension=%{module_name}.so
; Options for the %{module_name} module
; Whether to transparently failover to other servers on errors
;memcache.allow_failover=1
; Defines how many servers to try when setting and getting data.
;memcache.max_failover_attempts=20
; Data will be transferred in chunks of this size
;memcache.chunk_size=8192
; The default TCP port number to use when connecting to the memcached server
;memcache.default_port=11211
; Hash function {crc32, fnv}
;memcache.hash_function=crc32
; Hash strategy {standard, consistent}
;memcache.hash_strategy=standard
; Options for enabling proxy
; Enables/disabled proxy support
;memcache.proxy_enabled=false
; Proxy host/ip. For unix domain sockets, use unix://<abs path to socket>
;memcache.proxy_host=localhost
; Proxy port. For unix domain sockets, give 0
;memcache.proxy_port=0
; Compression level - ignored unless compression threshold is set on the memcache pool
; 0: use LZO compression
; 1 - 9: use Zlib compression
;memcache.compression_level=0
; Return value of get() on error
; By default, get() returns FALSE for both error and key miss
; with null_on_keymiss=1, get returns null for key miss and FALSE for error
;memcache.null_on_keymiss=0
; Options to use the memcache session handler
; Use memcache as a session handler
;session.save_handler=memcache
; Defines a comma separated of server urls to use for session storage
;session.save_path="tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15"
; Option to enable the number of retries on a persistent connection
;memcache.connection_retry_count=0
memcache.log_conf = %{log_dir}/logconf
; Option to enable end to end Data Integrity
; memcache.data_integrity_enabled=true
; Option to specify the algorithm used for data integrity, allowed values: "crc32", "none"
; memcache.integrity_algo="crc32"
EOF
# Install XML package description
# use 'name' rather than 'pecl_name' to avoid conflict with pear extensions
%{__mkdir_p} %{buildroot}%{pecl_xmldir}
#%{__install} -m 644 ../package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
%{__install} -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
%{__mkdir_p} %{buildroot}%{log_dir}
%{__cat} > %{buildroot}%{log_dir}/logconf << 'EOF'
default
EOF
%{__mkdir_p} %{buildroot}/etc/logrotate.d
%{__cat} > %{buildroot}/etc/logrotate.d/pecl << 'EOF'
/var/log/pecl-memcache.log /var/log/pecl-apache.log {
sharedscripts
notifempty
missingok
size 100M
compress
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}
EOF
%clean
%{__rm} -rf %{buildroot}
%if 0%{?pecl_install:1}
%post
%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
if [ -f /etc/syslog-ng/syslog-ng.conf ];then
sed /pecl_.*log/d /etc/syslog-ng/syslog-ng.conf > /tmp/back
mv /tmp/back /etc/syslog-ng/syslog-ng.conf
echo 'destination d_pecl_log { file("/var/log/pecl-memcache.log" owner("root") group ("root") perm(0644) ); };
filter f_pecl_log { facility(local4) and level(debug) and match('pecl-memcache'); };
log { source(s_sys); filter(f_pecl_log); destination(d_pecl_log); };
destination d_pecl_apache_log { file("/var/log/pecl-apache.log" owner("root") group ("root") perm(0644) ); };
filter f_pecl_apache_log { facility(local5) and level(debug) and match('pecl-memcache'); };
log { source(s_sys); filter(f_pecl_apache_log); destination(d_pecl_apache_log); };' >> /etc/syslog-ng/syslog-ng.conf
fi
/sbin/service syslog-ng restart
%endif
%if 0%{?pecl_uninstall:1}
%postun
if [ $1 -eq 0 -a -x %{__pecl} ] ; then
%{pecl_uninstall} %{pecl_name} >/dev/null || :
fi
%endif
%files
%defattr(-, root, root, -)
%doc CHANGELOG %{pecl_name}-%{version}/CREDITS %{pecl_name}-%{version}/README
%doc %{pecl_name}-%{version}/example.php %{pecl_name}-%{version}/memcache.php
%config(noreplace) %{_sysconfdir}/php.d/%{module_name}.ini
%{php_extdir}/%{module_name}.so
%{pecl_xmldir}/%{name}.xml
%{log_dir}
/etc/logrotate.d/pecl
%changelog
* Thu Aug 29 2013 <[email protected]> 2.5.0.9
- Add retry logic to mmc_readline to avoid spurious
connection failures
* Tue Jul 03 2012 <[email protected]> 2.5.0.0
- Data integrity support
* Fri Jun 01 2012 <[email protected]> 2.4.1.17
- Adding lock metadata changes
* Fri Jun 01 2012 <[email protected]> 2.4.1.16
- Fixing bugs in pecl-memcache
* Wed Apr 04 2012 <[email protected]> 2.4.1.15
- Fixing multiget and multigetByKey for slingo crash
* Wed Apr 04 2012 <[email protected]> 2.4.1.14
- Request logging changes for pecl-memcache
* Tue Mar 27 2012 <[email protected]> 2.4.1.13
- cas2 changes for pecl-memcache with igbinary
* Wed Mar 21 2012 <[email protected]> 2.4.1.12
igbinary and bzip2 changes for pecl-memcache
* Fri Jan 20 2012 <[email protected]> 2.4.1.11
- Refactoring logging changes and few minor bug fixes.Removed the dependency on libzparse.
* Fri Dec 20 2011 <[email protected]> 2.4.1.10
- Logging changes for pecl-memcache. Now pecl-memcache has dependency on libzparse.
* Fri Dec 03 2011 <[email protected]> 2.4.1.9
- Fix read access violation due to incorrect calculation of value_len in
mmc_pool_store
* Wed Nov 16 2011 <[email protected]> 2.4.1.8
- Reverse all TSRM related changes
* Wed Nov 02 2011 <[email protected]> 2.4.1.7
- Add a setproperty option 'EnableChecksum'. When this property is set,
crc checksums of both the compressed and uncompressed data will be
prepended to the outgoing payload. These checksums if present are verified
on the corresponding fetch operation
- Misc Fixes
+ Move test files into test directory
+ Fix crash in php_shutdown
+ Correct use thread safe TSRM constructs
+ Fix memory leak when multiGet fails
* Mon Oct 11 2011 <[email protected]> 2.4.1.6
- Return the compressed value len by reference for add/set/replace/cas operations.
* Mon Aug 29 2011 <[email protected]> 2.4.1.5
- Reinitialize mmc->proxy pointers in get_stats and get_version since those pointers
may be referencing freed objects. A multiget call creates a bunch of tmp proxy
structures that are freed at the end of the multiget. However the mmc->proxy pointers
that are pointing to those objects are not initialized to null
* Fri Jul 22 2011 <[email protected]> 2.4.1.4
- Added a key and server info the 'unable to unserialize' log message.
- Added a key and server info the 'unable to uncompress' log message.
* Tue Apr 19 2011 <[email protected]> 2.4.1.3
- Fix for a infinite loop in get_by_key api.
- Return false if uncompress failed in get_by_key.
- status_array was not NULL checked in a couple of places.
* Tue Mar 01 2011 <[email protected]> 2.4.1.2-1
- Weight paramter in addServer cannot be 0
- retry interval is a configurable paramter
* Mon Jan 24 2011 <[email protected]> 2.4.1.1-1
- PrependByKey was not using the shard key
- Shard Keys for xxxMultiByKey can be numeric
* Fri Jan 21 2011 <[email protected]> 2.4.1.0-1
- Append/Prepend operation will not compress data even if the compression
flags are set.
- Fixed a crash in get_by_multi_key, which was happening due to a use of
an uninitialized array variable
- Fixed a memory leak in get_by_multi_key
* Tue Jan 18 2011 <[email protected]> 2.4.0.3-1
- Added support for append(), prepend() and corresponding ByKey functions
* Mon Nov 29 2010 <[email protected]> 2.4.0.2-1
- Fixed another memory leak in multi-get introduced in 2.3.1.2
* Wed Nov 25 2010 <[email protected]> 2.4.0.1-1
- Fixed memory leak due to array_init in mmc_pool_new
* Wed Nov 18 2010 <[email protected]> 2.4.0.0-1
- Added all of the ByKey operations allowing you to pass in a separate shard
key for identifying the memcache node where the operation will be performed
* Tue Nov 16 2010 <[email protected]> 2.3.1.3
- A new function unlock() is now supported to unlock a getl'ed key
- 'add' will not be converted to cas
- Handling of "temporary failure" for incr/decr & delete
- getl on non existent key returns NULL
- getl can accept an optional timeout parameter
* Wed Nov 10 2010 <[email protected]> 2.3.1.2-1
- If uncompression or unserialization fails do not deactivate the server.
Return and log error only.
- In case of multiget indicate failure of the keys that failed to uncompress/
unserialize in the returned status array.
* Thu Sep 26 2010 (autumn equinox) <[email protected]> 2.3.1.1-1
- Added setProperty paramter ProtocolBinary (bool) to enable binary protocol
- Optional paramter to addServer and connect, use_binary to enable binary
protocol for a server
* Fri Sep 24 2010 Mark Jaffe <[email protected]> 2.3.1.0-2
- Match the version string
* Wed Aug 25 2010 Manik Taneja <[email protected]> 2.3.1.0-1
- Implementation of getl(). This function takes the same number
of parameters as get(). On success the object is locked for a
default period of 15 seconds.
* Wed Aug 11 2010 Jayesh Jose <[email protected]> 2.3.0.10-1
- Fixed a crash that happens during module_shutdown()
* Mon Aug 09 2010 Manik Taneja <[email protected]> 2.3.0.9-1
- During a multi-get if a connection to the proxy fails, then
do not try and open any more connections for that page
* Mon Jun 28 2010 Jayesh Jose <[email protected]> 2.3.0.8-1
- Fixed a crash in get2 when php serialized objects are retrieved
* Fri May 15 2010 Jayesh Jose <[email protected]> 2.3.0.4-1
- Fixed an issue with multi-get2 - with mcmux, it used to
- return failure even if just one of the keys failed
* Sat May 01 2010 Manik Taneja <[email protected]> 2.3.0.2-1
- multi-get2 returns with an array of key-status pairs
- added "non-numeric" return check for incr/decr
* Tue Apr 27 2010 Jayesh Jose <[email protected]> 2.3.0.1-1
- CAS support added
- New function, get2 that takes value as a ref param
* Wed Apr 21 2010 Jayesh Jose <[email protected]> 2.2.7.0-1
- Support for turning on/off proxy at a Memcache object level
* Wed Mar 10 2010 Jayesh Jose <[email protected]> 2.2.6.0-1
- Adding LZO compression support
* Thu Feb 25 2010 Prashun Purkayastha <[email protected]> 2.2.5.5-1
- Added a display message for the NOT_FOUND error
* Tue Feb 16 2010 Prashun Purkayastha <[email protected]> 2.2.5.4-1
- Added INI_SET option to retry with "memcache.connection_retry_count" on a
- failed set or get operation on a persistent connection
* Wed Nov 18 2009 Jayesh Jose <[email protected]> 2.2.5.3-1
- Disabled fall back to direct mc connection
* Thu Oct 29 2009 Jayesh Jose <[email protected]> 2.2.5-1
- Zynga version with proxy support
* Sat Feb 28 2009 Remi Collet <[email protected]> 2.2.5-1
- new version 2.2.5 (bug fixes)
* Fri Sep 11 2008 Remi Collet <[email protected]> 2.2.4-1
- new version 2.2.4 (bug fixes)
* Sat Feb 9 2008 Remi Collet <[email protected]> 2.2.3-1
- new version
* Thu Jan 10 2008 Remi Collet <[email protected]> 2.2.2-1
- new version
* Thu Nov 01 2007 Remi Collet <[email protected]> 2.2.1-1
- new version
* Sat Sep 22 2007 Remi Collet <[email protected]> 2.2.0-1
- new version
- add new INI directives (hash_strategy + hash_function) to config
- add BR on php-devel >= 4.3.11
* Mon Aug 20 2007 Remi Collet <[email protected]> 2.1.2-1
- initial RPM