Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jan 2006 04:35:02 +0200
From:      "Ion-Mihai "IOnut" Tetcu" <itetcu@people.tecnik93.com>
To:        "FreeBSD gnats submit" <FreeBSD-gnats-submit@FreeBSD.org>
Subject:   ports/91780: [PATCH] mail/gld: fix USE_RC_SUBR, other fixes
Message-ID:  <1137206102.9901@it.buh.tecnik93.com>
Resent-Message-ID: <200601140240.k0E2eAi8069160@freefall.freebsd.org>

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

>Number:         91780
>Category:       ports
>Synopsis:       [PATCH] mail/gld: fix USE_RC_SUBR, other fixes
>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:   Sat Jan 14 02:40: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:


USE_RC_SUBR= yes --> USE_RC_SUBR= gld:
- files/gld.sh.tmpl deleted and files/gld.in added
- fix rc.d script
- add OPTION to also REQUIRE the selected database server

use pkg-message.in instead of hacking pkg-message:
- files/MESSAGE.tmpl deleted
- files/pkg-message.inv added

LOCALBASE != PREFIX -- fix this also

Bump PORTVERSION to help users with RC upgrade.

TinderFoxy'ed on 4,5,6,7-STABLE


>How-To-Repeat:





>Fix:


--- gld-1.6_1_to_1.6_2.diff begins here ---
diff -urN gld.cvs/Makefile gld/Makefile
--- gld.cvs/Makefile	Sat Jan 14 00:57:05 2006
+++ gld/Makefile	Sat Jan 14 03:50:49 2006
@@ -7,7 +7,7 @@
 
 PORTNAME=	gld
 PORTVERSION=	1.6
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	mail
 MASTER_SITES=	http://www.gasmi.net/down/
 EXTRACT_SUFX=	.tgz
@@ -16,17 +16,14 @@
 COMMENT=	Greylisting daemon for Postfix
 
 USE_REINPLACE=	yes
-USE_RC_SUBR=	yes
+USE_RC_SUBR=	gld
 HAS_CONFIGURE=	yes
 
-PKGMESSAGE=	${WRKDIR}/MESSAGE
+SUB_FILES+=	pkg-message
 
 OPTIONS=	MYSQL   "MySQL support"         on \
-		PGSQL   "PgSQL support"         off
-
-SED_SCRIPT=	-e 's,%%DOCSDIR%%,${DOCSDIR},g' \
-		-e 's,%%PREFIX%%,${PREFIX},g' \
-		-e 's,%%RC_SUBR%%,${RC_SUBR},g'
+		PGSQL   "PgSQL support"         off \
+		LOCAL_DB_SERVER "RUN_DEPEND also on selected DB server" off
 
 .include <bsd.port.pre.mk>
 
@@ -35,13 +32,27 @@
 .endif
 
 .if defined(WITH_MYSQL)
-CONFIGURE_ARGS+=	--with-mysql=${PREFIX}
+CONFIGURE_ARGS+=	--with-mysql=${LOCALBASE}
 USE_MYSQL=	yes
+.	if defined(WITH_LOCAL_DB_SERVER)
+RUN_DEPENDS+=	mysql-server>=0:${PORTSDIR}/databases/mysql${MYSQL_VER}-server
+SUB_LIST+=	MYSQL=mysql
+SUB_LIST+=	PGSQL=
+.	else
+SUB_LIST+=	MYSQL=
+.	endif
 .endif
 
 .if defined(WITH_PGSQL)
-CONFIGURE_ARGS+=	--with-pgsql=${PREFIX}
+CONFIGURE_ARGS+=	--with-pgsql=${LOCALBASE}
 USE_PGSQL=	yes
+.	if defined(WITH_LOCAL_DB_SERVER)
+RUN_DEPENDS+=	postgresql-server>=0:${PORTSDIR}/databases/postgresql${PGSQL_VER}-server
+SUB_LIST+=	PGSQL=postgresql
+SUB_LIST+=	MYSQL=
+.	else
+SUB_LIST+=	PGSQL=
+.	endif
 .endif
 
 post-patch:
@@ -50,17 +61,12 @@
 
 pre-build:
 	${REINPLACE_CMD} -e 's,"/etc/gld.conf","${PREFIX}/etc/gld.conf",' ${WRKSRC}/gld.h
-	for f in gld.sh MESSAGE; do \
-		${SED} ${SED_SCRIPT} < ${FILESDIR}/$${f}.tmpl >> ${WRKDIR}/$${f}; \
-	done
-
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/gld ${PREFIX}/sbin
 	${INSTALL_DATA} ${WRKSRC}/gld.conf ${PREFIX}/etc/gld.conf-dist
 .if !exists(${PREFIX}/etc/gld.conf)
 	${INSTALL_DATA} ${WRKSRC}/gld.conf ${PREFIX}/etc/gld.conf
 .endif
-	${INSTALL_SCRIPT} ${WRKDIR}/gld.sh ${PREFIX}/etc/rc.d
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
 .for FILE in HISTORY LICENCE README table-whitelist.sql tablessql tables.pgsql
diff -urN gld.cvs/files/MESSAGE.tmpl gld/files/MESSAGE.tmpl
--- gld.cvs/files/MESSAGE.tmpl	Sat Jan 14 00:57:05 2006
+++ gld/files/MESSAGE.tmpl	Thu Jan  1 02:00:00 1970
@@ -1,12 +0,0 @@
-
-*******************************************************************
-  Enable gld in /etc/rc.conf with the following line:
-  
-      gld_enable="YES"
-
- To complete the installation, you need to create the neccesary
- database and tables. An example configuration file is available in
- %%PREFIX%%/etc/gld.conf-dist. For more information see the
- documentation in %%DOCSDIR%%/share/doc/gld.
-*******************************************************************
-
diff -urN gld.cvs/files/gld.in gld/files/gld.in
--- gld.cvs/files/gld.in	Thu Jan  1 02:00:00 1970
+++ gld/files/gld.in	Sat Jan 14 03:10:24 2006
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# $FreeBSD$
+# was: $ FreeBSD: ports/mail/gld/files/gld.sh.tmpl,v 1.2 2004/09/01 08:06:24 vs Exp $
+#
+
+# PROVIDE: gld
+# REQUIRE: DAEMON %%MYSQL%% %%PGSQL%%
+# BEFORE: mail postfix
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf[.local] to enable gld:
+#
+# gld_enable="YES"
+#
+
+. %%RC_SUBR%%
+
+name=gld
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+: ${gld_enable-"NO"}
+
+command=%%PREFIX%%/sbin/gld
+required_files=%%PREFIX%%/etc/gld.conf
+
+run_rc_command "$1"
diff -urN gld.cvs/files/gld.sh.tmpl gld/files/gld.sh.tmpl
--- gld.cvs/files/gld.sh.tmpl	Sat Jan 14 00:57:05 2006
+++ gld/files/gld.sh.tmpl	Thu Jan  1 02:00:00 1970
@@ -1,31 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD: ports/mail/gld/files/gld.sh.tmpl,v 1.2 2004/09/01 08:06:24 vs Exp $
-#
-
-# PROVIDE: gld
-# REQUIRE: LOGIN
-# BEFORE: mail
-# KEYWORD: FreeBSD shutdown
-
-#
-# Add the following lines to /etc/rc.conf to enable gld:
-#
-#gld_enable="YES"
-#
-
-. %%RC_SUBR%%
-
-name=gld
-rcvar=`set_rcvar`
-
-command=%%PREFIX%%/sbin/gld
-
-required_files=%%PREFIX%%/etc/gld.conf
-
-# set defaults
-
-gld_enable=${gld_enable:-"NO"}
-
-load_rc_config $name
-run_rc_command "$1"
diff -urN gld.cvs/files/pkg-message.in gld/files/pkg-message.in
--- gld.cvs/files/pkg-message.in	Thu Jan  1 02:00:00 1970
+++ gld/files/pkg-message.in	Sat Jan 14 01:32:24 2006
@@ -0,0 +1,12 @@
+
+*******************************************************************
+  Enable gld in /etc/rc.conf[.local] with the following line:
+  
+  gld_enable="YES"
+
+ To complete the installation, you need to create the neccesary
+ database and tables. An example configuration file is available in
+ %%PREFIX%%/etc/gld.conf-dist. For more information see the
+ documentation in %%DOCSDIR%%/share/doc/gld.
+*******************************************************************
+
diff -urN gld.cvs/pkg-plist gld/pkg-plist
--- gld.cvs/pkg-plist	Sat Jan 14 00:57:05 2006
+++ gld/pkg-plist	Sat Jan 14 00:59:20 2006
@@ -1,7 +1,6 @@
 @unexec if cmp -s %D/etc/gld.conf %D/etc/gld.conf-dist; then rm -f %D/etc/gld.conf; fi
 etc/gld.conf-dist
 @exec [ -f %B/gld.conf ] || cp %B/%f %B/gld.conf
-etc/rc.d/gld.sh
 sbin/gld
 %%PORTDOCS%%%%DOCSDIR%%/HISTORY
 %%PORTDOCS%%%%DOCSDIR%%/LICENCE
--- gld-1.6_1_to_1.6_2.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?1137206102.9901>