1 %define php_name php%{?php_suffix}
2 %define modname memcache
3 %define php_min_version 5.0.0
4 %include /usr/lib/rpm/macros.php
5 Summary: %{modname} - a memcached extension
6 Summary(pl.UTF-8): %{modname} - rozszerzenie memcached
7 Name: %{php_name}-pecl-%{modname}
11 Group: Development/Languages/PHP
12 Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
13 # Source0-md5: 24505e9b263d2c77f8ae5e9b4725e7d1
14 Source1: %{modname}.ini
15 Source2: %{modname}-apache.conf
16 Source3: %{modname}-lighttpd.conf
18 Source5: %{modname}-httpd.conf
19 Patch0: %{modname}-webapp.patch
20 URL: http://pecl.php.net/package/memcache/
21 BuildRequires: %{php_name}-devel >= 3:5.0.0
22 BuildRequires: %{php_name}-xml
23 BuildRequires: php-packagexml2cl
24 BuildRequires: rpm-php-pearprov >= 4.4.2-11
25 BuildRequires: rpmbuild(macros) >= 1.650
26 %{?requires_php_extension}
27 Requires: %{php_name}-session
28 Requires: %{php_name}-zlib
30 Provides: php(memcache) = %{version}
31 Obsoletes: php-pecl-memcache < 3.0.8-5
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 %define _webapps /etc/webapps
35 %define _webapp %{modname}
36 %define _sysconfdir %{_webapps}/%{_webapp}
37 %define _appdir %{_datadir}/%{_webapp}
40 %define _noautopear pear
42 # put it together for rpmbuild
43 %define _noautoreq %{?_noautophp} %{?_noautopear}
46 Memcached is a caching daemon designed especially for dynamic web
47 applications to decrease database load by storing objects in memory.
49 This extension allows you to work with memcached through handy OO and
50 procedural interfaces.
52 %description -l pl.UTF-8
53 Memcached to zaprojektowany dla dynamicznych aplikacji internetowych
54 daemon cachujący mający za zadanie zmniejszenie obciążenia bazy danych
55 przez przechowywanie w pamięci obiektów.
57 To rozszerzenie umożliwia pracę z memcached za pomocą poręcznego
58 zorientowanego obiektowo (oraz przez procedury) interfejsu.
61 Summary: Web interface for memcache
63 # does not require extension itself
64 Requires: php(core) >= %{php_min_version}
69 Requires: webserver(php) >= 5.0
70 Conflicts: apache-base < 2.4.0-1
71 %if "%{_rpmversion}" >= "5"
76 Via this web interface script you can manage and view statistics of
81 mv %{modname}-%{version}/* .
85 packagexml2cl package.xml > ChangeLog
92 rm -rf $RPM_BUILD_ROOT
93 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
94 install -p modules/%{modname}.so $RPM_BUILD_ROOT%{php_extensiondir}
95 # we use "session_" prefix in inifile to get loader *after* session extension
96 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/session_%{modname}.ini
97 cp -a example.php $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
99 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
100 cp -a memcache.php $RPM_BUILD_ROOT%{_appdir}
101 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/config.php
102 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
103 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
104 cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
107 rm -rf $RPM_BUILD_ROOT
110 %php_webserver_restart
113 if [ "$1" = 0 ]; then
114 %php_webserver_restart
117 %triggerpostun -- %{name} < 3.0.4-2
118 if [ -f %{php_sysconfdir}/conf.d/%{modname}.ini.rpmsave ]; then
119 echo >&2 "Restoring old config: %{modname}.ini.rpmsave -> session_%{modname}.ini in %{php_sysconfdir}/conf.d"
120 cp -f %{php_sysconfdir}/conf.d/session_%{modname}.ini{,.rpmnew}
121 mv -f %{php_sysconfdir}/conf.d/{%{modname}.ini.rpmsave,session_%{modname}.ini}
122 %php_webserver_restart
125 %triggerin web -- apache1 < 1.3.37-3, apache1-base
126 %webapp_register apache %{_webapp}
128 %triggerun web -- apache1 < 1.3.37-3, apache1-base
129 %webapp_unregister apache %{_webapp}
131 %triggerin web -- apache-base
132 %webapp_register httpd %{_webapp}
134 %triggerun web -- apache-base
135 %webapp_unregister httpd %{_webapp}
137 %triggerin web -- lighttpd
138 %webapp_register lighttpd %{_webapp}
140 %triggerun web -- lighttpd
141 %webapp_unregister lighttpd %{_webapp}
144 %defattr(644,root,root,755)
145 %doc CREDITS README ChangeLog
146 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/session_%{modname}.ini
147 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
148 %{_examplesdir}/%{name}-%{version}
151 %defattr(644,root,root,755)
152 %dir %attr(750,root,http) %{_sysconfdir}
153 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
154 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
155 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
156 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php