SPECS: mysql-proxy.spec - add initscript

glen glen at pld-linux.org
Thu Nov 22 00:29:37 CET 2007


Author: glen                         Date: Wed Nov 21 23:29:37 2007 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- add initscript

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

---- Diffs:

================================================================
Index: SPECS/mysql-proxy.spec
diff -u SPECS/mysql-proxy.spec:1.9 SPECS/mysql-proxy.spec:1.10
--- SPECS/mysql-proxy.spec:1.9	Wed Nov 21 23:43:47 2007
+++ SPECS/mysql-proxy.spec	Thu Nov 22 00:29:32 2007
@@ -1,7 +1,6 @@
 # $Revision$, $Date$
 # TODO
-# - initscript probably
-#
+# - mysqlproxy user to run as
 # Conditional build:
 %bcond_with	tests		# build with tests. needs mysql server on localhost:3306
 #
@@ -9,11 +8,13 @@
 Summary(pl.UTF-8):	Proxy MySQL
 Name:		mysql-proxy
 Version:	0.6.0
-Release:	0.1
+Release:	0.2
 License:	GPL
 Group:		Applications
 Source0:	http://mysql.tonnikala.org/Downloads/MySQL-Proxy/%{name}-%{version}.tar.gz
 # Source0-md5:	b76ad6f059f78b9aaca49c8c29cb2719
+Source1:	%{name}.init
+Source2:	%{name}.sysconfig
 Patch0:		%{name}-lua.patch
 URL:		http://forge.mysql.com/wiki/MySQL_Proxy
 BuildRequires:	autoconf
@@ -22,10 +23,13 @@
 BuildRequires:	libevent-devel
 BuildRequires:	lua51-devel
 BuildRequires:	mysql-devel
+BuildRequires:	rpmbuild(macros) >= 1.268
 %if %{with tests}
 BuildRequires:	check
 BuildRequires:	lua51
 %endif
+Requires(post,preun):	/sbin/chkconfig
+Requires:	rc-scripts >= 0.4.0.20
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -72,13 +76,28 @@
 
 # put those to -tutorial package
 rm -f $RPM_BUILD_ROOT%{_datadir}/*.lua
+install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
+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
 
+%post
+/sbin/chkconfig --add %{name}
+%service %{name} restart "MySQL Proxy"
+
+%preun
+if [ "$1" = "0" ]; then
+	%service -q %{name} stop
+	/sbin/chkconfig --del %{name}
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc AUTHORS ChangeLog NEWS README README.TESTS THANKS
+%attr(754,root,root) /etc/rc.d/init.d/%{name}
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
 %attr(755,root,root) %{_sbindir}/mysql-proxy
 %{_datadir}/%{name}
 
@@ -88,6 +107,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.10  2007-11-21 23:29:32  glen
+- add initscript
+
 Revision 1.9  2007-11-21 22:43:47  glen
 - tests pass if requirements made
 
================================================================

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



More information about the pld-cvs-commit mailing list