From d333123bf1855663c371b055f52a987f83f87610 Mon Sep 17 00:00:00 2001 From: Petteri Räty Date: Tue, 1 Jan 2008 21:43:42 +0000 Subject: Add init script mods needed for --zeroconf support. svn path=/; revision=153 --- sys-devel/distcc/distcc-2.18.3-r11.ebuild | 8 +++-- sys-devel/distcc/files/2.18-r1/conf | 40 ++++++++++++++++++++++ sys-devel/distcc/files/2.18-r1/distcc-config.patch | 35 +++++++++++++++++++ sys-devel/distcc/files/2.18-r1/init | 38 ++++++++++++++++++++ sys-devel/distcc/files/2.18/conf | 40 ---------------------- sys-devel/distcc/files/2.18/distcc-config.patch | 35 ------------------- sys-devel/distcc/files/2.18/init | 30 ---------------- 7 files changed, 119 insertions(+), 107 deletions(-) create mode 100644 sys-devel/distcc/files/2.18-r1/conf create mode 100644 sys-devel/distcc/files/2.18-r1/distcc-config.patch create mode 100644 sys-devel/distcc/files/2.18-r1/init delete mode 100644 sys-devel/distcc/files/2.18/conf delete mode 100644 sys-devel/distcc/files/2.18/distcc-config.patch delete mode 100644 sys-devel/distcc/files/2.18/init diff --git a/sys-devel/distcc/distcc-2.18.3-r11.ebuild b/sys-devel/distcc/distcc-2.18.3-r11.ebuild index 7e2acf3..96bec11 100644 --- a/sys-devel/distcc/distcc-2.18.3-r11.ebuild +++ b/sys-devel/distcc/distcc-2.18.3-r11.ebuild @@ -7,7 +7,7 @@ inherit autotools eutils flag-o-matic toolchain-funcs -PATCHLEVEL="2.18" +PATCHLEVEL="2.18-r1" DESCRIPTION="a program to distribute compilation of C code across several machines on a network" HOMEPAGE="http://distcc.samba.org/" @@ -24,6 +24,7 @@ DEPEND="|| ( >=sys-devel/gcc-config-1.3.1 app-admin/eselect-compiler ) userland_GNU? ( sys-apps/shadow ) gnome? ( dev-util/pkgconfig ) gtk? ( dev-util/pkgconfig ) + dev-util/unifdef ${COMMON_DEP}" RDEPEND=" gnome? ( @@ -101,7 +102,10 @@ src_install() { newconfd "${FILESDIR}/${PATCHLEVEL}/conf" distccd - newinitd "${FILESDIR}/${PATCHLEVEL}/init" distccd + local avahi="-UAVAHI" + use avahi && avahi="-DAVAHI" + unifdef ${avahi} "${FILESDIR}/${PATCHLEVEL}/init" > "${T}/init" + newinitd "${T}/init" distccd # create and keep the symlink dir dodir /usr/lib/distcc/bin diff --git a/sys-devel/distcc/files/2.18-r1/conf b/sys-devel/distcc/files/2.18-r1/conf new file mode 100644 index 0000000..3f6c3f0 --- /dev/null +++ b/sys-devel/distcc/files/2.18-r1/conf @@ -0,0 +1,40 @@ +# /etc/conf.d/distccd: config file for /etc/init.d/distccd + +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 --listen option +# for increased security. You can specify an IP to permit connections +# from or a CIDR mask +# --listen accepts only a single IP +# --allow is now mandatory as of distcc-2.18. +# 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" +#DISTCCD_OPTS="${DISTCCD_OPTS} --listen 192.168.0.2" + +# set this for niceness +# Default is 15 +DISTCCD_NICE="15" diff --git a/sys-devel/distcc/files/2.18-r1/distcc-config.patch b/sys-devel/distcc/files/2.18-r1/distcc-config.patch new file mode 100644 index 0000000..d06a784 --- /dev/null +++ b/sys-devel/distcc/files/2.18-r1/distcc-config.patch @@ -0,0 +1,35 @@ +--- /usr/bin/distcc-config 2005-04-02 16:08:44.000000000 +0100 ++++ distcc-config-adq 2005-04-07 14:06:23.000000000 +0100 +@@ -65,7 +65,22 @@ + def permissions(path,user,group): + for file in os.listdir(path): + #print 'Configuring',path+file+'...' +- os.chown(path+file,user,group) ++ os.chmod(path+file,0755) ++ ++def installoverrides(chost): ++ for file in ['gcc', 'cc', 'c++', 'g++']: ++ path = '/usr/lib/distcc/bin/' ++ if os.path.exists('/usr/bin/'+chost+'-'+file): ++ if os.path.exists(path+file): ++ os.unlink(path+file) ++ override_cmd = open(path+file, 'w') ++ override_cmd.write('#!/bin/sh\n') ++ override_cmd.write('exec '+chost+'-'+file+' \"$@\"\n'); ++ os.chown(path+file,user,group) ++ override_cmd = open(path+'cc', 'w') ++ override_cmd.write('#!/bin/sh\n') ++ override_cmd.write('exec '+chost+'-gcc'+' \"$@\"\n'); ++ os.chown(path+'cc',user,group) + + def installlinks(chost=''): + for file in ['gcc', 'cc', 'c++', 'g++']: +@@ -139,7 +154,7 @@ + makeconf = open('/etc/make.conf', 'r').read() + chost = re.compile('CHOST="(.*)"').search(makeconf).group(1) + print 'Creating symlinks...' +- installlinks() ++ installoverrides(chost) + installlinks(chost) + + print 'Checking permissions...' diff --git a/sys-devel/distcc/files/2.18-r1/init b/sys-devel/distcc/files/2.18-r1/init new file mode 100644 index 0000000..bc19cf2 --- /dev/null +++ b/sys-devel/distcc/files/2.18-r1/init @@ -0,0 +1,38 @@ +#!/sbin/runscript +# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/files/2.18/init,v 1.1 2004/10/12 17:21:43 lisa Exp $ + +depend() { +#ifdef AVAHI + need net avahi-daemon +#else + need net +#endif + use ypbind +} + +start() { + [ -e "${DISTCCD_PIDFILE}" ] && rm -f ${DISTCCD_PIDFILE} &>/dev/null + + local args="" +#ifdef AVAHI + args="--zeroconf" +#endif + 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 \ + ${args} ${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/2.18/conf b/sys-devel/distcc/files/2.18/conf deleted file mode 100644 index 3f6c3f0..0000000 --- a/sys-devel/distcc/files/2.18/conf +++ /dev/null @@ -1,40 +0,0 @@ -# /etc/conf.d/distccd: config file for /etc/init.d/distccd - -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 --listen option -# for increased security. You can specify an IP to permit connections -# from or a CIDR mask -# --listen accepts only a single IP -# --allow is now mandatory as of distcc-2.18. -# 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" -#DISTCCD_OPTS="${DISTCCD_OPTS} --listen 192.168.0.2" - -# set this for niceness -# Default is 15 -DISTCCD_NICE="15" diff --git a/sys-devel/distcc/files/2.18/distcc-config.patch b/sys-devel/distcc/files/2.18/distcc-config.patch deleted file mode 100644 index d06a784..0000000 --- a/sys-devel/distcc/files/2.18/distcc-config.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- /usr/bin/distcc-config 2005-04-02 16:08:44.000000000 +0100 -+++ distcc-config-adq 2005-04-07 14:06:23.000000000 +0100 -@@ -65,7 +65,22 @@ - def permissions(path,user,group): - for file in os.listdir(path): - #print 'Configuring',path+file+'...' -- os.chown(path+file,user,group) -+ os.chmod(path+file,0755) -+ -+def installoverrides(chost): -+ for file in ['gcc', 'cc', 'c++', 'g++']: -+ path = '/usr/lib/distcc/bin/' -+ if os.path.exists('/usr/bin/'+chost+'-'+file): -+ if os.path.exists(path+file): -+ os.unlink(path+file) -+ override_cmd = open(path+file, 'w') -+ override_cmd.write('#!/bin/sh\n') -+ override_cmd.write('exec '+chost+'-'+file+' \"$@\"\n'); -+ os.chown(path+file,user,group) -+ override_cmd = open(path+'cc', 'w') -+ override_cmd.write('#!/bin/sh\n') -+ override_cmd.write('exec '+chost+'-gcc'+' \"$@\"\n'); -+ os.chown(path+'cc',user,group) - - def installlinks(chost=''): - for file in ['gcc', 'cc', 'c++', 'g++']: -@@ -139,7 +154,7 @@ - makeconf = open('/etc/make.conf', 'r').read() - chost = re.compile('CHOST="(.*)"').search(makeconf).group(1) - print 'Creating symlinks...' -- installlinks() -+ installoverrides(chost) - installlinks(chost) - - print 'Checking permissions...' diff --git a/sys-devel/distcc/files/2.18/init b/sys-devel/distcc/files/2.18/init deleted file mode 100644 index 1abe4a9..0000000 --- a/sys-devel/distcc/files/2.18/init +++ /dev/null @@ -1,30 +0,0 @@ -#!/sbin/runscript -# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/files/2.18/init,v 1.1 2004/10/12 17:21:43 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 $? -} - -- cgit v1.2.3-65-gdbad