]> git.pld-linux.org Git - packages/php-pecl-memcache.git/blame - php-pecl-memcache.spec
- rel 5; changelog bcond (for building with php5.2)
[packages/php-pecl-memcache.git] / php-pecl-memcache.spec
CommitLineData
e71cf912 1%bcond_without changelog
afdaa3d2 2%include /usr/lib/rpm/macros.php
a9222c27 3%define modname memcache
afdaa3d2 4%define php_min_version 5.0.0
a9222c27
ER
5Summary: %{modname} - a memcached extension
6Summary(pl.UTF-8): %{modname} - rozszerzenie memcached
7Name: php-pecl-%{modname}
42d332d7 8Version: 3.0.6
e71cf912 9Release: 5
d7d5fbe6 10License: PHP 3.01
15f9ce79 11Group: Development/Languages/PHP
a9222c27 12Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
42d332d7 13# Source0-md5: 23c2a1548f3fc7658b98b1c60e6d83b1
20995d54 14Source1: %{modname}.ini
afdaa3d2
ER
15Source2: %{modname}-apache.conf
16Source3: %{modname}-lighttpd.conf
17Source4: config.php
18Patch0: %{modname}-webapp.patch
016f4b1b 19URL: http://pecl.php.net/package/memcache/
0bee29d4 20BuildRequires: php-devel >= 3:5.0.0
afdaa3d2 21BuildRequires: rpm-php-pearprov >= 4.4.2-11
86295f4f 22BuildRequires: rpmbuild(macros) >= 1.344
e71cf912 23%{?with_changelog:BuildRequires: php-packagexml2cl}
0bee29d4 24%{?requires_php_extension}
86295f4f 25Requires: php-common >= 4:5.0.4
bf29b6d3
ER
26Requires: php-session
27Requires: php-zlib
afdaa3d2 28Suggests: memcached
a9222c27 29Obsoletes: php-pear-%{modname}
15f9ce79
AG
30BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
afdaa3d2
ER
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
15f9ce79
AG
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
6dd6de29 50%description -l pl.UTF-8
15f9ce79 51Memcached to zaprojektowany dla dynamicznych aplikacji internetowych
6dd6de29
JR
52daemon cachujący mający za zadanie zmniejszenie obciążenia bazy danych
53przez przechowywanie w pamięci obiektów.
15f9ce79 54
6dd6de29 55To rozszerzenie umożliwia pracę z memcached za pomocą poręcznego
15f9ce79
AG
56zorientowanego obiektowo (oraz przez procedury) interfejsu.
57
afdaa3d2
ER
58%package web
59Summary: Web interface for memcache
60Group: Libraries
09120ee3 61# does not require extension itself
afdaa3d2
ER
62Requires: php-common >= 4:%{php_min_version}
63Requires: php-date
64Requires: php-gd
65Requires: php-pcre
66Requires: webapps
67Requires: webserver(php) >= 5.0
68
69%description web
70Via this web interface script you can manage and view statistics of
71memcache.
72
15f9ce79
AG
73%prep
74%setup -q -c
a9222c27 75mv %{modname}-%{version}/* .
afdaa3d2 76%patch0 -p1
15f9ce79
AG
77
78%build
e71cf912 79%{?with_changelog:packagexml2cl package.xml > ChangeLog}
15f9ce79 80phpize
172c079e
AG
81%configure \
82 --with-zlib-dir=/usr
15f9ce79
AG
83%{__make}
84
85%install
86rm -rf $RPM_BUILD_ROOT
a9222c27 87install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
20995d54
ER
88install -p modules/%{modname}.so $RPM_BUILD_ROOT%{php_extensiondir}
89# we use "session_" prefix in inifile to get loader *after* session extension
90cp -a %{SOURCE1} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/session_%{modname}.ini
afdaa3d2
ER
91cp -a example.php $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
92
93install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
94cp -a memcache.php $RPM_BUILD_ROOT%{_appdir}
95cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/config.php
96cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
97cp -a $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
98cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
15f9ce79
AG
99
100%clean
101rm -rf $RPM_BUILD_ROOT
102
103%post
86295f4f 104%php_webserver_restart
15f9ce79 105
0bee29d4
ER
106%postun
107if [ "$1" = 0 ]; then
86295f4f 108 %php_webserver_restart
15f9ce79
AG
109fi
110
c69936a3
ER
111%triggerpostun -- %{name} < 3.0.4-2
112if [ -f %{php_sysconfdir}/conf.d/%{modname}.ini.rpmsave ]; then
113 echo >&2 "Restoring old config: %{modname}.ini.rpmsave -> session_%{modname}.ini in %{php_sysconfdir}/conf.d"
114 cp -f %{php_sysconfdir}/conf.d/session_%{modname}.ini{,.rpmnew}
115 mv -f %{php_sysconfdir}/conf.d/{%{modname}.ini.rpmsave,session_%{modname}.ini}
116 %php_webserver_restart
117fi
118
afdaa3d2
ER
119%triggerin web -- apache1 < 1.3.37-3, apache1-base
120%webapp_register apache %{_webapp}
121
122%triggerun web -- apache1 < 1.3.37-3, apache1-base
123%webapp_unregister apache %{_webapp}
124
125%triggerin web -- apache < 2.2.0, apache-base
126%webapp_register httpd %{_webapp}
127
128%triggerun web -- apache < 2.2.0, apache-base
129%webapp_unregister httpd %{_webapp}
130
131%triggerin web -- lighttpd
132%webapp_register lighttpd %{_webapp}
133
134%triggerun web -- lighttpd
135%webapp_unregister lighttpd %{_webapp}
136
15f9ce79
AG
137%files
138%defattr(644,root,root,755)
e71cf912 139%doc CREDITS README %{?with_changelog:ChangeLog}
c69936a3 140%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/session_%{modname}.ini
a9222c27
ER
141%attr(755,root,root) %{php_extensiondir}/%{modname}.so
142%{_examplesdir}/%{name}-%{version}
afdaa3d2
ER
143
144%files web
145%defattr(644,root,root,755)
146%dir %attr(750,root,http) %{_sysconfdir}
147%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
148%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
149%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
1ec0934f 150%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
afdaa3d2 151%{_appdir}
This page took 0.073187 seconds and 4 git commands to generate.