1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-10 07:04:03 +00:00

- Fix when using WITH_PERL and WITH_PYTHON

- Make pkg-install script accept FLOWD_UID from environment

PR:		ports/137560
Submitted by:	Mel Flynn <mel.flynn+fbsd.ports@mailing.thruhere.net>
Approved by:	Janos Mohacsi <mohacsi@niif.hu> (maintainer)
This commit is contained in:
Wesley Shields 2009-10-15 21:26:58 +00:00
parent abd3dc246a
commit 6f0142ba6a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=242898
2 changed files with 18 additions and 9 deletions
net-mgmt/flowd

View File

@ -22,13 +22,15 @@ MAN8= flowd.8 flowd-reader.8
MAN5= flowd.conf.5
PORTDOCS= README INSTALL
FLOWD_USER?= _flowd
SCRIPTS_ENV+= FLOWD_USER="${FLOWD_USER}"
.if defined(FLOWD_UID)
SCRIPTS_ENV+= FLOWD_UID="${FLOWD_UID}"
.endif
.if defined(WITH_PERL)
USE_PERL5= yes
PLIST_SUB+= WITH_PERL=""
#MAN3PREFIX= ${PREFIX}/lib/perl5/${PERL_VERSION}
#MAN3= Flowd.3
BROKEN= Incomplete pkg-plist
MAN3= Flowd.3
.else
PLIST_SUB+= WITH_PERL="@comment "
.endif
@ -36,7 +38,7 @@ PLIST_SUB+= WITH_PERL="@comment "
.if defined(WITH_PYTHON)
USE_PYTHON= yes
PLIST_SUB+= WITH_PYTHON=""
BROKEN= Incomplete pkg-plist
INSTALLS_EGGINFO= yes
.else
PLIST_SUB+= WITH_PYTHON="@comment "
.endif
@ -67,9 +69,10 @@ post-install:
.if defined(WITH_PERL)
cd ${WRKSRC}/Flowd-perl && \
${PERL} Makefile.PL && \
${PERL} Makefile.PL INSTALLSITEMAN3DIR=${MAN3PREFIX}/man/man3 && \
${GMAKE} && \
${GMAKE} install
${GMAKE} install;
-@${RM} -f ${SITE_PERL}/${PERL_ARCH}/perllocal.pod
.endif
.if defined(WITH_PYTHON)
@ -78,6 +81,6 @@ post-install:
${PYTHON_CMD} setup.py install
.endif
FLOWD_USER=${FLOWD_USER} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
.include <bsd.port.mk>

View File

@ -20,9 +20,15 @@ create_user() {
shell=/nonexistent
fi
uhome="/var/empty"
if [ -z "${FLOWD_UID}" ]; then
uid=`${PW} usernext`;
uid=${uid%%:*}
else
uid=${FLOWD_UID}
fi
if ! ${PW} show user ${USER} -q >/dev/null; then
if ! ${PW} add user ${USER} -g ${GROUP} -d "${uhome}" \
if ! ${PW} add user ${USER} -u ${uid} -g ${GROUP} -d "${uhome}" \
-c "flowd privilege separation user" -s "${shell}" -p "*" \
; then
e=$?
@ -31,7 +37,7 @@ create_user() {
fi
echo "*** Added user \`${USER}' (id ${uid})"
else
echo "*** You already have user \`${USER}'."
echo "*** You already have user \`${USER} (id `id -u ${USER}`)'."
fi
}