summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorobache <obache@pkgsrc.org>2013-03-13 03:31:40 +0000
committerobache <obache@pkgsrc.org>2013-03-13 03:31:40 +0000
commit4b6a22df0b5ed594a4412eba557974a93be00641 (patch)
treeca44a6699e2fc306350af6676bf33f4e809f7585 /security
parentf588d514786e51688110faca34426275e70cc376 (diff)
downloadpkgsrc-4b6a22df0b5ed594a4412eba557974a93be00641.tar.gz
Convert SASL_DBTYPE variable to option framework, and add gdbm support.
Fixes db name extension in DEINSTALL script for other than ndbm. Bump PKGREVISION.
Diffstat (limited to 'security')
-rw-r--r--security/cyrus-sasl/DEINSTALL4
-rw-r--r--security/cyrus-sasl/Makefile20
-rw-r--r--security/cyrus-sasl/options.mk41
3 files changed, 46 insertions, 19 deletions
diff --git a/security/cyrus-sasl/DEINSTALL b/security/cyrus-sasl/DEINSTALL
index 2c96993c6ee..3cc3896e10d 100644
--- a/security/cyrus-sasl/DEINSTALL
+++ b/security/cyrus-sasl/DEINSTALL
@@ -1,8 +1,8 @@
#!/bin/sh
#
-# $NetBSD: DEINSTALL,v 1.9 2006/04/18 17:41:30 jlam Exp $
+# $NetBSD: DEINSTALL,v 1.10 2013/03/13 03:31:40 obache Exp $
-SASLDB=@PKG_SYSCONFDIR@/sasldb.db
+SASLDB=@PKG_SYSCONFDIR@/sasldb@DBEXT@
case ${STAGE} in
POST-DEINSTALL)
diff --git a/security/cyrus-sasl/Makefile b/security/cyrus-sasl/Makefile
index fc3bb2bde93..f868c649ca6 100644
--- a/security/cyrus-sasl/Makefile
+++ b/security/cyrus-sasl/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.66 2012/12/20 22:52:37 joerg Exp $
+# $NetBSD: Makefile,v 1.67 2013/03/13 03:31:40 obache Exp $
-PKGREVISION= 1
+PKGREVISION= 2
SVR4_PKGNAME= csasl
COMMENT= Simple Authentication and Security Layer
@@ -8,21 +8,7 @@ COMMENT= Simple Authentication and Security Layer
CPPFLAGS+= -DPIC -fPIC
-.if exists(/usr/include/ndbm.h) && ${OPSYS} != "Linux"
-SASL_DBTYPE?= ndbm
-.else
-SASL_DBTYPE?= berkeley
-.endif
-BUILD_DEFS+= SASL_DBTYPE
-
-.if ${SASL_DBTYPE} == "berkeley"
-BDB_ACCEPTED= db3 db4 db5
-. include "../../mk/bdb.buildlink3.mk"
-CONFIGURE_ENV+= with_bdb=${BDB_TYPE}
-.endif
-
-CONFIGURE_ARGS+= --with-dblib=${SASL_DBTYPE:Q}
-CONFIGURE_ARGS+= --with-dbpath=${PKG_SYSCONFDIR}/sasldb
+.include "options.mk"
BUILD_DEFS+= VARBASE
diff --git a/security/cyrus-sasl/options.mk b/security/cyrus-sasl/options.mk
new file mode 100644
index 00000000000..0c7ff5195ad
--- /dev/null
+++ b/security/cyrus-sasl/options.mk
@@ -0,0 +1,41 @@
+# $NetBSD: options.mk,v 1.1 2013/03/13 03:31:40 obache Exp $
+#
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.cyrus-sasl
+PKG_OPTIONS_REQUIRED_GROUPS= database
+PKG_OPTIONS_GROUP.database= ndbm bdb gdbm
+
+.if defined(SASL_DBTYPE)
+PKG_OPTIONS_DEPRECATED_WARNINGS+= "Deprecated SASL_DBTYPE variable used, use ${PKG_OPTIONS_VAR:Q} instead (${PKG_OPTIONS_GROUP.database:ts,:Q})."
+. if !empty(SASL_DBTYPE:Mndbm)
+PKG_SUGGESTED_OPTIONS+= ndbm
+. elif !empty(SASL_DBTYPE:Mberkeley)
+PKG_SUGGESTED_OPTIONS+= bdb
+. else
+PKG_FAIL_REASON+= "Unknown SASL_DBTYPE: ${SASL_DBTYPE:Q}"
+. endif
+.elif exists(/usr/include/ndbm.h) && ${OPSYS} != "Linux"
+PKG_SUGGESTED_OPTIONS+= ndbm
+.else
+PKG_SUGGESTED_OPTIONS+= bdb
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mndbm)
+SASL_DBTYPE= ndbm
+FILES_SUBST+= DBEXT=.db
+.elif !empty(PKG_OPTIONS:Mbdb)
+SASL_DBTYPE= berkeley
+FILES_SUBST+= DBEXT=
+BDB_ACCEPTED= db3 db4 db5
+. include "../../mk/bdb.buildlink3.mk"
+CONFIGURE_ENV+= with_bdb=${BDB_TYPE}
+.elif !empty(PKG_OPTIONS:Mgdbm)
+SASL_DBTYPE= gdbm
+FILES_SUBST+= DBEXT=
+. include "../../databases/gdbm/buildlink3.mk"
+.endif
+
+CONFIGURE_ARGS+= --with-dblib=${SASL_DBTYPE:Q}
+CONFIGURE_ARGS+= --with-dbpath=${PKG_SYSCONFDIR}/sasldb