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