- switch to USERS/GROUPS
- bump port revision
This commit is contained in:
parent
575fdd36d6
commit
d22a784cb0
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=275228
2 changed files with 5 additions and 50 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
PORTNAME= cricket
|
||||
PORTVERSION= 1.0.5
|
||||
PORTREVISION= 7
|
||||
PORTREVISION= 8
|
||||
CATEGORIES= net-mgmt
|
||||
MASTER_SITES= SF
|
||||
|
||||
|
@ -23,14 +23,11 @@ USE_PERL5= yes
|
|||
HAS_CONFIGURE= yes
|
||||
NO_BUILD= yes
|
||||
PLIST_SUB+= VERSION=${PORTVERSION}
|
||||
SUB_FILES= pkg-message pkg-install
|
||||
SUB_LIST= USER="${CRICKET_USER}" GROUP="${CRICKET_GROUP}" UID="${CRICKET_UID}" GID="${CRICKET_GID}"
|
||||
SUB_FILES= pkg-message
|
||||
|
||||
# UID and username comes from ports/UIDs.
|
||||
CRICKET_USER= cricket
|
||||
CRICKET_UID= 141
|
||||
CRICKET_GROUP= www
|
||||
CRICKET_GID= 80
|
||||
USERS= cricket
|
||||
GROUPS= www
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
|
@ -46,12 +43,11 @@ post-patch:
|
|||
${WRKSRC}/sample-config/news-server/Defaults
|
||||
|
||||
do-install:
|
||||
@PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
|
||||
@${MKDIR} -m 755 ${PREFIX}/cricket/cricket-${PORTVERSION}
|
||||
@${CP} -R ${WRKSRC}/* ${PREFIX}/cricket/cricket-${PORTVERSION}
|
||||
@${FIND} ${PREFIX}/cricket/cricket-${PORTVERSION} -name \*.orig -or \
|
||||
-name \*.bak | ${XARGS} ${RM} -f
|
||||
${CHOWN} -R ${CRICKET_USER}:${CRICKET_GROUP} ${PREFIX}/cricket
|
||||
${CHOWN} -R ${USERS}:${GROUPS} ${PREFIX}/cricket
|
||||
@if [ -L ${PREFIX}/cricket/cricket ]; then \
|
||||
${ECHO_MSG} "Updating ${PREFIX}/cricket/cricket symbolic link"; \
|
||||
${RM} ${PREFIX}/cricket/cricket; \
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
#!/bin/sh
|
||||
# $FreeBSD: /tmp/pcvs/ports/net-mgmt/cricket/files/Attic/pkg-install.in,v 1.2 2008-03-09 21:32:01 koitsu Exp $
|
||||
#
|
||||
|
||||
GROUP=%%GROUP%%
|
||||
USER=%%USER%%
|
||||
UID=%%UID%%
|
||||
GID=%%GID%%
|
||||
|
||||
if [ "$2" != "PRE-INSTALL" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
|
||||
echo "You already have a group \"${GROUP}\", so I will use it."
|
||||
else
|
||||
if /usr/sbin/pw groupadd ${GROUP} -g ${GID}
|
||||
then
|
||||
echo "Added group \"${GROUP}\"."
|
||||
else
|
||||
echo "Adding group \"${GROUP}\" failed..."
|
||||
echo "Please create it, and try again."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
|
||||
echo "You already have a user \"${USER}\", so I will use it."
|
||||
else
|
||||
if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
|
||||
-d /usr/local/cricket -s /usr/sbin/nologin -c "Cricket Monitoring User"
|
||||
then
|
||||
echo "Added user \"${USER}\"."
|
||||
else
|
||||
echo "Adding user \"${USER}\" failed..."
|
||||
echo "Please create it, and try again."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
Loading…
Reference in a new issue