From owner-freebsd-ports@FreeBSD.ORG Sat Dec 17 02:47:31 2005 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 14FF616A41F for ; Sat, 17 Dec 2005 02:47:31 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mail2.fluidhosting.com [204.14.90.12]) by mx1.FreeBSD.org (Postfix) with SMTP id 9955243D5E for ; Sat, 17 Dec 2005 02:47:30 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: (qmail 70891 invoked by uid 399); 17 Dec 2005 02:47:26 -0000 Received: from localhost (HELO ?192.168.0.3?) (dougb@dougbarton.us@127.0.0.1) by localhost with SMTP; 17 Dec 2005 02:47:26 -0000 Message-ID: <43A37C3D.1060700@FreeBSD.org> Date: Fri, 16 Dec 2005 18:47:25 -0800 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 1.5 (X11/20051206) MIME-Version: 1.0 To: freebsd-ports@freebsd.org Content-Type: multipart/mixed; boundary="------------060008070703090908030604" Subject: Proposed patch to update misc/compat5x to rc.d-style boot script X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Dec 2005 02:47:31 -0000 This is a multi-part message in MIME format. --------------060008070703090908030604 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Howdy, In going through the list of ports that need updating to rc.d-style boot scripts I came across compat5x, which is a port that I actually use, and has no maintainer. So, I thought I'd put some work into this. Attached is a proposed patch that would convert this to rc.d style, and uses the infrastructure in both rc.d and bsd.port.mk to make the script as simple as possible. If no one has any objection, I'll commit this change this weekend, and work on a similar change for compat4x. Of course, if anyone has better ideas, that's welcome too. :) BTW, I purposely omitted any possible BEFORE lines, as I think in this case it would be much better for any ports that need compat5x to REQUIRE it instead. Doug -- This .signature sanitized for your protection --------------060008070703090908030604 Content-Type: text/plain; name="compat5x.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="compat5x.diff" Index: Makefile =================================================================== RCS file: /usr/local/ncvs/ports/misc/compat5x/Makefile,v retrieving revision 1.3 diff -u -r1.3 Makefile --- Makefile 25 Oct 2005 12:34:10 -0000 1.3 +++ Makefile 17 Dec 2005 02:16:34 -0000 @@ -28,7 +28,7 @@ LDCONFIG_DIRS= %%PREFIX%%/lib/compat TARGET_DIR= ${PREFIX}/lib/compat TARGET32_DIR= ${PREFIX}/lib32/compat -RCSCRIPT= ${WRKDIR}/000.compat5x.sh +USE_RC_SUBR= ${PORTNAME}.sh .include @@ -40,6 +40,8 @@ RUN_DEPENDS= ${LOCALBASE}/share/compat/locale/UTF-8/LC_CTYPE:${PORTSDIR}/misc/localedata .endif +SUB_LIST+= LDCONFIG="${LDCONFIG}" + .if ${ARCH} == alpha PLIST_SUB+= ALPHA="" .else @@ -48,8 +50,10 @@ .if ${ARCH} == amd64 PLIST_SUB+= AMD64="" PLIST_SUB+= LDCONFIG_LIB32="${LDCONFIG} -32" +SUB_LIST+= AMD64="" TARGET32_DIR="${TARGET32_DIR}" .else PLIST_SUB+= AMD64="@comment " +SUB_LIST+= AMD64="@comment " .endif .if ${ARCH} == i386 PLIST_SUB+= I386="" @@ -62,12 +66,7 @@ PLIST_SUB+= SPARC64="@comment " .endif -do-build: - ${ECHO_CMD} '#!/bin/sh' > ${RCSCRIPT} - ${ECHO_CMD} '${LDCONFIG} -m ${LDCONFIG_RUNLIST}' >> ${RCSCRIPT} -.if ${ARCH} == amd64 - ${ECHO_CMD} '${LDCONFIG} -32 -m ${TARGET32_DIR}' >> ${RCSCRIPT} -.endif +NO_BUILD= yes do-install: ${MKDIR} ${TARGET_DIR} @@ -77,6 +76,5 @@ (cd ${WRKSRC}/lib32 && ${INSTALL_DATA} *.so.* ${TARGET32_DIR}) ${LDCONFIG} -32 -m ${TARGET32_DIR} .endif - ${INSTALL_SCRIPT} ${RCSCRIPT} ${PREFIX}/etc/rc.d/ .include Index: pkg-plist =================================================================== RCS file: /usr/local/ncvs/ports/misc/compat5x/pkg-plist,v retrieving revision 1.2 diff -u -r1.2 pkg-plist --- pkg-plist 6 Oct 2005 23:18:00 -0000 1.2 +++ pkg-plist 17 Dec 2005 02:11:44 -0000 @@ -1,4 +1,3 @@ -etc/rc.d/000.compat5x.sh lib/compat/libalias.so.4 lib/compat/libarchive.so.1 lib/compat/libasn1.so.7 Index: files/compat5x.sh.in =================================================================== RCS file: files/compat5x.sh.in diff -N files/compat5x.sh.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/compat5x.sh.in 17 Dec 2005 02:14:40 -0000 @@ -0,0 +1,27 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: compat5x +# REQUIRE: mountcritremote +# +# Add the following to /etc/rc.conf[.local] to enable this service +# +# compat5x_enable="YES" +# + +. %%RC_SUBR%% + +name=compat5x +rcvar=`set_rcvar` + +command=%%LDCONFIG%% +command_args='-m %%PREFIX%%/lib/compat' +%%AMD64%% +%%AMD64%%start_postcmd=${name}_poststart +%%AMD64%%compat5x_poststart () { +%%AMD64%% %%LDCONFIG%% -32 -m %%TARGET32_DIR%% +%%AMD64%%} + +load_rc_config ${name} +run_rc_command "$1" --------------060008070703090908030604--