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