aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRene Ladan <rene@FreeBSD.org>2013-08-23 20:54:44 +0000
committerRene Ladan <rene@FreeBSD.org>2013-08-23 20:54:44 +0000
commit7fa95cb24c3b93c8edb455be9d96ea8c1ae5ace9 (patch)
tree3057552e573bba1e09574bcb3733eb36b971eb3c
parentc88a0f3b1179864ba5924c48321ba85e8072404f (diff)
downloadports-7fa95cb24c3b93c8edb455be9d96ea8c1ae5ace9.tar.gz
ports-7fa95cb24c3b93c8edb455be9d96ea8c1ae5ace9.zip
Use the USERS/GROUPS mechanism for the boinc-client port instead of
manually creating them. It is still possible to overrride the defaults by setting BOINC_CLIENT_USER , BOINC_CLIENT_GROUP , and BOINC_CLIENT_HOME but that means the entries in UIDs and GIDs have to be changed too. PR: ports/176274 (part, based on) Submitted by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua> Reviewed by: crees (slightly)
Notes
Notes: svn path=/head/; revision=325280
-rw-r--r--GIDs1
-rw-r--r--UIDs1
-rw-r--r--net/boinc-client/Makefile5
-rw-r--r--net/boinc-client/files/pkg-install.in18
-rw-r--r--net/boinc-client/pkg-plist3
5 files changed, 8 insertions, 20 deletions
diff --git a/GIDs b/GIDs
index 4b657873a531..032f9d6341af 100644
--- a/GIDs
+++ b/GIDs
@@ -259,5 +259,6 @@ kippo:*:969:
colord:*:970:
shibd:*:971:
plex:*:972:
+boinc:*:973:
nogroup:*:65533:
nobody:*:65534:
diff --git a/UIDs b/UIDs
index 968fd79911b3..236ddfa28acd 100644
--- a/UIDs
+++ b/UIDs
@@ -266,4 +266,5 @@ kippo:*:969:969::0:0:kippo user:/nonexistent:/usr/sbin/nologin
colord:*:970:970::0:0:colord color management daemon:/nonexistent:/usr/sbin/nologin
shibd:*:971:971::0:0:Shibboleth SAML daemon:/nonexistent:/usr/sbin/nologin
plex:*:972:972::0:0:Plex Media Server:/nonexistent:/usr/sbin/nologin
+boinc:*:973:973::0:0:BOINC user:/var/db/boinc:/usr/sbin/nologin
nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin
diff --git a/net/boinc-client/Makefile b/net/boinc-client/Makefile
index de68a8870795..08b89c5363a3 100644
--- a/net/boinc-client/Makefile
+++ b/net/boinc-client/Makefile
@@ -17,8 +17,11 @@ USE_LDCONFIG= yes
USE_DOS2UNIX= yes
DOS2UNIX_REGEX= .*\.(cpp|h)
+USERS= boinc
+GROUPS= boinc
+
BOINC_CLIENT_USER?= boinc
-BOINC_CLIENT_GROUP?= nobody
+BOINC_CLIENT_GROUP?= boinc
BOINC_CLIENT_HOME?= /var/db/boinc
PLIST_SUB= BOINC_CLIENT_HOME="${BOINC_CLIENT_HOME}" \
diff --git a/net/boinc-client/files/pkg-install.in b/net/boinc-client/files/pkg-install.in
index 3144a686791e..c83ffd5e7d16 100644
--- a/net/boinc-client/files/pkg-install.in
+++ b/net/boinc-client/files/pkg-install.in
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $FreeBSD:$
+# $FreeBSD$
#
PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin
@@ -8,23 +8,9 @@ PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin
user=%%BOINC_CLIENT_USER%%
group=%%BOINC_CLIENT_GROUP%%
home="%%BOINC_CLIENT_HOME%%"
-shell=/bin/sh
case $2 in
-PRE-INSTALL)
- if ! pw usershow ${user} 2>/dev/null 1>&2; then
- if ! pw useradd ${user} -g ${group} -c "BOINC client user" \
- -d "${home}" -s ${shell}; then
- echo "Failed to create user \"${user}\"." >&2
- exit 1
- else
- echo "User \"${user}\" created successfully:"
- fi
- else
- echo "Using existent user \"${user}\":"
- fi
- pw usershow ${user}
- mkdir -m u=rwx,go= -p "${home}"
+POST-INSTALL)
if [ ! -e "${home}/skins" -a ! -L "${home}/skins" ]; then
ln -s "%%PREFIX%%/share/boinc/skins" "${home}/skins"
fi
diff --git a/net/boinc-client/pkg-plist b/net/boinc-client/pkg-plist
index 6415a35d4fb0..9acba73f80d1 100644
--- a/net/boinc-client/pkg-plist
+++ b/net/boinc-client/pkg-plist
@@ -448,6 +448,3 @@ lib/libboinc_zip.so.7
%%X11%%@dirrm share/boinc
%%NLS%%@dirrmtry share/locale/sv_SE/LC_MESSAGES
%%NLS%%@dirrmtry share/locale/sv_SE
-%%USER%%@unexec if [ -d "%%BOINC_CLIENT_HOME%%" ]; then echo "If you are deinstalling boinc-client completely, remove the \"%%BOINC_CLIENT_HOME%%\" directory."; fi
-%%USER%%@unexec if [ -d "%%BOINC_CLIENT_HOME%%" ]; then echo -n "Also, d"; else echo -n "D"; fi
-%%USER%%@unexec echo "on't forget to remove the BOINC client user \"%%BOINC_CLIENT_USER%%\"."