Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Jan 2006 03:17:11 +0200
From:      "Ion-Mihai "IOnut" Tetcu" <itetcu@people.tecnik93.com>
To:        "FreeBSD gnats submit" <FreeBSD-gnats-submit@FreeBSD.org>
Subject:   ports/91697: [PATCH] databases/mysql50-client: convert start-up script to rc.d
Message-ID:  <1137028631.61447@it.buh.tecnik93.com>
Resent-Message-ID: <200601120120.k0C1K4Q0055005@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         91697
>Category:       ports
>Synopsis:       [PATCH] databases/mysql50-client: convert start-up script to rc.d
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 12 01:20:04 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Ion-Mihai "IOnut" Tetcu
>Release:        FreeBSD 6.0-STABLE i386
>Organization:
Tecnik'93 
>Environment:


System: FreeBSD 6.0-STABLE #5: Fri Dec 30 19:34:15 EET 2005


>Description:


Convert 000.mysql-client,sh to rc.d; this way ports dependign on it and it's libs will be able to run at start-up.
Remove the old files/mysql-client.sh and add 000.mysql-client.sh to be able to USE_RC_SUBR in Makefile.
Follow dougb@ and bump PORTREVISION to help users.

TinderFoxy'ed on:	6-STABLE.
Inspired from:	misc/compat5x


>How-To-Repeat:





>Fix:


--- mysql50-server.diff begins here ---
diff -urN mysql50-server.cvs/Makefile mysql50-server/Makefile
--- mysql50-server.cvs/Makefile	Fri Dec 23 09:19:29 2005
+++ mysql50-server/Makefile	Thu Jan 12 02:46:14 2006
@@ -24,6 +24,10 @@
 USE_RC_SUBR=	mysql-server.sh
 .endif
 
+.if ${PKGNAMESUFFIX} == "-client"
+USE_RC_SUBR=	000.mysql-client.sh
+.endif
+
 CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
 CONFIGURE_ARGS=	--localstatedir=/var/db/mysql \
 		--without-debug \
@@ -196,10 +200,6 @@
 .if defined(WITH_PROC_SCOPE_PTH)
 	@${REINPLACE_CMD} -e "s|PTHREAD_SCOPE_SYSTEM|PTHREAD_SCOPE_PROCESS|g" ${WRKSRC}/tools/mysqlmanager.c
 .endif
-
-post-install:
-	@${SED} "s|%%PREFIX%%|${PREFIX}|g" < ${FILESDIR}/mysql-client.sh > ${PREFIX}/etc/rc.d/000.mysql-client.sh
-	@${CHMOD} 750 ${PREFIX}/etc/rc.d/000.mysql-client.sh
 
 .else
 # MySQL-Scripts part
diff -urN mysql50-server.cvs/files/000.mysql-client.sh.in mysql50-server/files/000.mysql-client.sh.in
--- mysql50-server.cvs/files/000.mysql-client.sh.in	Thu Jan  1 02:00:00 1970
+++ mysql50-server/files/000.mysql-client.sh.in	Thu Jan 12 02:46:16 2006
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: mysql_client
+# REQUIRE: ldconfig
+#
+# Add the following to /etc/rc.conf[.local] to enable this service
+#
+# mysql_client_enable="YES"
+#
+
+. %%RC_SUBR%%
+
+name=mysql_client
+rcvar=`set_rcvar`
+
+command=%%LDCONFIG%%
+command_args='-m %%PREFIX%%/lib/mysql'
+
+load_rc_config ${name}
+run_rc_command "$1"
diff -urN mysql50-server.cvs/files/mysql-client.sh mysql50-server/files/mysql-client.sh
--- mysql50-server.cvs/files/mysql-client.sh	Thu Nov 16 12:29:06 2000
+++ mysql50-server/files/mysql-client.sh	Thu Jan  1 02:00:00 1970
@@ -1,15 +0,0 @@
-#!/bin/sh
-
-case "$1" in
-	start)
-		/sbin/ldconfig -m %%PREFIX%%/lib/mysql
-		;;
-	stop)
-		;;
-	*)
-		echo ""
-		echo "Usage: `basename $0` { start | stop }"
-		echo ""
-		exit 64
-		;;
-esac
diff -urN mysql50-server.cvs/pkg-plist.client mysql50-server/pkg-plist.client
--- mysql50-server.cvs/pkg-plist.client	Sun Aug 28 21:46:42 2005
+++ mysql50-server/pkg-plist.client	Thu Jan 12 02:51:17 2006
@@ -11,7 +11,6 @@
 bin/mysqltest
 bin/mysqltestmanager-pwgen
 bin/mysqltestmanagerc
-etc/rc.d/000.mysql-client.sh
 include/mysql/errmsg.h
 include/mysql/keycache.h
 include/mysql/m_ctype.h
--- mysql50-server.diff ends here ---
--- mysql50-client.diff begins here ---
diff -urN mysql50-client.cvs/Makefile mysql50-client/Makefile
--- mysql50-client.cvs/Makefile	Thu Jan 12 02:54:59 2006
+++ mysql50-client/Makefile	Thu Jan 12 02:57:18 2006
@@ -6,6 +6,7 @@
 #
 
 PORTNAME=	mysql
+PORTREVISION=	1
 PKGNAMESUFFIX=	-client
 
 COMMENT=	Multithreaded SQL database (client)
--- mysql50-client.diff ends here ---



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1137028631.61447>