]> git.pld-linux.org Git - packages/php-pecl-memcache.git/blob - php-pecl-memcache.spec
- fix config perms
[packages/php-pecl-memcache.git] / php-pecl-memcache.spec
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}
7 Version:        3.0.4
8 Release:        4
9 License:        PHP 3.01
10 Group:          Development/Languages/PHP
11 Source0:        http://pecl.php.net/get/%{modname}-%{version}.tgz
12 # Source0-md5:  07933ce0191274201ea6905cd509c5b0
13 Source1:        %{modname}.ini
14 Source2:        %{modname}-apache.conf
15 Source3:        %{modname}-lighttpd.conf
16 Source4:        config.php
17 Patch0:         %{modname}-webapp.patch
18 URL:            http://pecl.php.net/package/memcache/
19 BuildRequires:  php-devel >= 3:5.0.0
20 BuildRequires:  rpm-php-pearprov >= 4.4.2-11
21 BuildRequires:  rpmbuild(macros) >= 1.344
22 %{?requires_php_extension}
23 Requires:       php-common >= 4:5.0.4
24 Requires:       php-session
25 Requires:       php-zlib
26 Suggests:       memcached
27 Obsoletes:      php-pear-%{modname}
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %define         _webapps        /etc/webapps
31 %define         _webapp         %{modname}
32 %define         _sysconfdir     %{_webapps}/%{_webapp}
33 %define         _appdir         %{_datadir}/%{_webapp}
34
35 # bad depsolver
36 %define         _noautopear     pear
37
38 # put it together for rpmbuild
39 %define         _noautoreq      %{?_noautophp} %{?_noautopear}
40
41 %description
42 Memcached is a caching daemon designed especially for dynamic web
43 applications to decrease database load by storing objects in memory.
44
45 This extension allows you to work with memcached through handy OO and
46 procedural interfaces.
47
48 %description -l pl.UTF-8
49 Memcached to zaprojektowany dla dynamicznych aplikacji internetowych
50 daemon cachujący mający za zadanie zmniejszenie obciążenia bazy danych
51 przez przechowywanie w pamięci obiektów.
52
53 To rozszerzenie umożliwia pracę z memcached za pomocą poręcznego
54 zorientowanego obiektowo (oraz przez procedury) interfejsu.
55
56 %package web
57 Summary:        Web interface for memcache
58 Group:          Libraries
59 Requires:       %{name} = %{epoch}:%{version}-%{release}
60 Requires:       php-common >= 4:%{php_min_version}
61 Requires:       php-date
62 Requires:       php-gd
63 Requires:       php-pcre
64 Requires:       webapps
65 Requires:       webserver(php) >= 5.0
66
67 %description web
68 Via this web interface script you can manage and view statistics of
69 memcache.
70
71 %prep
72 %setup -q -c
73 mv %{modname}-%{version}/* .
74 %patch0 -p1
75
76 %build
77 phpize
78 %configure \
79         --with-zlib-dir=/usr
80 %{__make}
81
82 %install
83 rm -rf $RPM_BUILD_ROOT
84 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
85 install -p modules/%{modname}.so $RPM_BUILD_ROOT%{php_extensiondir}
86 # we use "session_" prefix in inifile to get loader *after* session extension
87 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/session_%{modname}.ini
88 cp -a example.php $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
89
90 install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
91 cp -a memcache.php $RPM_BUILD_ROOT%{_appdir}
92 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/config.php
93 cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
94 cp -a $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
95 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
96
97 %clean
98 rm -rf $RPM_BUILD_ROOT
99
100 %post
101 %php_webserver_restart
102
103 %postun
104 if [ "$1" = 0 ]; then
105         %php_webserver_restart
106 fi
107
108 %triggerpostun -- %{name} < 3.0.4-2
109 if [ -f %{php_sysconfdir}/conf.d/%{modname}.ini.rpmsave ]; then
110         echo >&2 "Restoring old config: %{modname}.ini.rpmsave -> session_%{modname}.ini in %{php_sysconfdir}/conf.d"
111         cp -f %{php_sysconfdir}/conf.d/session_%{modname}.ini{,.rpmnew}
112         mv -f %{php_sysconfdir}/conf.d/{%{modname}.ini.rpmsave,session_%{modname}.ini}
113         %php_webserver_restart
114 fi
115
116 %triggerin web -- apache1 < 1.3.37-3, apache1-base
117 %webapp_register apache %{_webapp}
118
119 %triggerun web -- apache1 < 1.3.37-3, apache1-base
120 %webapp_unregister apache %{_webapp}
121
122 %triggerin web -- apache < 2.2.0, apache-base
123 %webapp_register httpd %{_webapp}
124
125 %triggerun web -- apache < 2.2.0, apache-base
126 %webapp_unregister httpd %{_webapp}
127
128 %triggerin web -- lighttpd
129 %webapp_register lighttpd %{_webapp}
130
131 %triggerun web -- lighttpd
132 %webapp_unregister lighttpd %{_webapp}
133
134 %files
135 %defattr(644,root,root,755)
136 %doc CREDITS README
137 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/session_%{modname}.ini
138 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
139 %{_examplesdir}/%{name}-%{version}
140
141 %files web
142 %defattr(644,root,root,755)
143 %dir %attr(750,root,http) %{_sysconfdir}
144 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
145 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
146 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
147 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
148 %{_appdir}
This page took 0.134898 seconds and 4 git commands to generate.