Subject: Re: Build proftpd from pkgsrc w/mysql support?
To: None <netbsd-users@netbsd.org, eric@fox.phoenix.az.us>
From: J.Lorec <julien.lorec@polytech.univ-nantes.fr>
List: netbsd-users
Date: 09/14/2004 17:43:00
hi;

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(PROFTPD_USE_MYSQL) && ${PROFTPD_USE_MYSQL} == "YES"
.if defined(MODULES) && !empty(MODULES)
MODULES:=       ${MODULES}:mod_sql:mod_sql_mysql
.elseif
MODULES:=       mod_sql:mod_sql_mysql
.endif
DEPENDS+=       mysql-client-[0-9]*:../../databases/mysql-client
CFLAGS+=               -I${PREFIX}/include/mysql
LDFLAGS+=              -L${PREFIX}/lib/mysql -Wl,-R${PREFIX}/lib/mysql
.if defined(PROFTPD_USE_QUOTATAB) && ${PROFTPD_USE_QUOTATAB} == "YES"
MODULES:=      ${MODULES}:mod_quotatab:mod_quotatab_sql
.endif
.endif

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
.endfor

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

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).


-- 
sincèrement,
best regards,

J.Lorec
<j_AT_bionantes.com>
[clef PGP sur demande]