diff options
author | Lisa M. Seelye <lisa@gentoo.org> | 2004-08-22 19:14:10 +0000 |
---|---|---|
committer | Lisa M. Seelye <lisa@gentoo.org> | 2004-08-22 19:14:10 +0000 |
commit | 97a9585185a06315223212e1c530d9e4b51c4528 (patch) | |
tree | ba898daaa568dfff8993c6d0e02fb76b23021539 /sys-devel/distcc/files | |
parent | Stable on alpha. (Manifest recommit) (diff) | |
download | gentoo-2-97a9585185a06315223212e1c530d9e4b51c4528.tar.gz gentoo-2-97a9585185a06315223212e1c530d9e4b51c4528.tar.bz2 gentoo-2-97a9585185a06315223212e1c530d9e4b51c4528.zip |
Adding a patch for 2.17 to enable ipv6, updating the init and conf scripts. also set the distcc-config script to try and use userid 240.
Diffstat (limited to 'sys-devel/distcc/files')
-rw-r--r-- | sys-devel/distcc/files/2.17/2.17-ipv6-fix.diff.gz | bin | 0 -> 237 bytes | |||
-rw-r--r-- | sys-devel/distcc/files/2.17/conf | 42 | ||||
-rw-r--r-- | sys-devel/distcc/files/2.17/distcc-config | 165 | ||||
-rw-r--r-- | sys-devel/distcc/files/2.17/init | 30 | ||||
-rw-r--r-- | sys-devel/distcc/files/digest-distcc-2.17-r1 | 1 |
5 files changed, 238 insertions, 0 deletions
diff --git a/sys-devel/distcc/files/2.17/2.17-ipv6-fix.diff.gz b/sys-devel/distcc/files/2.17/2.17-ipv6-fix.diff.gz Binary files differnew file mode 100644 index 000000000000..26d165f8eb8b --- /dev/null +++ b/sys-devel/distcc/files/2.17/2.17-ipv6-fix.diff.gz diff --git a/sys-devel/distcc/files/2.17/conf b/sys-devel/distcc/files/2.17/conf new file mode 100644 index 000000000000..54790beca4de --- /dev/null +++ b/sys-devel/distcc/files/2.17/conf @@ -0,0 +1,42 @@ +# Copyright 2003 Gentoo Technologies, Inc +# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/files/2.17/conf,v 1.1 2004/08/22 19:14:10 lisa Exp $ +# distccd configuration file + +DISTCCD_OPTS="" + +# this is the distccd executable +DISTCCD_EXEC=/usr/bin/distccd + +# this is where distccd will store its pid file +DISTCCD_PIDFILE=/var/run/distccd/distccd.pid + +# set this option to run distccd with extra parameters +# Default port is 3632. For most people the default is okay. +DISTCCD_OPTS="${DISTCCD_OPTS} --port 3632" + + +# Logging +# You can change some logging options here: +# --log-file FILE +# --log-level LEVEL [critical,error,warning, notice, info, debug] +# +# Leaving --log-file blank will log to syslog +# example: --log-file /dev/null --log-level warning +# example: --log-level critical + +DISTCCD_OPTS="${DISTCCD_OPTS} --log-level critical" + +# SECURITY NOTICE: +# It is HIGHLY recomended that you use the --allow or --listen options +# for increased security. You can specify an IP to permit connections +# from or a CIDR mask +# --listen accepts only a single IP +# example: --allow 192.168.0.0/24 +# example: --allow 192.168.0.5 --allow 192.168.0.150 +# example: --listen 192.168.0.2 + +#DISTCCD_OPTS="${DISTCCD_OPTS} --allow 192.168.0.0/24 --listen 192.168.0.2" + +# set this for niceness +# Default is 15 +DISTCCD_NICE="15" diff --git a/sys-devel/distcc/files/2.17/distcc-config b/sys-devel/distcc/files/2.17/distcc-config new file mode 100644 index 000000000000..e5f059e83bcb --- /dev/null +++ b/sys-devel/distcc/files/2.17/distcc-config @@ -0,0 +1,165 @@ +#!/usr/bin/env python +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/files/2.17/distcc-config,v 1.1 2004/08/22 19:14:10 lisa Exp $ + +import os, re, signal, sys, commands, pwd +from string import rstrip + +options=[ + '--get-hosts', + '--set-hosts', + '--get-verbose', + '--set-verbose', + '--get-log', + '--set-log', + '--install', + '--help', + '--get-env', + '--set-env' +] + +tmpcmdline=sys.argv[1:] +cmdline=[] +envfile = '/etc/env.d/02distcc' + +def exithandler(foo,bar): + os.kill(0,signal.SIGKILL) + sys.exit(1) + +signal.signal(signal.SIGINT,exithandler) + +def isroot(ret=0): + if os.getuid() != 0: + if ret == 0: + print '!!!',sys.argv[:1][0],tmpcmdline[0],'must be run as root' + sys.exit(1) + else: + retval = 0 + else: + retval = 1 + return retval + +def writeenv(var,value): + isroot() + distcc_env = [] + distcc_env = open(envfile, 'r').readlines() + distcc_env_new = open(envfile, 'w') + for i in range(len(distcc_env)): + if re.compile(var+'="(.*)"').match(distcc_env[i]): + distcc_env[i] = var+'="'+value+'"\n' + distcc_env_new.write(distcc_env[i]) + #print 'Set',var,'to:',value + os.popen('/usr/sbin/env-update') + print 'If you want to use these new settings in an existing shell,' + print 'you need to "source /etc/profile" to get the changes.' + +def readenv(var): + distcc_env = open(envfile, 'r').read() + match = re.compile(var+'="(.*)"').search(distcc_env) + if match: + print var+'='+match.group(1) + else: + print var,'not set.' + +def permissions(path,user,group): + for file in os.listdir(path): + #print 'Configuring',path+file+'...' + os.chown(path+file,user,group) + +def installlinks(chost=''): + for file in ['gcc', 'cc', 'c++', 'g++']: + path = '/usr/lib/distcc/bin/' + if not chost == '': + file = chost+'-'+file + if os.path.exists('/usr/bin/'+file): + #print 'Creating',path+file,'symlink...' + if not os.path.exists(path+file): + os.symlink('/usr/bin/distcc',path+file) + #else: + # print 'Already exists. Skipping...' + +def createdistccdir(dir): + if not os.path.exists(dir): + os.mkdir(dir) + os.chmod(dir, 1777) + +for x in tmpcmdline: + if not x: + continue + if x[0:2]=="--": + if not x in options: + print "!!! Error:",x,"is an invalid option." + sys.exit(1) + else: + cmdline = x + +if '--get-hosts' in tmpcmdline: + HOSTS_ENV = os.environ.get('DISTCC_HOSTS') + HOSTS_HOME = os.environ.get('HOME')+'/hosts' + if HOSTS_ENV: + print HOSTS_ENV + elif os.path.exists(HOSTS_HOME) and os.path.getsize(HOSTS_HOME) != 0: + print HOSTS_HOME + elif os.path.exists('/etc/distcc/hosts'): + print rstrip(open('/etc/distcc/hosts', 'r').read()) + else: + print 'No configuration file found. Setup your hosts with --set-hosts.' +elif '--set-hosts' in tmpcmdline: + if isroot(1): + PATH = '/etc/distcc' + else: + PATH = os.environ.get('HOME') + createdistccdir(PATH) + open(PATH+'/hosts', 'w').write(cmdline + '\n') +elif '--get-verbose' in tmpcmdline: + readenv('DISTCC_VERBOSE') +elif '--set-verbose' in tmpcmdline: + writeenv('DISTCC_VERBOSE',tmpcmdline[1]) +elif '--get-log' in tmpcmdline: + readenv('DISTCC_LOG') +elif '--set-log' in tmpcmdline: + writeenv('DISTCC_LOG',tmpcmdline[1]) +elif '--install' in tmpcmdline: + isroot() + print 'Creating',envfile+'...' + distcc_env = open(envfile, 'w') + distcc_env.write('# This file is managed by distcc-config; use it to change these settings.\n') + distcc_env.write('DISTCC_LOG=""\n') + distcc_env.write('DCCC_PATH="/usr/lib/distcc/bin"\n') + distcc_env.write('DISTCC_VERBOSE="0"\n') + + if os.WEXITSTATUS(commands.getstatusoutput('/usr/sbin/useradd -u 240 -g daemon -s /bin/false -d /dev/null -c "distccd" distcc')[0]) == 9: + os.WEXITSTATUS(commands.getstatusoutput('/usr/sbin/usermod -g daemon -s /bin/false -d /dev/null -c "distccd" distcc')[0]) + + foobar = pwd.getpwnam('distcc') + user = foobar[2] + group = foobar[3] + + makeconf = open('/etc/make.conf', 'r').read() + chost = re.compile('CHOST="(.*)"').search(makeconf).group(1) + print 'Creating symlinks...' + installlinks() + installlinks(chost) + + print 'Checking permissions...' + permissions('/usr/lib/distcc/bin/',user,group) + permissions('/var/run/distccd/',user,group) +elif '--get-env' in tmpcmdline: + if len(tmpcmdline) == 1: + print rstrip(open(envfile, 'r').read()) + elif len(tmpcmdline) == 2: + readenv(tmpcmdline[1]) + else: + print '!!! Error: Specify only one variable.' +elif '--set-env' in tmpcmdline: + if len(tmpcmdline) > 2 and len(tmpcmdline) <= 3: + isroot() + writeenv(tmpcmdline[1],tmpcmdline[2]) + else: + print '!!! Error: Awaiting two parameters.' +else: + print 'Usage: /usr/bin/distcc-config --set-hosts DISTCC_HOSTS | --get-hosts' + print ' /usr/bin/distcc-config --set-verbose { 0 | 1 } | --get-verbose' + print ' /usr/bin/distcc-config --set-log FILE | --get-log' + print ' /usr/bin/distcc-config --set-env VARIABLE VALUE | --get-env [VARIABLE]' diff --git a/sys-devel/distcc/files/2.17/init b/sys-devel/distcc/files/2.17/init new file mode 100644 index 000000000000..cddadf345a80 --- /dev/null +++ b/sys-devel/distcc/files/2.17/init @@ -0,0 +1,30 @@ +#!/sbin/runscript +# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/files/2.17/init,v 1.1 2004/08/22 19:14:10 lisa Exp $ + +depend() { + need net + use ypbind +} + +start() { + [ -e "${DISTCCD_PIDFILE}" ] && rm -f ${DISTCCD_PIDFILE} &>/dev/null + + ebegin "Starting distccd" + chown distcc `dirname ${DISTCCD_PIDFILE}` &>/dev/null + TMPDIR="${TMPDIR}" \ + PATH="$(gcc-config --get-bin-path):${PATH}" \ + /sbin/start-stop-daemon --start --quiet --startas ${DISTCCD_EXEC} \ + --pidfile ${DISTCCD_PIDFILE} -- \ + --pid-file ${DISTCCD_PIDFILE} -N ${DISTCCD_NICE} --user distcc \ + ${DISTCCD_OPTS} + + eend $? +} + +stop() { + ebegin "Stopping distccd" + start-stop-daemon --stop --quiet --pidfile "${DISTCCD_PIDFILE}" + rm -f "${DISTCCD_PIDFILE}" + eend $? +} + diff --git a/sys-devel/distcc/files/digest-distcc-2.17-r1 b/sys-devel/distcc/files/digest-distcc-2.17-r1 new file mode 100644 index 000000000000..26143c9d7cf5 --- /dev/null +++ b/sys-devel/distcc/files/digest-distcc-2.17-r1 @@ -0,0 +1 @@ +MD5 8ac5c032cde68c525afe9f53eae5cbf7 distcc-2.17.tar.bz2 339527 |