packages: php-pecl-memcache/php-pecl-memcache.spec, php-pecl-memcache/memca...

glen glen at pld-linux.org
Thu Mar 25 10:43:25 CET 2010


Author: glen                         Date: Thu Mar 25 09:43:25 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- add web subpackage containing small admin panel; rel 4

---- Files affected:
packages/php-pecl-memcache:
   php-pecl-memcache.spec (1.42 -> 1.43) , memcache-apache.conf (NONE -> 1.1)  (NEW), memcache-lighttpd.conf (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/php-pecl-memcache/php-pecl-memcache.spec
diff -u packages/php-pecl-memcache/php-pecl-memcache.spec:1.42 packages/php-pecl-memcache/php-pecl-memcache.spec:1.43
--- packages/php-pecl-memcache/php-pecl-memcache.spec:1.42	Thu Mar 25 10:14:14 2010
+++ packages/php-pecl-memcache/php-pecl-memcache.spec	Thu Mar 25 10:43:20 2010
@@ -1,26 +1,44 @@
 # $Revision$, $Date$
+%include	/usr/lib/rpm/macros.php
 %define		modname	memcache
+%define		php_min_version 5.0.0
 Summary:	%{modname} - a memcached extension
 Summary(pl.UTF-8):	%{modname} - rozszerzenie memcached
 Name:		php-pecl-%{modname}
 Version:	3.0.4
-Release:	3
+Release:	4
 License:	PHP 3.01
 Group:		Development/Languages/PHP
 Source0:	http://pecl.php.net/get/%{modname}-%{version}.tgz
 # Source0-md5:	07933ce0191274201ea6905cd509c5b0
 Source1:	%{modname}.ini
+Source2:	%{modname}-apache.conf
+Source3:	%{modname}-lighttpd.conf
+Source4:	config.php
+Patch0:		%{modname}-webapp.patch
 URL:		http://pecl.php.net/package/memcache/
 BuildRequires:	php-devel >= 3:5.0.0
+BuildRequires:	rpm-php-pearprov >= 4.4.2-11
 BuildRequires:	rpmbuild(macros) >= 1.344
 %{?requires_php_extension}
 Requires:	php-common >= 4:5.0.4
 Requires:	php-session
 Requires:	php-zlib
-#Suggests:	memcached
+Suggests:	memcached
 Obsoletes:	php-pear-%{modname}
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define		_webapps	/etc/webapps
+%define		_webapp		%{modname}
+%define		_sysconfdir	%{_webapps}/%{_webapp}
+%define		_appdir		%{_datadir}/%{_webapp}
+
+# bad depsolver
+%define		_noautopear	pear
+
+# put it together for rpmbuild
+%define		_noautoreq	%{?_noautophp} %{?_noautopear}
+
 %description
 Memcached is a caching daemon designed especially for dynamic web
 applications to decrease database load by storing objects in memory.
@@ -36,9 +54,25 @@
 To rozszerzenie umożliwia pracę z memcached za pomocą poręcznego
 zorientowanego obiektowo (oraz przez procedury) interfejsu.
 
+%package web
+Summary:	Web interface for memcache
+Group:		Libraries
+Requires:	%{name} = %{epoch}:%{version}-%{release}
+Requires:	php-common >= 4:%{php_min_version}
+Requires:	php-date
+Requires:	php-gd
+Requires:	php-pcre
+Requires:	webapps
+Requires:	webserver(php) >= 5.0
+
+%description web
+Via this web interface script you can manage and view statistics of
+memcache.
+
 %prep
 %setup -q -c
 mv %{modname}-%{version}/* .
+%patch0 -p1
 
 %build
 phpize
@@ -52,7 +86,14 @@
 install -p modules/%{modname}.so $RPM_BUILD_ROOT%{php_extensiondir}
 # we use "session_" prefix in inifile to get loader *after* session extension
 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/session_%{modname}.ini
-cp -a example.php memcache.php $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+cp -a example.php $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+
+install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_appdir}}
+cp -a memcache.php $RPM_BUILD_ROOT%{_appdir}
+cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/config.php
+cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf
+cp -a $RPM_BUILD_ROOT%{_sysconfdir}/{apache,httpd}.conf
+cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -73,6 +114,24 @@
 	%php_webserver_restart
 fi
 
+%triggerin web -- apache1 < 1.3.37-3, apache1-base
+%webapp_register apache %{_webapp}
+
+%triggerun web -- apache1 < 1.3.37-3, apache1-base
+%webapp_unregister apache %{_webapp}
+
+%triggerin web -- apache < 2.2.0, apache-base
+%webapp_register httpd %{_webapp}
+
+%triggerun web -- apache < 2.2.0, apache-base
+%webapp_unregister httpd %{_webapp}
+
+%triggerin web -- lighttpd
+%webapp_register lighttpd %{_webapp}
+
+%triggerun web -- lighttpd
+%webapp_unregister lighttpd %{_webapp}
+
 %files
 %defattr(644,root,root,755)
 %doc CREDITS README
@@ -80,12 +139,24 @@
 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
 %{_examplesdir}/%{name}-%{version}
 
+%files web
+%defattr(644,root,root,755)
+%dir %attr(750,root,http) %{_sysconfdir}
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/config.php
+%{_appdir}
+
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
 * %{date} PLD Team <feedback at pld-linux.org>
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.43  2010/03/25 09:43:20  glen
+- add web subpackage containing small admin panel; rel 4
+
 Revision 1.42  2010/03/25 09:14:14  glen
 - move ini settings to separate file
 

================================================================
Index: packages/php-pecl-memcache/memcache-apache.conf
diff -u /dev/null packages/php-pecl-memcache/memcache-apache.conf:1.1
--- /dev/null	Thu Mar 25 10:43:25 2010
+++ packages/php-pecl-memcache/memcache-apache.conf	Thu Mar 25 10:43:20 2010
@@ -0,0 +1,9 @@
+Alias /memcache.php /usr/share/memcache/memcache.php
+
+<Directory /usr/share/xcache>
+	# Allow from localhost only.
+	# IMPORTANT: if you allow from elsewhere, be sure to change admin
+	# username/password in config.php otherwise you make your page password easily
+	# guessable.
+	Allow from 127.0.0.1
+</Directory>

================================================================
Index: packages/php-pecl-memcache/memcache-lighttpd.conf
diff -u /dev/null packages/php-pecl-memcache/memcache-lighttpd.conf:1.1
--- /dev/null	Thu Mar 25 10:43:25 2010
+++ packages/php-pecl-memcache/memcache-lighttpd.conf	Thu Mar 25 10:43:20 2010
@@ -0,0 +1,10 @@
+# Allow from localhost only.
+# IMPORTANT: if you allow from elsewhere, be sure to change admin
+# username/password in config.php otherwise you make your page password easily
+# guessable.
+
+$HTTP["remoteip"] == "127.0.0.1" {
+	alias.url += (
+		"/memcache.php" => "/usr/share/memcache/memcache.php"
+	)
+}
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/php-pecl-memcache/php-pecl-memcache.spec?r1=1.42&r2=1.43&f=u



More information about the pld-cvs-commit mailing list