]> git.pld-linux.org Git - packages/php-pecl-memcache.git/blame - php-pecl-memcache.spec
- add web subpackage containing small admin panel; rel 4
[packages/php-pecl-memcache.git] / php-pecl-memcache.spec
CommitLineData
afdaa3d2 1%include /usr/lib/rpm/macros.php
a9222c27 2%define modname memcache
afdaa3d2 3%define php_min_version 5.0.0
a9222c27
ER
4Summary: %{modname} - a memcached extension
5Summary(pl.UTF-8): %{modname} - rozszerzenie memcached
6Name: php-pecl-%{modname}
8d3d196b 7Version: 3.0.4
afdaa3d2 8Release: 4
d7d5fbe6 9License: PHP 3.01
15f9ce79 10Group: Development/Languages/PHP
a9222c27 11Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
8d3d196b 12# Source0-md5: 07933ce0191274201ea6905cd509c5b0
20995d54 13Source1: %{modname}.ini
afdaa3d2
ER
14Source2: %{modname}-apache.conf
15Source3: %{modname}-lighttpd.conf
16Source4: config.php
17Patch0: %{modname}-webapp.patch
016f4b1b 18URL: http://pecl.php.net/package/memcache/
0bee29d4 19BuildRequires: php-devel >= 3:5.0.0
afdaa3d2 20BuildRequires: rpm-php-pearprov >= 4.4.2-11
86295f4f 21BuildRequires: rpmbuild(macros) >= 1.344
0bee29d4 22%{?requires_php_extension}
86295f4f 23Requires: php-common >= 4:5.0.4
bf29b6d3
ER
24Requires: php-session
25Requires: php-zlib
afdaa3d2 26Suggests: memcached
a9222c27 27Obsoletes: php-pear-%{modname}
15f9ce79
AG
28BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
afdaa3d2
ER
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
15f9ce79
AG
41%description
42Memcached is a caching daemon designed especially for dynamic web
43applications to decrease database load by storing objects in memory.
44
45This extension allows you to work with memcached through handy OO and
46procedural interfaces.
47
6dd6de29 48%description -l pl.UTF-8
15f9ce79 49Memcached to zaprojektowany dla dynamicznych aplikacji internetowych
6dd6de29
JR
50daemon cachujący mający za zadanie zmniejszenie obciążenia bazy danych
51przez przechowywanie w pamięci obiektów.
15f9ce79 52
6dd6de29 53To rozszerzenie umożliwia pracę z memcached za pomocą poręcznego
15f9ce79
AG
54zorientowanego obiektowo (oraz przez procedury) interfejsu.
55
afdaa3d2
ER
56%package web
57Summary: Web interface for memcache
58Group: Libraries
59Requires: %{name} = %{epoch}:%{version}-%{release}
60Requires: php-common >= 4:%{php_min_version}
61Requires: php-date
62Requires: php-gd
63Requires: php-pcre
64Requires: webapps
65Requires: webserver(php) >= 5.0
66
67%description web
68Via this web interface script you can manage and view statistics of
69memcache.
70
15f9ce79
AG
71%prep
72%setup -q -c
a9222c27 73mv %{modname}-%{version}/* .
afdaa3d2 74%patch0 -p1
15f9ce79
AG
75
76%build
15f9ce79 77phpize
172c079e
AG
78%configure \
79 --with-zlib-dir=/usr
15f9ce79
AG
80%{__make}
81
82%install
83rm -rf $RPM_BUILD_ROOT
a9222c27 84install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
20995d54
ER
85install -p modules/%{modname}.so $RPM_BUILD_ROOT%{php_extensiondir}
86# we use "session_" prefix in inifile to get loader *after* session extension
87cp -a %{SOURCE1} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/session_%{modname}.ini
afdaa3d2
ER
88cp -a example.php $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
89
90install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
91cp -a memcache.php $RPM_BUILD_ROOT%{_appdir}
92cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/config.php
93cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
94cp -a $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
95cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
15f9ce79
AG
96
97%clean
98rm -rf $RPM_BUILD_ROOT
99
100%post
86295f4f 101%php_webserver_restart
15f9ce79 102
0bee29d4
ER
103%postun
104if [ "$1" = 0 ]; then
86295f4f 105 %php_webserver_restart
15f9ce79
AG
106fi
107
c69936a3
ER
108%triggerpostun -- %{name} < 3.0.4-2
109if [ -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
114fi
115
afdaa3d2
ER
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
15f9ce79
AG
134%files
135%defattr(644,root,root,755)
a9222c27 136%doc CREDITS README
c69936a3 137%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/session_%{modname}.ini
a9222c27
ER
138%attr(755,root,root) %{php_extensiondir}/%{modname}.so
139%{_examplesdir}/%{name}-%{version}
afdaa3d2
ER
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,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
148%{_appdir}
This page took 0.1081 seconds and 4 git commands to generate.