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