mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-06 06:30:19 +00:00
. Rely on standard mechanisms of creating/deleting groups and users for the
port rather than the port having it's own way of doing this (which admittedly pre-dated the standard mechanisms and was "standard" at the time).
This commit is contained in:
parent
bb691dade7
commit
67dd929300
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=279720
@ -32,6 +32,9 @@ MAKE_ENV+= EXTRA_DEFINES="$(EXTRA_DEFINES)"
|
||||
PORTDOCS= *
|
||||
.endif
|
||||
|
||||
USERS= mud
|
||||
GROUPS= mud
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
EXTRA_DEFINES=
|
||||
@ -76,9 +79,4 @@ do-install:
|
||||
cd ${WRKDIR}/dgd/doc && ${COPYTREE_SHARE} . ${DOCSDIR}
|
||||
.endif
|
||||
|
||||
post-install:
|
||||
@# Run package installation script
|
||||
@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGDIR}/pkg-install ${PKGNAME} \
|
||||
POST-INSTALL
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
|
@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
if [ "$2" != "POST-DEINSTALL" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
USER=mud
|
||||
|
||||
if pw usershow "${USER}" 2>/dev/null 1>&2; then
|
||||
echo "To delete MUD user permanently, use 'pw userdel \"${USER}\"'"
|
||||
fi
|
||||
|
||||
exit 0
|
@ -1,37 +0,0 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
|
||||
if [ "$2" = "PRE-INSTALL" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin
|
||||
|
||||
USER=mud
|
||||
GROUP=${USER}
|
||||
UID=97
|
||||
GID=${UID}
|
||||
|
||||
if pw groupshow "${GROUP}" 2>/dev/null; then
|
||||
echo "Using existing group \"${GROUP}\"."
|
||||
else
|
||||
if pw groupadd "${GROUP}" -g ${GID}; then
|
||||
echo "Added group \"${GROUP}\"."
|
||||
else
|
||||
echo "Adding group \"${GROUP}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if pw usershow "${USER}" 2>/dev/null; then
|
||||
echo "Using existing user \"${USER}\"."
|
||||
else
|
||||
if pw useradd "${USER}" -u ${UID} -g "${GROUP}" -h - \
|
||||
-s "/bin/sh" -d "/nonexistent" -c "MUD Owner"
|
||||
then
|
||||
echo "Added user \"${USER}\"."
|
||||
else
|
||||
echo "Adding user \"${USER}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
Loading…
Reference in New Issue
Block a user