1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-19 19:59:43 +00:00

- Stage support (hackish...)

- Rename :: patchfiles [1]
- Merge pkg-req and scripts/pre-install into pkg-install [1]
- Replace tab by space in WWW: line [1]
- Clean up rc script [1]
- Add USE_GCC because clang does not like -freg-struct-return (yet)
- Use USERS and GROUPS [1]
- Drop empty QPOPAUTH_SETUID option
- Fix USE_OPENSSL usage [1]
- Replace knobs by options [1]
- Merge install-conf-file target into post-install target

PR:		ports/185285 [1]
Submitted by:	Takefu <takefu@airport.fm>
Approved by:	portmgr (mostly infastructure fixes)
This commit is contained in:
Rene Ladan 2014-04-04 23:45:06 +00:00
parent fed51a4bc9
commit 31d208c0bd
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=350186
10 changed files with 75 additions and 110 deletions

View File

@ -12,8 +12,8 @@ DISTNAME= ${PORTNAME}${PORTVERSION}
MAINTAINER= bc979@lafn.org
COMMENT= Berkeley POP 3 server (now maintained by Qualcomm)
USE_GCC= any # -freg-struct-return only in GCC and clang-head
USE_AUTOTOOLS= autoconf
USE_OPENSSL= yes
CONFIGURE_ENV= LIBS="-lcrypt -lmd -lutil -L${LOCALBASE}/lib" \
OS_DEFS="-DSETPROCTITLE ${OS_DEFS}"
CONFIGURE_ARGS= --enable-nonauth-file=${POPUSERS_FILE} \
@ -21,28 +21,26 @@ CONFIGURE_ARGS= --enable-nonauth-file=${POPUSERS_FILE} \
--enable-keep-temp-drop
PLIST_SUB= EPOPPASSD=${EPOPPASSD} \
POP_USER=${POP_USER} \
POP_GROUP=${POP_GROUP} \
USERS=${USERS} \
GROUPS=${GROUPS} \
POP_MODE_DIR=${POP_MODE_DIR} \
POP_MODE_CONF=${POP_MODE_CONF} \
QPOPAUTH=${QPOPAUTH}
MAN8= qpopper.8
SUB_FILES= pkg-message
# internal configuration
POP_USER= pop
POP_GROUP= daemon
USERS?= pop
GROUPS?= daemon
POP_MODE_DIR= 0711
POP_MODE_CONF= 0444
POPUSERS_FILE= ${ETCDIR}/popusers
SAMPLE_EXT= .sample
#
PKGDEINSTALL= ${PKGINSTALL}
OPTIONS_DEFINE= APOP_ONLY APOP DOCUMENTATION DRAC FULL_POPD_DEBUG PAM \
POPPASSD QPOPAUTH_SETUID SAMPLE_POPUSERS SHY_ENABLED \
POPPASSD SAMPLE_POPUSERS SHY_ENABLED \
SSL STANDALONE_MODE U_OPTION
APOP_ONLY_DESC= build with APOP authentication only
@ -52,24 +50,21 @@ DRAC_DESC= build with Dynamic Relay Authorization
FULL_POPD_DEBUG_DESC= build with more verbose debugging
PAM_DESC= build with PAM authentication
POPPASSD_DESC= build the poppassd daemon
QPOPAUTH_SETUID_DESC= install qpopauth setuid to pop user
SAMPLE_POPUSERS_DESC= build a default reject file
SHY_ENABLED_DESC= hide qpopper version in POP3 banner
SSL_DESC= build with SSL/TLS support
STANDALONE_MODE_DESC= build qpopper to be run without inetd
U_OPTION_DESC= include support for user .qpopper-options
OPTIONS_DEFAULT= APOP QPOPAUTH_SETUID SSL U_OPTION
OPTIONS_DEFAULT= APOP SSL U_OPTION
NO_STAGE= yes
.include <bsd.port.options.mk>
.if empty(PORT_OPTIONS:MAPOP)
QPOPAUTH= "@comment "
.else
CONFIGURE_ARGS+= --enable-apop=${ETCDIR}/pop.auth \
--with-apopuid=pop
MAN8+= qpopauth.8
--with-popuid=${USERS}
QPOPAUTH= ""
# If WITH_APOP_ONLY variable present in the environment, qpopper builds
# with APOP authentication only.
@ -81,7 +76,7 @@ OS_DEFS+= -DAPOP_ONLY
# Do not install documentation since it is in pdf format and normally
# not used unless user wants it.
.if empty(PORT_OPTIONS:MDOCUMENTATION)
NOPORTDOCS= yes
OPTIONS_UNSET+= DOCS
.endif
# If WITH_DRAC variable present in the environment, qpopper builds
@ -106,8 +101,8 @@ CONFIGURE_ARGS+= --with-pam=pop3
# with poppassd support.
.if ${PORT_OPTIONS:MPOPPASSD}
CONFIGURE_ARGS+= --enable-poppassd
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-password::poppassd.c \
${FILESDIR}/extra-patch-password::auth_user.c
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-password__poppassd.c \
${FILESDIR}/extra-patch-password__auth_user.c
EPOPPASSD= ""
.else
EPOPPASSD= "@comment "
@ -128,6 +123,7 @@ USE_RC_SUBR= ${PORTNAME}
# The default is to build without SSL/TLS support.
.if ${PORT_OPTIONS:MSSL}
USE_OPENSSL= yes
CONFIGURE_ARGS+= --with-openssl=${OPENSSLBASE}
.endif
@ -139,11 +135,11 @@ post-patch:
@${REINPLACE_CMD} -e \
's|\$${sbindir}/sendmail|${LOCALBASE}/sbin/sendmail|g' \
${WRKSRC}/configure.in
.if defined(WITH_POPPASSD)
.if ${PORT_OPTIONS:MPOPPASSD}
@${REINPLACE_CMD} -e 's|/usr/bin/smbpasswd|${LOCALBASE}/bin/smbpasswd|' \
${WRKSRC}/password/poppassd.c
.endif
.if defined(WITHOUT_U_OPTION)
.if empty(PORT_OPTIONS:MU_OPTION)
@${REINPLACE_CMD} -E -e 's|(getopt \(.+)u|\1|' \
${WRKSRC}/popper/main.c
.endif
@ -152,49 +148,41 @@ pre-configure:
@(cd ${WRKSRC}; ${CHMOD} u+w configure*)
do-install:
.if !defined(WITHOUT_APOP)
@${INSTALL_PROGRAM} ${WRKSRC}/popper/popauth ${PREFIX}/bin/qpopauth
# If WITHOUT_QPOPAUTH_SETUID variable present in the environment,
# qpopper does not install qpopauth setuid to pop user so that
# anyone can access the pop.auth database.
.if !defined(WITHOUT_QPOPAUTH_SETUID)
@${CHOWN} pop ${PREFIX}/bin/qpopauth
@${CHMOD} u+s ${PREFIX}/bin/qpopauth
.if ${PORT_OPTIONS:MAPOP}
@${INSTALL_PROGRAM} ${WRKSRC}/popper/popauth ${STAGEDIR}${PREFIX}/bin/qpopauth
@${INSTALL_MAN} ${WRKSRC}/man/popauth.8 ${STAGEDIR}${PREFIX}/man/man8/qpopauth.8
@${LN} -sf ${PREFIX}/bin/qpopauth ${STAGEDIR}${PREFIX}/bin/qapopauth
.endif
@${INSTALL_MAN} ${WRKSRC}/man/popauth.8 ${MANPREFIX}/man/man8/qpopauth.8
@${LN} -sf ${PREFIX}/bin/qpopauth ${PREFIX}/bin/qapopauth
@${INSTALL_PROGRAM} ${WRKSRC}/popper/popper ${STAGEDIR}${PREFIX}/libexec/qpopper
@${INSTALL_MAN} ${WRKSRC}/man/popper.8 ${STAGEDIR}${PREFIX}/man/man8/qpopper.8
.if ${PORT_OPTIONS:MPOPPASSD}
@${INSTALL_PROGRAM} ${WRKSRC}/password/poppassd ${STAGEDIR}${PREFIX}/libexec/qpoppassd
.endif
@${INSTALL_PROGRAM} ${WRKSRC}/popper/popper ${PREFIX}/libexec/qpopper
@${INSTALL_MAN} ${WRKSRC}/man/popper.8 ${MANPREFIX}/man/man8/qpopper.8
.if defined(WITH_POPPASSD)
@${INSTALL_PROGRAM} ${WRKSRC}/password/poppassd ${PREFIX}/libexec/qpoppassd
.if ${PORT_OPTIONS:MDOCS}
@${MKDIR} ${STAGEDIR}${DOCSDIR}
@${INSTALL_DATA} ${WRKSRC}/GUIDE.pdf ${STAGEDIR}${DOCSDIR}
.endif
@${INSTALL} -d -o ${POP_USER} -g ${POP_GROUP} -m ${POP_MODE_DIR} \
${ETCDIR}
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
@${INSTALL_DATA} ${WRKSRC}/GUIDE.pdf ${DOCSDIR}
.endif
post-install: install-conf-file
@${CAT} ${PKGMESSAGE}
# based on original from op port, written by Cyrille Lefevre
# <clefevre@citeweb.net>.
install-conf-file:
post-install:
@if [ ! -f ${CONF_DIR}/${CONF_FILE}${SAMP_SUFX} ]; then \
if [ -f /etc/ftpusers ] && [ -n "${WITH_SAMPLE_POPUSERS}" ]; then \
${INSTALL} -c -o ${POP_USER} -g ${POP_GROUP} -m ${POP_MODE_CONF} \
/etc/ftpusers ${POPUSERS_FILE}${SAMPLE_EXT} ; \
${MKDIR} ${STAGEDIR}${ETCDIR} ; \
if [ -f /etc/ftpusers ] && [ -n "${PORT_OPTIONS:MSAMPLE_POPUSERS}" ]; then \
${INSTALL} -c /etc/ftpusers ${STAGEDIR}${POPUSERS_FILE}${SAMPLE_EXT} ; \
else \
${CP} /dev/null ${POPUSERS_FILE}${SAMPLE_EXT} ; \
${CHOWN} ${POP_USER}:${POP_GROUP} ${POPUSERS_FILE}${SAMPLE_EXT} ; \
${CHMOD} ${POP_MODE_CONF} ${POPUSERS_FILE}${SAMPLE_EXT} ; \
${CP} /dev/null ${STAGEDIR}${POPUSERS_FILE}${SAMPLE_EXT} ; \
fi ; \
fi
@${INSTALL} -c -m 0640 \
${WRKSRC}/samples/qpopper.config ${PREFIX}/etc/qpopper.config${SAMPLE_EXT}
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} \
${PKGINSTALL} ${PKGNAME} POST-INSTALL
.if ${PORT_OPTIONS:MPOPPASSD}
@${ECHO_MSG} ""
@${ECHO_MSG} "==============================================================================="
@${ECHO_MSG} "It adds for myself"
@${ECHO_MSG} "/etc/devfs.conf:"
@${ECHO_MSG} "link /dev/pts/0 pty0"
@${ECHO_MSG} "==============================================================================="
@${ECHO_MSG} ""
.endif
.include <bsd.port.post.mk>

View File

@ -1,10 +1,10 @@
--- password/auth_user.c.orig Fri Mar 14 00:39:42 2003
+++ password/auth_user.c Fri Mar 14 00:40:02 2003
@@ -41,6 +41,7 @@
+#undef SPEC_POP_AUTH
static const char *ERRMSG_PW = "Password mismatch for user \"%s\"";

View File

@ -1,7 +1,7 @@
--- password/poppassd.c.orig Sat May 5 18:50:05 2001
+++ password/poppassd.c Sat May 5 18:52:59 2001
@@ -284,6 +284,8 @@
static char *P1[] =
{
+ "changing local password for *\nold password: ", /* FreeBSD */
@ -10,7 +10,7 @@
"enter login password: ", /* Solaris */
"old smb password: ", /* smb */
@@ -301,6 +303,7 @@
static char *P3[] =
{
+ "retype new password: ", /* FreeBSD */
@ -18,7 +18,7 @@
"re-enter new password: ",
"retype new smb password: ", /* smb */
@@ -309,6 +312,8 @@
static char *P4[] =
{
+ "passwd: updating the database...\npasswd: done ", /* FreeBSD */

View File

@ -3,7 +3,7 @@
@@ -1226,6 +1226,18 @@
return ( pop_msg ( p, POP_FAILURE, HERE, ERRMSG_PW, p->user ) );
}
+# ifdef FREEBSD
+
+ /*
@ -18,4 +18,4 @@
+
return ( POP_SUCCESS );
}

View File

@ -1,23 +1,21 @@
#!/bin/sh
# $FreeBSD: /tmp/pcvs/ports/mail/qpopper/files/qpopper.in,v 1.1 2012-02-14 21:35:43 dougb Exp $
#
# PROVIDE: qpopper
# REQUIRE: SERVERS
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable qpopper:
# qpopper_enable="YES"
# qpopper_enable (bool): Set to NO by default.
# Set it to YES to enable qpopper.
# qpopper_flags (str): Set to "-f %%PREFIX%%/etc/qpopper.config" by default.
. /etc/rc.subr
name=qpopper
rcvar=qpopper_enable
load_rc_config $name
qpopper_enable=${qpopper_enable:-"NO"}
command=%%PREFIX%%/libexec/qpopper
load_rc_config ${name}
: ${qpopper_enable:="NO"}
: ${qpopper_flags:="110 -S -f %%PREFIX%%/etc/${name}.config"}
command="%%PREFIX%%/libexec/${name}"
run_rc_command "$1"

View File

@ -3,4 +3,4 @@ Qpopper is the most widely-used server for the POP3 protocol
Don't forget to edit /etc/inetd.conf to enable the server after installation.
WWW: http://www.eudora.com/products/unsupported/qpopper/
WWW: http://www.eudora.com/products/unsupported/qpopper/

View File

@ -4,15 +4,15 @@
# based on original from op port, written by Cyrille Lefevre
# <clefevre@citeweb.net>
[ $# != 2 ] && exit 1
[ ! $# = 2 -a ! $# = 4 ] && exit 1
PKGNAME=$1
ACTION=$2
CONF_DIR=${PKG_PREFIX}/etc/qpopper
CONF_FILE=popusers
CONF_OWN=pop
CONF_GRP=daemon
CONF_OWN=$3
CONF_GRP=$4
CONF_MODE=444
SAMP_SUFX=.sample

View File

@ -1,11 +1,19 @@
@owner %%USERS%%
@mode u+s
%%QPOPAUTH%%bin/qpopauth
@group %%GROUP%%
@mode 0444
%%ETCDIR%%/popusers.sample
@mode
@group wheel
@owner root
%%QPOPAUTH%%@unexec rm -f %D/bin/qapopauth
%%QPOPAUTH%%@exec ln -sf %D/bin/qpopauth %D/bin/qapopauth
libexec/qpopper
man/man8/qpopper.8.gz
%%QPOPAUTH%%man/man8/qpopauth.8.gz
%%EPOPPASSD%%libexec/qpoppassd
@exec mkdir -p %%ETCDIR%% && chown %%POP_USER%%:%%POP_GROUP%% %%ETCDIR%% && chmod %%POP_MODE_DIR%% %%ETCDIR%%
%%ETCDIR%%/popusers.sample
etc/qpopper.config.sample
@exec mkdir -p %%ETCDIR%% && chown %%USERS%%:%%GROUPS%% %%ETCDIR%% && chmod %%POP_MODE_DIR%% %%ETCDIR%%
%%PORTDOCS%%%%DOCSDIR%%/GUIDE.pdf
%%PORTDOCS%%@dirrm %%DOCSDIR%%
@dirrmtry %%ETCDIR%%

View File

@ -1,13 +0,0 @@
if [ "$2" != "INSTALL" ]; then
exit 0
fi
if ! id -u pop > /dev/null 2>&1; then
echo "You need an account \"pop\" to install this package."
echo "Please add it by hand (try \"man vipw\") and try again."
echo ""
echo "An example passwd entry is:"
echo "pop:*:68:6::0:0:Post Office Owner:/nonexistent:/nonexistent"
echo ""
exit 1
fi
exit 0

View File

@ -1,16 +0,0 @@
#!/bin/sh
if ! id -u pop > /dev/null 2>&1; then
echo "You need an account \"pop\" to install this package."
echo "Please add it by hand (try \"man vipw\") and try again."
echo ""
echo "An example passwd entry is:"
echo "pop:*:68:6::0:0:Post Office Owner:/nonexistent:/nonexistent"
echo ""
exit 1
fi
usrdir=${PREFIX}/etc/qpopper
if [ ! -d $usrdir ]; then
mkdir -p $usrdir
fi
chown pop:daemon $usrdir
chmod 700 $usrdir