summaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2006-01-14 17:08:46 +0000
committerpav <pav@FreeBSD.org>2006-01-14 17:08:46 +0000
commitf8b2a97eba005682683cb671183bcd4d75724f65 (patch)
tree0016a9d6c04cc926010862b3bb6b6590529ebf61 /mail
parentbfcd0cfbaf63d469f76b8df9395cb1822d9a7fe0 (diff)
downloadFreeBSD-ports-f8b2a97eba005682683cb671183bcd4d75724f65.zip
FreeBSD-ports-f8b2a97eba005682683cb671183bcd4d75724f65.tar.gz
- Improve rc script handling
- Modernize pkg-message PR: ports/91780 Submitted by: Ion-Mihai "IOnut" Tetcu <itetcu@people.tecnik93.com>
Diffstat (limited to 'mail')
-rw-r--r--mail/gld/Makefile36
-rw-r--r--mail/gld/files/gld.in30
-rw-r--r--mail/gld/files/gld.sh.tmpl31
-rw-r--r--mail/gld/files/pkg-message.in (renamed from mail/gld/files/MESSAGE.tmpl)4
-rw-r--r--mail/gld/pkg-plist1
5 files changed, 53 insertions, 49 deletions
diff --git a/mail/gld/Makefile b/mail/gld/Makefile
index 835f3d9..54425fe 100644
--- a/mail/gld/Makefile
+++ b/mail/gld/Makefile
@@ -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 @@ MAINTAINER= ports@FreeBSD.org
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 @@ BROKEN= "Cannot compile with both MySQL and PgSQL support"
.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 @@ post-patch:
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 tables.mysql tables.pgsql
diff --git a/mail/gld/files/gld.in b/mail/gld/files/gld.in
new file mode 100644
index 0000000..cfe510d
--- /dev/null
+++ b/mail/gld/files/gld.in
@@ -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 --git a/mail/gld/files/gld.sh.tmpl b/mail/gld/files/gld.sh.tmpl
deleted file mode 100644
index 30e51ef..0000000
--- a/mail/gld/files/gld.sh.tmpl
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-
-# 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 --git a/mail/gld/files/MESSAGE.tmpl b/mail/gld/files/pkg-message.in
index a87ba03..18dd2b9 100644
--- a/mail/gld/files/MESSAGE.tmpl
+++ b/mail/gld/files/pkg-message.in
@@ -1,8 +1,8 @@
*******************************************************************
- Enable gld in /etc/rc.conf with the following line:
+ Enable gld in /etc/rc.conf[.local] with the following line:
- gld_enable="YES"
+ gld_enable="YES"
To complete the installation, you need to create the neccesary
database and tables. An example configuration file is available in
diff --git a/mail/gld/pkg-plist b/mail/gld/pkg-plist
index 65a2f23..c905c62 100644
--- a/mail/gld/pkg-plist
+++ b/mail/gld/pkg-plist
@@ -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
OpenPOWER on IntegriCloud