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