mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-22 04:17:44 +00:00
Use USERS and GROUPS
PR: ports/157665 Submitted by: crees (me) Approved by: rene (mentor, implicit), maintainer timeout (lippe, 35 days)
This commit is contained in:
parent
acd4a94f86
commit
f1e12f3aaf
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=277475
@ -19,15 +19,18 @@ USE_QMAIL_BUILD= yes
|
||||
|
||||
GNU_CONFIGURE= yes
|
||||
|
||||
USERS= ${PORTNAME}
|
||||
GROUPS= ${USERS}
|
||||
|
||||
WORKDIR?= ${QMAIL_PREFIX}/${PORTNAME}
|
||||
QMAIL_QUEUE= ${QMAIL_PREFIX}/bin/qmail-queue
|
||||
|
||||
SUB_FILES= pkg-message \
|
||||
pkg-install \
|
||||
pkg-deinstall
|
||||
pkg-install
|
||||
SUB_LIST= QMAIL_PREFIX=${QMAIL_PREFIX} \
|
||||
SIMSCAN_DIR=${PORTNAME}
|
||||
PLIST_SUB= QMAIL_PREFIX=${QMAIL_PREFIX}
|
||||
PLIST_SUB= QMAIL_PREFIX=${QMAIL_PREFIX} \
|
||||
SIMSCAN_DIR=${PORTNAME}
|
||||
|
||||
OPTIONS= CLAMAV "Support for ClamAV Virus Scanning" on \
|
||||
RIPMIME "Ripmime Processing (if Clamav ScanMail disabled)" on \
|
||||
|
@ -1,19 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
|
||||
USER=simscan
|
||||
GROUP=${USER}
|
||||
|
||||
if [ x$2 != xDEINSTALL ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
pw groupdel -n ${GROUP} || true
|
||||
pw userdel -n ${GROUP} || true
|
||||
|
||||
rmdir %%QMAIL_PREFIX%%/%%SIMSCAN_DIR%% || true
|
||||
|
||||
echo ""
|
||||
echo "If you're not updating this port, you can delete %%QMAIL_PREFIX%%/%%SIMSCAN_DIR%% directory"
|
||||
echo ""
|
@ -4,40 +4,9 @@
|
||||
|
||||
USER=simscan
|
||||
GROUP=${USER}
|
||||
UID=74
|
||||
GID=${UID}
|
||||
SIMDIR=%%QMAIL_PREFIX%%/%%SIMSCAN_DIR%%
|
||||
|
||||
if [ "$2" = "PRE-INSTALL" ]; then
|
||||
|
||||
echo adding simscan user
|
||||
|
||||
if pw group show "${GROUP}" 2>/dev/null; then
|
||||
echo "You already have a group \"${GROUP}\", so I will use it."
|
||||
else
|
||||
if pw groupadd ${GROUP} -g ${GID}; then
|
||||
echo "Added group \"${GROUP}\"."
|
||||
else
|
||||
echo "Adding group \"${GROUP}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if pw user show "${USER}" 2>/dev/null; then
|
||||
echo "You already have a user \"${USER}\", so I will use it."
|
||||
else
|
||||
if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
|
||||
-d /nonexistent -s /sbin/nologin -c "Simscan User"
|
||||
then
|
||||
echo "Added user \"${USER}\"."
|
||||
else
|
||||
echo "Adding user \"${USER}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
elif [ "$2" = "POST-INSTALL" ]; then
|
||||
if [ "$2" = "POST-INSTALL" ]; then
|
||||
|
||||
if [ ! -d "$SIMDIR" ]; then
|
||||
/bin/mkdir -p "$SIMDIR" || exit 1
|
||||
|
@ -1,3 +1,4 @@
|
||||
@cwd %%QMAIL_PREFIX%%
|
||||
bin/simscanmk
|
||||
bin/simscan
|
||||
@dirrmtry %%SIMSCAN_DIR%%
|
||||
|
Loading…
Reference in New Issue
Block a user