1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-21 20:38:45 +00:00

- Use OPTIONS, add more options

- Provide RCng script
- Tweaks

PR:		ports/78659
Submitted by:	Boris Kovalenko <boris@tagnet.ru>
Approved by:	Chris Elsworth <chris@shagged.org> (maintainer)
This commit is contained in:
Pav Lucistnik 2005-03-11 22:08:12 +00:00
parent 193131fbb6
commit f7d3313e01
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=130947
4 changed files with 70 additions and 69 deletions

View File

@ -12,7 +12,7 @@ CATEGORIES= mail
MASTER_SITES= http://www.ex-parrot.com/~chris/tpop3d/
MAINTAINER= chris@shagged.org
COMMENT= Virtual-domain capable POP3 server supporting MySQL auth
COMMENT= Virtual-domain capable POP3 server supporting MySQL,PgSQL etc auth
USE_OPENSSL= yes
USE_REINPLACE= yes
@ -23,37 +23,58 @@ CONFIGURE_ARGS= --enable-auth-other \
--with-mailspool-directory=/var/mail
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
OPTIONS= MYSQL "Use MySQL authentication" off \
PGSQL "Use PgSQL authentication" off \
LDAP "Use LDAP authentication" off \
PERLAUTH "Use Perl authentication" off \
FLATAUTH "Enable /etc/passwd-style authentication" off \
MAILDIR "Compile Maildir support" on
# MySQL authentication
.if !defined(WITHOUT_MYSQL)
.if defined(WITH_MYSQL) && !defined(WITHOUT_MYSQL)
USE_MYSQL= yes
DEFAULT_MYSQL_VER= 41
CONFIGURE_ARGS+= --enable-auth-mysql \
--with-mysql-lib-dir=${LOCALBASE}/lib/mysql \
--with-mysql-include-dir=${LOCALBASE}/include/mysql
.endif
.if defined(WITH_LDAP)
.if defined(WITH_PGSQL) && !defined(WITHOUT_PGSQL)
USE_PGSQL= yes
DEFAULT_PGSQL_VER= 80
CONFIGURE_ARGS+= --enable-auth-pgsql \
--with-pgsql-lib-dir=${LOCALBASE}/lib \
--with-pgsql-include-dir=${LOCALBASE}/include
.endif
.if defined(WITH_LDAP) && !defined(WITHOUT_LDAP)
LIB_DEPENDS+= ldap-2.2:${PORTSDIR}/net/openldap22-client
CONFIGURE_ARGS+= --enable-auth-ldap --with-openldap-root=${LOCALBASE}
.endif
# Perl authentication
.if defined(WITH_PERLAUTH)
.if defined(WITH_PERLAUTH) && !defined(WITHOUT_PERLAUTH)
USE_PERL5= yes
CONFIGURE_ARGS+= --enable-auth-perl
.endif
.if defined(WITH_FLATAUTH) && !defined(WITHOUT_FLATAUTH)
CONFIGURE_ARGS+= --enable-auth-flatfile
.endif
.if !defined(WITHOUT_MAILDIR)
CONFIGURE_ARGS+= --enable-mbox-maildir
.endif
SAMPLE_RCD= tpop3d.sh.sample
STARTUP_SCRIPT= ${PREFIX}/etc/rc.d/${SAMPLE_RCD}
USE_RC_SUBR= tpop3d.sh
DEFAULT_CONFIG= ${PREFIX}/etc/tpop3d.conf.dist
MAN5= tpop3d.conf.5
MAN8= tpop3d.8
DOCS= CHANGES CREDITS FAQ HACKING INSTALL PORTABILITY \
.if !defined(NOPORTDOCS)
PORTDOCS= CHANGES CREDITS FAQ HACKING INSTALL PORTABILITY \
README README.POP-before-SMTP README.auth_mysql TODO
.endif
post-patch:
@${REINPLACE_CMD} 's,^CFLAGS =, CFLAGS = \@CFLAGS\@,' \
@ -63,17 +84,13 @@ post-patch:
post-install:
${INSTALL_SCRIPT} ${FILESDIR}/tpop3d.conf.dist ${DEFAULT_CONFIG}
@if [ ! -f ${STARTUP_SCRIPT} ]; then \
${INSTALL_SCRIPT} ${FILESDIR}/${SAMPLE_RCD} \
${STARTUP_SCRIPT} ; \
fi
@if [ ! -f ${PREFIX}/etc/tpop3d.conf ]; then \
${INSTALL_SCRIPT} ${FILESDIR}/tpop3d.conf.dist \
${PREFIX}/etc/tpop3d.conf ; \
fi
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
.endif
.include <bsd.port.mk>

View File

@ -0,0 +1,41 @@
#!/bin/sh
#
# PROVIDE: tpop3d
# BEFORE: LOGIN
# KEYWORD: FreeBSD
#
# Add the following line to /etc/rc.conf to enable tpop3d:
#tpop3d_enable="YES"
#
# You may also wish to use the following variables to fine-tune startup:
#tpop3d_flags="..."
#
. %%RC_SUBR%%
name="tpop3d"
rcvar=`set_rcvar`
stop_postcmd=stop_postcmd
stop_postcmd()
{
rm -f $pidfile
}
# set defaults
tpop3d_enable=${tpop3d_enable:-"NO"}
tpop3d_flags=${tpop3d_flags:-""}
load_rc_config $name
command=%%PREFIX%%/sbin/tpop3d
required_files=%%PREFIX%%/tpop3d.conf
pidfile=/var/run/tpop3d.pid
tpop3d_flags="${tpop3d_flags} -f ${required_files} -p ${pidfile}"
run_rc_command "$1"

View File

@ -1,45 +0,0 @@
#!/bin/sh
#
# tpop3d:
# Init script for starting/stopping tpop3d.
#
# Copyright (c) 2001 Chris Lightfoot. All rights reserved.
# Portability enhanced by Chris Elsworth, July 2001
#
# $FreeBSD$
#
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 1
fi
DAEMON=$PREFIX/sbin/tpop3d
[ -f $DAEMON ] || exit 0
# See how we were called.
case "$1" in
start)
# Start daemons.
$DAEMON -f $PREFIX/etc/tpop3d.conf -p /var/run/tpop3d.pid \
&& echo -n " tpop3d"
;;
stop)
# Stop daemons.
[ -r /var/run/tpop3d.pid ] && kill `cat /var/run/tpop3d.pid` \
&& echo -n " tpop3d"
;;
restart)
$0 stop
$0 start
;;
reload)
[ -r /var/run/tpop3d.pid ] && kill -HUP `cat /var/run/tpop3d.pid`
;;
*)
echo "Usage: `basename $0` {start|stop|restart|reload}"
exit 1
esac
exit 0

View File

@ -1,17 +1,5 @@
@comment $FreeBSD$
sbin/tpop3d
etc/rc.d/tpop3d.sh.sample
@unexec if cmp -s %D/etc/tpop3d.conf.dist %D/etc/tpop3d.conf; then rm -f %D/etc/tpop3d.conf; fi
etc/tpop3d.conf.dist
@exec if [ ! -f %D/etc/tpop3d.conf ]; then cp %D/etc/%f %D/etc/tpop3d.conf; fi
%%PORTDOCS%%%%DOCSDIR%%/CHANGES
%%PORTDOCS%%%%DOCSDIR%%/CREDITS
%%PORTDOCS%%%%DOCSDIR%%/FAQ
%%PORTDOCS%%%%DOCSDIR%%/HACKING
%%PORTDOCS%%%%DOCSDIR%%/INSTALL
%%PORTDOCS%%%%DOCSDIR%%/PORTABILITY
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%DOCSDIR%%/README.POP-before-SMTP
%%PORTDOCS%%%%DOCSDIR%%/README.auth_mysql
%%PORTDOCS%%%%DOCSDIR%%/TODO
%%PORTDOCS%%@dirrm %%DOCSDIR%%