SPECS: mysql-proxy.spec - add mysqlproxy user/group; rel 1

glen glen at pld-linux.org
Mon Dec 10 12:32:35 CET 2007


Author: glen                         Date: Mon Dec 10 11:32:35 2007 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- add mysqlproxy user/group; rel 1

---- Files affected:
SPECS:
   mysql-proxy.spec (1.10 -> 1.11) 

---- Diffs:

================================================================
Index: SPECS/mysql-proxy.spec
diff -u SPECS/mysql-proxy.spec:1.10 SPECS/mysql-proxy.spec:1.11
--- SPECS/mysql-proxy.spec:1.10	Thu Nov 22 00:29:32 2007
+++ SPECS/mysql-proxy.spec	Mon Dec 10 12:32:30 2007
@@ -1,6 +1,4 @@
 # $Revision$, $Date$
-# TODO
-# - mysqlproxy user to run as
 # Conditional build:
 %bcond_with	tests		# build with tests. needs mysql server on localhost:3306
 #
@@ -8,9 +6,9 @@
 Summary(pl.UTF-8):	Proxy MySQL
 Name:		mysql-proxy
 Version:	0.6.0
-Release:	0.2
+Release:	1
 License:	GPL
-Group:		Applications
+Group:		Applications/Networking
 Source0:	http://mysql.tonnikala.org/Downloads/MySQL-Proxy/%{name}-%{version}.tar.gz
 # Source0-md5:	b76ad6f059f78b9aaca49c8c29cb2719
 Source1:	%{name}.init
@@ -29,7 +27,15 @@
 BuildRequires:	lua51
 %endif
 Requires(post,preun):	/sbin/chkconfig
+Requires(postun):	/usr/sbin/groupdel
+Requires(postun):	/usr/sbin/userdel
+Requires(pre):	/bin/id
+Requires(pre):	/usr/bin/getgid
+Requires(pre):	/usr/sbin/groupadd
+Requires(pre):	/usr/sbin/useradd
 Requires:	rc-scripts >= 0.4.0.20
+Provides:	group(mysqlproxy)
+Provides:	user(mysqlproxy)
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -76,13 +82,17 @@
 
 # put those to -tutorial package
 rm -f $RPM_BUILD_ROOT%{_datadir}/*.lua
-install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
+install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/run/mysql-proxy}
 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%pre
+%groupadd -g 193 mysqlproxy
+%useradd -u 193 -g mysqlproxy -c "MySQL Proxy" mysqlproxy
+
 %post
 /sbin/chkconfig --add %{name}
 %service %{name} restart "MySQL Proxy"
@@ -93,6 +103,12 @@
 	/sbin/chkconfig --del %{name}
 fi
 
+%postun
+if [ "$1" = "0" ]; then
+	%userremove mysqlproxy
+	%groupremove mysqlproxy
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS ChangeLog NEWS README README.TESTS THANKS
@@ -100,6 +116,7 @@
 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
 %attr(755,root,root) %{_sbindir}/mysql-proxy
 %{_datadir}/%{name}
+%dir %attr(775,root,mysqlproxy) /var/run/mysql-proxy
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -107,6 +124,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.11  2007-12-10 11:32:30  glen
+- add mysqlproxy user/group; rel 1
+
 Revision 1.10  2007-11-21 23:29:32  glen
 - add initscript
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/mysql-proxy.spec?r1=1.10&r2=1.11&f=u



More information about the pld-cvs-commit mailing list