Subject: Re: Proftpd + MYSQL support
To: Mark Saad <nonesuch@bad-apples.org>
From: Geert Hendrickx <ghen@telenet.be>
List: tech-pkg
Date: 11/23/2005 10:25:17
--SLDf9lqlvOQaIe6s
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Wed, Nov 23, 2005 at 10:03:04AM +0100, Geert Hendrickx wrote:
> On Tue, Nov 22, 2005 at 05:49:49PM -0500, Mark Saad wrote:
> > <snip>
> > ## .if defined(PROFTPD_USE_MYSQL) && ${PROFTPD_USE_MYSQL} == "YES"
> > ##   MODULES:=  ${MODULES}:mod_sql:mod_sql_mysql
> > ##   DEPENDS+=  mysql-client-[0-9]*:../../databases/mysql-client
> > ## .endif
> > </snip>
> 
> > source file './modules/.c' cannot be found -- aborting
> 
> It checks for /modules/.c because MODULES contains spaces/tabs.  Try to
> remove the <tab> after MODULES:= and it should work.  

This won't help.  The problem is that MODULES begins with a colon (:).  In
attachment you find a patch that fixes this problem, and properly
OPTION'izes these modules as well.  

The trick is that I use += instead of :=, and replaces the spaces by colons
on the last line.  

	Geert

--SLDf9lqlvOQaIe6s
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="proftpd.diff"

Index: options.mk
===================================================================
RCS file: /pub/NetBSD-CVS/pkgsrc/net/proftpd/options.mk,v
retrieving revision 1.1
diff -u -r1.1 options.mk
--- options.mk	22 Jun 2005 22:43:37 -0000	1.1
+++ options.mk	23 Nov 2005 09:21:57 -0000
@@ -1,8 +1,13 @@
 # $NetBSD: options.mk,v 1.1 2005/06/22 22:43:37 salo Exp $
 #
 
-PKG_OPTIONS_VAR       = PKG_OPTIONS.proftpd
-PKG_SUPPORTED_OPTIONS = pam wrap quota
+PKG_OPTIONS_VAR=	PKG_OPTIONS.proftpd
+PKG_SUPPORTED_OPTIONS=	pam wrap quota ldap mysql pgsql readme
+
+PKG_OPTIONS_LEGACY_VARS+=	PROFTPD_USE_LDAP:ldap
+PKG_OPTIONS_LEGACY_VARS+=	PROFTPD_USE_MYSQL:mysql
+PKG_OPTIONS_LEGACY_VARS+=	PROFTPD_USE_POSTGRES:pgsql
+PKG_OPTIONS_LEGACY_VARS+=	PROFTPD_USE_README:readme
 
 .include "../../mk/bsd.options.mk"
 
@@ -11,8 +16,6 @@
 .include "../../mk/pam.buildlink3.mk"
 .endif
 
-MODULES=#defined
-
 .if !empty(PKG_OPTIONS:Mwrap)
 MODULES:=${MODULES}mod_wrap
 .endif
@@ -21,25 +24,25 @@
 MODULES:=${MODULES}mod_quota
 .endif
 
-## .if defined(PROFTPD_USE_LDAP) && ${PROFTPD_USE_LDAP} == "YES"
-## MODULES:=	${MODULES}:mod_ldap
-## DEPENDS+=	openldap-[0-9]*:../../databases/openldap
-## .endif
-##
-## .if defined(PROFTPD_USE_MYSQL) && ${PROFTPD_USE_MYSQL} == "YES"
-## MODULES:=	${MODULES}:mod_sql:mod_sql_mysql
-## DEPENDS+=	mysql-client-[0-9]*:../../databases/mysql-client
-## .endif
-##
-## .if defined(PROFTPD_USE_POSTGRES) && ${PROFTPD_USE_POSTGRES} == "YES"
-## MODULES:=	${MODULES}:mod_sql:mod_sql_postgres
-## DEPENDS+=	postgresql-client-[0-9]*:../../databases/postgresql-client
-## .endif
-##
-## .if defined(PROFTPD_USE_README) && ${PROFTPD_USE_README} == "YES"
-## MODULES:=	${MODULES}:mod_readme
-## .endif
+.if !empty(PKG_OPTIONS:Mldap)
+MODULES+=	mod_ldap
+.include "../../databases/openldap/buildlink3.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Mmysql)
+MODULES+=	mod_sql:mod_sql_mysql
+.include "../../mk/mysql.buildlink3.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Mpgsql)
+MODULES+=	mod_sql:mod_sql_postgres
+.include "../../mk/pgsql.buildlink3.mk"
+.endif
+
+.if !empty(PKG_OPTIONS:Mreadme)
+MODULES+=	mod_readme
+.endif
 
-.if !empty(MODULES)
-CONFIGURE_ARGS+=	--with-modules=${MODULES}
+.if defined(MODULES)
+CONFIGURE_ARGS+=	--with-modules=${MODULES:ts:}
 .endif

--SLDf9lqlvOQaIe6s--