- Install desktop and icon files when GNOME or GTK option is set. [1] - Fix pidfile when 'distccd_flags' variable is not set by the user. - Replace COMPILER_LINKS option with CLANGLINK and LLVMLINK options. Note these are turned off by default unlike COMPILER_LINKS. Actually, these are equivalent to options for devel/ccache as they are often jointly used. - Modernize and clean up the port. PR: 185426 [1]
47 lines
1.1 KiB
Bash
47 lines
1.1 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
# $MCom: ports/devel/distcc/files/distccd.sh.in,v 1.1 2007/05/19 17:43:14 ahze Exp $
|
|
|
|
# PROVIDE: distccd
|
|
# REQUIRE: NETWORKING ldconfig
|
|
# KEYWORD: shutdown
|
|
|
|
#
|
|
# Add the following lines to /etc/rc.conf to enable distccd:
|
|
#
|
|
# distccd_enable (bool): Set to YES to enable distccd.
|
|
# distccd_flags (str): Arguments passed to distccd.
|
|
# distccd_path (str): DISTCCD_PATH environment value for distccd..
|
|
#
|
|
|
|
distccd_enable=${distccd_enable-"NO"}
|
|
distccd_flags=${distccd_flags-"-a 127.0.0.0/8 --user distcc --daemon -P %%DISTCCD_PIDFILE%%"}
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=distccd
|
|
rcvar=distccd_enable
|
|
|
|
command=%%PREFIX%%/sbin/${name}
|
|
# extract pid file from distccd_flags (if any)
|
|
pidfile="`echo ${distccd_flags} |sed -nE -e 's/^.*-P ([^ ]+).*$/\1/p'`"
|
|
# set default value
|
|
pidfile=${pidfile:-%%DISTCCD_PIDFILE%%}
|
|
|
|
distccd_precmd()
|
|
{
|
|
# distccd drops root privileges and then attempts to create the pid file
|
|
touch ${pidfile}
|
|
chown distcc:distcc ${pidfile}
|
|
|
|
if [ -n "${distccd_path}" ]
|
|
then
|
|
export DISTCCD_PATH="${distccd_path}"
|
|
fi
|
|
}
|
|
|
|
start_precmd="distccd_precmd"
|
|
load_rc_config ${name}
|
|
run_rc_command "$1"
|