1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-24 00:45:52 +00:00

- give sysutils/radmind its own UID/GID

- add pkg-message
 - add pkg-install script for user/group creation if installed
   from package since the installation use "chown"
 - bump portrevision

PR:		ports/150765
Submitted by:	Michael Graziano <mikeg _at_ bsd-box.net> (maintainer)
This commit is contained in:
Olli Hauer 2010-11-28 23:50:54 +00:00
parent 512b27c7ac
commit 841c20276b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=265342
6 changed files with 76 additions and 7 deletions

View File

@ -7,24 +7,30 @@
PORTNAME= radmind
PORTVERSION= 1.13.0
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= sysutils
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
MASTER_SITES= SF
MASTER_SITE_SUBDIR=${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
MAINTAINER= mikeg@bsd-box.net
COMMENT= Utility for administering filesystem changes
USE_OPENSSL= yes
USE_RC_SUBR= radmind.sh
SUB_LIST= RADMIND_BASE_DIR=${RADMIND_BASE_DIR}
PLIST_SUB= RADMIND_BASE_DIR=${RADMIND_BASE_DIR}
MAKE_JOBS_UNSAFE= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-radminddir=${RADMIND_BASE_DIR}
RADMINUSER= radmind
USERS= ${RADMINUSER}
GROUPS= ${RADMINUSER}
RADMIND_BASE_DIR?= /var/radmind
SUB_LIST= RADMIND_BASE_DIR=${RADMIND_BASE_DIR} RADMINUSER=${RADMINUSER}
PLIST_SUB= RADMIND_BASE_DIR=${RADMIND_BASE_DIR}
SUB_FILES+= pkg-install pkg-message
MAN1= fsdiff.1 ktcheck.1 lapply.1 lcksum.1 lcreate.1 lfdiff.1 \
lmerge.1 lsort.1 twhich.1 rash.1 repo.1
MAN5= applefile.5
@ -32,12 +38,14 @@ MAN8= radmind.8
DOCS= COPYRIGHT README SPEC
post-install:
# Ugly hack to remove generated man pages
# Ugly hack to remove generated man pages
${RM} -rf ${WRKSRC}/tmp
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
.endif
@${CHOWN} -R ${RADMINUSER}:${RADMINUSER} ${RADMIND_BASE_DIR}
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>

View File

@ -1,3 +1,2 @@
MD5 (radmind-1.13.0.tar.gz) = 29ce0070b707a47fe0de505ae7d68047
SHA256 (radmind-1.13.0.tar.gz) = 9d23787d8b482ad7cea590a970c40de2e7eec1f59d05b542df7f399679991b7f
SIZE (radmind-1.13.0.tar.gz) = 447650

View File

@ -0,0 +1,43 @@
#!/bin/sh
# This script is only needed if we install from package since the creation
# of groups/users are to late executed! The script can be removed if this
# issue is solved in bsd.port.mk.
USER=%%RADMINUSER%%
GROUP=%%RADMINUSER%%
UID=506
GID=506
RADMIND_BASE_DIR=%%RADMIND_BASE_DIR%%
if [ "$2" = "PRE-INSTALL" ]; then
if /usr/sbin/pw groupshow "${GROUP}" >/dev/null 2>&1; then
echo "Using existing group \"${GROUP}\"."
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}" >/dev/null 2>&1; then
echo "Using existing user \"${USER}\"."
else
if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -c "radmind User" -h - -d ${RADMIND_BASE_DIR} -s /usr/sbin/nologin ; then
install -Cp -d -g ${GID} -o ${UID} ${RADMIND_BASE_DIR}
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
echo "Please create it, and try again."
exit 1
fi
fi
fi
if [ "$2" = "POST-INSTALL" ]; then
chown -R ${USER}:${GROUP} ${RADMIND_BASE_DIR}
fi

View File

@ -0,0 +1,16 @@
####################
Important Note:
The radmind daemon now runs as user "%%RADMINUSER%%"
by default.
If you have installed an older version of
the radmind port you may need to chown
%%RADMIND_BASE_DIR%% appropriately.
You may restore the previous behavior by
setting
radmind_user="root"
in /etc/rc.conf
####################

View File

@ -12,8 +12,9 @@
#
#radmind_enable="YES"
#
# You may also override the default flags:
# You may also override the default daemon user & flags:
#
#radmind_user="radmind"
#radmind_flags="-D /var/radmind -m 5 -u 077 -Llocal7 -w 0"
#
# See radmind(8) for flags
@ -31,6 +32,7 @@ required_files=%%RADMIND_BASE_DIR%%/config
# set defaults
radmind_enable=${radmind_enable:-"NO"}
radmind_user=${radmind_user:-"radmind"}
radmind_flags=${radmind_flags:-"-D %%RADMIND_BASE_DIR%% -m 5 -u 077 -Llocal7 -w 0"}
load_rc_config ${name}

View File

@ -19,6 +19,7 @@ sbin/radmind
@exec mkdir -p -m 755 %%RADMIND_BASE_DIR%%/client
@exec mkdir -p -m 755 %%RADMIND_BASE_DIR%%/preapply
@exec mkdir -p -m 755 %%RADMIND_BASE_DIR%%/postapply
@exec chown -R radmind:radmind %%RADMIND_BASE_DIR%%
@cwd /
@dirrmtry %%RADMIND_BASE_DIR%%/transcript
@dirrmtry %%RADMIND_BASE_DIR%%/tmp/transcript