Changes of Revision 14
[-] | Added | mysql-proxy.changes |
1
2 +------------------------------------------------------------------- 3 +Thu Jul 14 09:51:32 UTC 2011 - cs@linux-administrator.com 4 + 5 +- added mysql-proxy sysconfig & init script 6 +- add mysql-proxy user on install 7 +- cleanup spec 8 |
||
[-] | Changed | mysql-proxy.spec ^ |
112 1
2 Group: Applications/Databases 3 License: GPLv2 4 Source0: %{name}-%{version}.tar.bz2 5 -Patch0: %{name}-%{version}-default-plugindir-arch.patch 6 +Source1: %{name}.init 7 +Source2: %{name}.sysconfig 8 +PreReq: /usr/sbin/useradd /usr/sbin/groupadd %{?insserv_prereq:%insserv_prereq} %{?fillup_prereq:%fillup_prereq} 9 BuildRoot: %{_tmppath}/%{name}-%{version}-root 10 11 BuildRequires: mysql-devel glib2-devel >= 2.16.0 gawk flex lua-devel >= 5.1 12
13 14 %prep 15 %setup -q -n %{name}-%{version} 16 -%patch0 17 18 %build 19 %configure 20
21 22 %install 23 %__make install DESTDIR=%{buildroot} 24 +install -d -m 0755 %{buildroot}/var/{lib,run}/%{pkg_name} 25 +install -D -m 0755 %{S:1} %{buildroot}/etc/init.d/%{pkg_name} 26 +ln -sv ../../etc/init.d/%{pkg_name} %{buildroot}/%{_sbindir}/rc%{pkg_name} 27 +install -D -m 0644 %{S:2} %{buildroot}/var/adm/fillup-templates/sysconfig.mysql-proxy 28 +sed -i s@"%LIB%"@"%{_lib}"@g %{buildroot}/var/adm/fillup-templates/sysconfig.mysql-proxy 29 rm -fv %{buildroot}%{_datadir}/*.lua 30 rm -fv examples/Makefile* 31 +rm -fv examples/CMakeLists.txt 32 +rm -f %{buildroot}%{_libdir}/mysql-proxy/lua/*.la 33 +rm -f %{buildroot}%{_libdir}/mysql-proxy/plugins/*.la 34 35 %clean 36 rm -rf %{buildroot} 37 38 -%post -p /sbin/ldconfig 39 - 40 -%postun -p /sbin/ldconfig 41 +%pre 42 +/usr/sbin/groupadd -r %{name} &>/dev/null || : 43 +/usr/sbin/useradd -r -g %{name} -s /bin/false -c "Daemon user for MySQL Proxy" \ 44 + -d /var/lib/%{pkg_name} %{name} 2> /dev/null ||: 45 + 46 +%post 47 +/sbin/ldconfig 48 +%{?fillup_and_insserv:%fillup_and_insserv -n %{name} %{name}} 49 + 50 +%preun 51 +%{?stop_on_removal:%stop_on_removal %{name}} 52 + 53 +%postun 54 +/sbin/ldconfig 55 +%{?restart_on_update:%restart_on_update %{name}} 56 +%{?insserv_cleanup:%insserv_cleanup} 57 58 59 %files 60 %defattr(-,root,root,-) 61 %doc AUTHORS COPYING README NEWS 62 %doc examples/ 63 +%{_sbindir}/rc%{name} 64 +/etc/init.d/%{name} 65 %{_bindir}/%{name} 66 %{_bindir}/mysql-binlog-dump 67 %{_bindir}/mysql-myisam-dump 68
69 %dir %{_libdir}/mysql-proxy/lua/proxy 70 %dir %{_libdir}/mysql-proxy/plugins 71 %{_libdir}/mysql-proxy/lua/admin.lua 72 -%{_libdir}/mysql-proxy/lua/chassis.la 73 %{_libdir}/mysql-proxy/lua/chassis.so 74 -%{_libdir}/mysql-proxy/lua/glib2.la 75 %{_libdir}/mysql-proxy/lua/glib2.so 76 -%{_libdir}/mysql-proxy/lua/lfs.la 77 %{_libdir}/mysql-proxy/lua/lfs.so 78 -%{_libdir}/mysql-proxy/lua/lpeg.la 79 %{_libdir}/mysql-proxy/lua/lpeg.so 80 -%{_libdir}/mysql-proxy/lua/mysql.la 81 %{_libdir}/mysql-proxy/lua/mysql.so 82 -%{_libdir}/mysql-proxy/lua/posix.la 83 %{_libdir}/mysql-proxy/lua/posix.so 84 %{_libdir}/mysql-proxy/lua/proxy/auto-config.lua 85 %{_libdir}/mysql-proxy/lua/proxy/balance.lua 86
87 %{_libdir}/mysql-proxy/lua/proxy/parser.lua 88 %{_libdir}/mysql-proxy/lua/proxy/test.lua 89 %{_libdir}/mysql-proxy/lua/proxy/tokenizer.lua 90 -%{_libdir}/mysql-proxy/plugins/libadmin.la 91 %{_libdir}/mysql-proxy/plugins/libadmin.so 92 -%{_libdir}/mysql-proxy/plugins/libdebug.la 93 %{_libdir}/mysql-proxy/plugins/libdebug.so 94 -%{_libdir}/mysql-proxy/plugins/libproxy.la 95 %{_libdir}/mysql-proxy/plugins/libproxy.so 96 -%{_libdir}/mysql-proxy/plugins/libreplicant.la 97 %{_libdir}/mysql-proxy/plugins/libreplicant.so 98 +%attr(755,mysql-proxy,mysql-proxy)/var/run/%{name} 99 +/var/adm/fillup-templates/sysconfig.%{name} 100 101 %files devel 102 %defattr(-,root,root) 103
104 %{_libdir}/pkgconfig/mysql-proxy.pc 105 106 %changelog 107 -* Wed Jul 13 2011 Carsten Schoene <cs@linux-administrator.com> - 0.8.1-1 108 -- update to release 0.8.1 alpha 109 - 110 -* Wed Sep 09 2009 Carsten Schoene <cs@linux-administrator.com> - 0.7.2-1 111 -- initial build 112 |
||
[+] | Deleted | mysql-proxy-0.8.1-default-plugindir-arch.patch ^ |
@@ -1,28 +0,0 @@ ---- src/chassis-frontend.c.orig 2011-07-14 10:55:39.022110431 +0200 -+++ src/chassis-frontend.c 2011-07-14 11:06:05.914648376 +0200 -@@ -320,8 +320,12 @@ - #ifdef WIN32 - plugin_dir = g_build_filename(base_dir, "bin", NULL); - #else -+#if defined(__64BIT__) -+ plugin_dir = g_build_filename(base_dir, "lib64", PACKAGE, "plugins", NULL); -+#else - plugin_dir = g_build_filename(base_dir, "lib", PACKAGE, "plugins", NULL); - #endif -+#endif - - *_plugin_dir = plugin_dir; - -@@ -337,8 +341,12 @@ - #ifdef WIN32 - #define G_MODULE_PREFIX "plugin-" /* we build the plugins with a prefix on win32 to avoid name-clashing in bin/ */ - #else -+#if defined(__64BIT__) -+#define G_MODULE_PREFIX "lib64" -+#else - #define G_MODULE_PREFIX "lib" - #endif -+#endif - /* we have to hack around some glib distributions that - * don't set the correct G_MODULE_SUFFIX, notably MacPorts - */ | ||
Deleted | mysql-proxy-0.7.2.tar.bz2 ^ | |
[+] | Added | mysql-proxy.init ^ |
@@ -0,0 +1,85 @@ +#! /bin/sh +# Copyright (c) 2007 Novell Inc / SUSE Linux AG, Nuernberg, Germany. +# All rights reserved. +# +# Author: Peter Poeml <poeml@suse.de> +# +### BEGIN INIT INFO +# Provides: mysql-proxy +# Required-Start: $local_fs $remote_fs $network +# Should-Start: $named $time amavis +# Required-Stop: $local_fs $remote_fs $network +# Should-Stop: $named $time +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: MySQL Proxy +# Description: Start the MySQL Proxy +### END INIT INFO + +if [ -s /etc/sysconfig/mysql-proxy ]; then + + . /etc/sysconfig/mysql-proxy +fi + +: ${MYSQL_PROXY_BIN:=/usr/bin/mysql-proxy} +: ${MYSQL_PROXY_PID:=/var/run/mysql-proxy/mysql-proxy.pid} +if [ $MYSQL_PROXY_PID = /var/run/mysql-proxy.pid ]; then + # old path. Not writable by mysql-proxy user though. + echo "Your /etc/sysconfig/mysql-proxy still references /var/run/mysql-proxy.pid. Please update it to use /var/run/mysql-proxy/mysql-proxy.pid. " >&2 + MYSQL_PROXY_PID=/var/run/mysql-proxy/mysql-proxy.pid +fi + +: ${MYSQL_PROXY_LUA_PATH:=/usr/share/mysql-proxy/?.lua} +export LUA_PATH="$MYSQL_PROXY_LUA_PATH" + +. /etc/rc.status +rc_reset + +case "$1" in + start) + echo -n "Starting service MySQL Proxy" + startproc -u mysql-proxy -g mysql-proxy -p $MYSQL_PROXY_PID $MYSQL_PROXY_BIN --daemon --pid-file $MYSQL_PROXY_PID $MYSQL_PROXY_ARGS + rc_status -v + ;; + stop) + echo -n "Shutting down service MySQL Proxy" + killproc -p $MYSQL_PROXY_PID -TERM $MYSQL_PROXY_BIN + rc_status -v + ;; + try-restart) + ## Do a restart only if the service was active before. + ## Note: try-restart is now part of LSB (as of 1.9). + ## RH has a similar command named condrestart. + $0 status + if test $? = 0; then + $0 restart + else + rc_reset # Not running is not a failure. + fi + # Remember status and be quiet + rc_status + ;; + restart) + $0 stop + $0 start + rc_status + ;; + reload|force-reload) + echo -n "Reload service MySQL Proxy" + kill -HUP `cat $MYSQL_PROXY_PID* 2>/dev/null` 2> /dev/null || true + rc_status -v + ;; + status) + echo -n "Checking for service MySQL Proxy: " + checkproc -p $MYSQL_PROXY_PID $MYSQL_PROXY_BIN + rc_status -v + ;; + probe) + test /etc/sysconfig/mysql-proxy -nt $MYSQL_PROXY_PID \ + && echo reload + ;; + *) + echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" + exit 1 +esac +rc_exit | ||
[+] | Added | mysql-proxy.sysconfig ^ |
@@ -0,0 +1,25 @@ +## Path: Network/mysql-proxy +## Description: MySQl Proxy configuration + +## Type: string +## Default: "--daemon" +## ServiceRestart: mysql-proxy +# +# Command line arguments to hand over to mysql-proxy +# Normally: --daemon (run as background daemon) +# +MYSQL_PROXY_ARGS="--plugin-dir=/usr/%LIB%/mysql-proxy/plugins --proxy-lua-script /usr/share/doc/packages/mysql-proxy/examples/tutorial-basic.lua" + +## Type: string +## Default: "/var/run/mysql-proxy.pid" +# +# Location of pid file +# +MYSQL_PROXY_PID="/var/run/mysql-proxy/mysql-proxy.pid" + +## Type: string +## Default: "/usr/%LIB%/mysql-proxy/lua" +# +# Location of lua scripts +# +MYSQL_PROXY_LUA_PATH="/usr/%LIB%/mysql-proxy/lua" |