1 %include /usr/lib/rpm/macros.php
2 %define modname memcache
3 %define php_min_version 5.0.0
4 Summary: %{modname} - a memcached extension
5 Summary(pl.UTF-8): %{modname} - rozszerzenie memcached
6 Name: php-pecl-%{modname}
10 Group: Development/Languages/PHP
11 Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
12 # Source0-md5: 23c2a1548f3fc7658b98b1c60e6d83b1
13 Source1: %{modname}.ini
14 Source2: %{modname}-apache.conf
15 Source3: %{modname}-lighttpd.conf
17 Source5: %{modname}-httpd.conf
18 Patch0: %{modname}-webapp.patch
19 URL: http://pecl.php.net/package/memcache/
20 BuildRequires: php-devel >= 3:5.0.0
21 BuildRequires: php-packagexml2cl
22 BuildRequires: rpm-php-pearprov >= 4.4.2-11
23 BuildRequires: rpmbuild(macros) >= 1.344
24 %{?requires_php_extension}
25 Requires: php(core) >= 5.0.4
29 Obsoletes: php-pear-%{modname}
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 %define _webapps /etc/webapps
33 %define _webapp %{modname}
34 %define _sysconfdir %{_webapps}/%{_webapp}
35 %define _appdir %{_datadir}/%{_webapp}
38 %define _noautopear pear
40 # put it together for rpmbuild
41 %define _noautoreq %{?_noautophp} %{?_noautopear}
44 Memcached is a caching daemon designed especially for dynamic web
45 applications to decrease database load by storing objects in memory.
47 This extension allows you to work with memcached through handy OO and
48 procedural interfaces.
50 %description -l pl.UTF-8
51 Memcached to zaprojektowany dla dynamicznych aplikacji internetowych
52 daemon cachujący mający za zadanie zmniejszenie obciążenia bazy danych
53 przez przechowywanie w pamięci obiektów.
55 To rozszerzenie umożliwia pracę z memcached za pomocą poręcznego
56 zorientowanego obiektowo (oraz przez procedury) interfejsu.
59 Summary: Web interface for memcache
61 # does not require extension itself
62 Requires: php(core) >= %{php_min_version}
67 Requires: webserver(php) >= 5.0
68 Conflicts: apache-base < 2.4.0-1
71 Via this web interface script you can manage and view statistics of
76 mv %{modname}-%{version}/* .
80 packagexml2cl package.xml > ChangeLog
87 rm -rf $RPM_BUILD_ROOT
88 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
89 install -p modules/%{modname}.so $RPM_BUILD_ROOT%{php_extensiondir}
90 # we use "session_" prefix in inifile to get loader *after* session extension
91 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/session_%{modname}.ini
92 cp -a example.php $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
94 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
95 cp -a memcache.php $RPM_BUILD_ROOT%{_appdir}
96 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/config.php
97 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
98 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
99 cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf
102 rm -rf $RPM_BUILD_ROOT
105 %php_webserver_restart
108 if [ "$1" = 0 ]; then
109 %php_webserver_restart
112 %triggerpostun -- %{name} < 3.0.4-2
113 if [ -f %{php_sysconfdir}/conf.d/%{modname}.ini.rpmsave ]; then
114 echo >&2 "Restoring old config: %{modname}.ini.rpmsave -> session_%{modname}.ini in %{php_sysconfdir}/conf.d"
115 cp -f %{php_sysconfdir}/conf.d/session_%{modname}.ini{,.rpmnew}
116 mv -f %{php_sysconfdir}/conf.d/{%{modname}.ini.rpmsave,session_%{modname}.ini}
117 %php_webserver_restart
120 %triggerin web -- apache1 < 1.3.37-3, apache1-base
121 %webapp_register apache %{_webapp}
123 %triggerun web -- apache1 < 1.3.37-3, apache1-base
124 %webapp_unregister apache %{_webapp}
126 %triggerin web -- apache-base
127 %webapp_register httpd %{_webapp}
129 %triggerun web -- apache-base
130 %webapp_unregister httpd %{_webapp}
132 %triggerin web -- lighttpd
133 %webapp_register lighttpd %{_webapp}
135 %triggerun web -- lighttpd
136 %webapp_unregister lighttpd %{_webapp}
139 %defattr(644,root,root,755)
140 %doc CREDITS README ChangeLog
141 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/session_%{modname}.ini
142 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
143 %{_examplesdir}/%{name}-%{version}
146 %defattr(644,root,root,755)
147 %dir %attr(750,root,http) %{_sysconfdir}
148 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
149 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
150 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
151 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php