Subject: Re: Build proftpd from pkgsrc w/mysql support?
To: None <,>
From: J.Lorec <>
List: netbsd-users
Date: 09/14/2004 17:43:00

Here is a solution I found quite convenient if you do really want to use 
the proftpd source package. It worked with my package system which is 
quite old now (can't remember proftpd version); I don't know if the 
assigned maintainer updated it recently.

First I just did a 'make extract' and then unzip the specific mysql mod 
and quotatab for sql (downloaded from proftpd homepage) in the contrib 
directory where all the others mods stand and created along with the 
freshly unpacked source. Then I added in Makefile something like:

.if defined(MODULES) && !empty(MODULES)
MODULES:=       ${MODULES}:mod_sql:mod_sql_mysql
MODULES:=       mod_sql:mod_sql_mysql
DEPENDS+=       mysql-client-[0-9]*:../../databases/mysql-client
CFLAGS+=               -I${PREFIX}/include/mysql
LDFLAGS+=              -L${PREFIX}/lib/mysql -Wl,-R${PREFIX}/lib/mysql
MODULES:=      ${MODULES}:mod_quotatab:mod_quotatab_sql

Still there are some missing soft links so just put these following 
lines under the 'pre-configure:' part if needed:

if ! [ -e "${WRKSRC}/modules/mod_sql.h" ]; then ${LN} -s 
${WRKSRC}/contrib/mod_sql.h ${WRKSRC}/modules/mod_sql.h; fi
if ! [ -e "${WRKSRC}/modules/mod_quotatab.c" ]; then ${LN} -s 
${WRKSRC}/contrib/mod_quotatab.c ${WRKSRC}/modules/mod_quotatab.c; ${LN} 
-s ${WRKSRC}/contrib/mod_quotatab.h ${WRKSRC}/modules/mod_quotatab.h; 
${LN} -s ${WRKSRC}/contrib/mod_quotatab_sql.c 
${WRKSRC}/modules/mod_quotatab_sql.c; fi

and even for some misc doc here are some more lines to add inside the 
'post-install' section:

.for i in NEWS README README.mod_sql README.modules
         ${INSTALL_DATA} ${WRKSRC}/${i} ${PREFIX}/share/doc/proftpd

Now you just have to build the package with the PROFTPD_USE_MYSQL=YES 

hope it helps; it worked for me a while ago but now I definitely 
switched to vsftpd (even if there is no PAM-less support for sql yet).

NB: this general hack could be extended to almost every proftpd mod (one 
exception is MOD_WRAP which is more difficult to get working under NetBSD).

best regards,

[clef PGP sur demande]