freebsd-ports/net/boinc-client/files/pkg-install.in
Rene Ladan bad740c6d4 Overhaul option handling:
- Only use the rc framework for boinc-client when the CLIENT option is
  selected
- Always set CLIENT and X11 options when MANAGER option is selected
- Unset USER option when CLIENT option is not selected
- Create the share/boinc directory when the MANAGER or X11 option is
  set instead of when the USER option is set
- Prefer negation over empty() when checking options
- Update description for the USER option

In pkg-install.in :
- Only install the CA bundle and only adjust file ownership of ~boinc
  when the USER option is selected
- Only install skins when both the USER and MANAGER options are selected

While here:
- create share/pixmaps in PREFIX instead of LOCALBASE
- wrap a long line

PR:		ports/176724 (part)
Submitted by:	Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
2013-08-27 21:37:47 +00:00

29 lines
709 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
PATH=/bin:/usr/sbin:/usr/bin:/usr/sbin
user=%%BOINC_CLIENT_USER%%
group=%%BOINC_CLIENT_GROUP%%
home="%%BOINC_CLIENT_HOME%%"
option_manager=%%OPTION_MANAGER%%
option_user=%%OPTION_USER%%
case $2 in
POST-INSTALL)
if [ -n "${option_user}" ] ; then
if [ -n "${option_manager}" -a ! -e "${home}/skins" -a ! -L "${home}/skins" ]; then
ln -s "%%PREFIX%%/share/boinc/skins" "${home}/skins"
fi
if [ ! -e "${home}/ca-bundle.crt" -a ! -L "${home}/ca-bundle.crt" ]; then
ln -s "%%LOCALBASE%%/share/certs/ca-root-nss.crt" "${home}/ca-bundle.crt"
fi
echo "Adjusting file ownership in \"${home}\" to ${user}:${group}"
chown -hR ${user}:${group} "${home}"
fi
;;
esac
exit 0