diff options
author | Matsuu Takuto <matsuu@gentoo.org> | 2008-10-18 16:21:59 +0000 |
---|---|---|
committer | Matsuu Takuto <matsuu@gentoo.org> | 2008-10-18 16:21:59 +0000 |
commit | cf0a5750b688e5a38283a96440c57678fa1da382 (patch) | |
tree | 441f06bc00895168d549bba3c119a1dfbb5c7218 /sys-devel/distcc | |
parent | Stable on amd64 (bug #239543) (diff) | |
download | gentoo-2-cf0a5750b688e5a38283a96440c57678fa1da382.tar.gz gentoo-2-cf0a5750b688e5a38283a96440c57678fa1da382.tar.bz2 gentoo-2-cf0a5750b688e5a38283a96440c57678fa1da382.zip |
Version bumped and clean up, bug #234312.
(Portage version: 2.2_rc12/cvs/Linux 2.6.27-gentoo x86_64)
Diffstat (limited to 'sys-devel/distcc')
-rw-r--r-- | sys-devel/distcc/ChangeLog | 9 | ||||
-rw-r--r-- | sys-devel/distcc/distcc-3.0.ebuild | 154 | ||||
-rw-r--r-- | sys-devel/distcc/files/3.0/conf | 40 | ||||
-rw-r--r-- | sys-devel/distcc/files/3.0/distcc-config | 164 | ||||
-rwxr-xr-x | sys-devel/distcc/files/3.0/init | 23 | ||||
-rw-r--r-- | sys-devel/distcc/files/distcc-3.0-gentoo.patch | 33 |
6 files changed, 422 insertions, 1 deletions
diff --git a/sys-devel/distcc/ChangeLog b/sys-devel/distcc/ChangeLog index f6a3ff09a326..918f702c0a8b 100644 --- a/sys-devel/distcc/ChangeLog +++ b/sys-devel/distcc/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-devel/distcc # Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/ChangeLog,v 1.174 2008/08/17 03:24:18 mr_bones_ Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/ChangeLog,v 1.175 2008/10/18 16:21:59 matsuu Exp $ + +*distcc-3.0 (18 Oct 2008) + + 18 Oct 2008; MATSUU Takuto <matsuu@gentoo.org> +files/3.0/conf, + +files/3.0/init, +files/distcc-3.0-gentoo.patch, +files/3.0/distcc-config, + +distcc-3.0.ebuild: + Version bumped and clean up, bug #234312. 17 Aug 2008; Michael Sterrett <mr_bones_@gentoo.org> distcc-2.18.3-r10.ebuild, distcc-2.18.3-r11.ebuild, diff --git a/sys-devel/distcc/distcc-3.0.ebuild b/sys-devel/distcc/distcc-3.0.ebuild new file mode 100644 index 000000000000..c87a5b1e57f1 --- /dev/null +++ b/sys-devel/distcc/distcc-3.0.ebuild @@ -0,0 +1,154 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/distcc-3.0.ebuild,v 1.1 2008/10/18 16:21:59 matsuu Exp $ + +# If you change this in any way please email lisa@gentoo.org and make an +# entry in the ChangeLog (this means you spanky :P). (2004-04-11) Lisa Seelye + +inherit eutils fdo-mime flag-o-matic multilib toolchain-funcs + +DESCRIPTION="a program to distribute compilation of C code across several machines on a network" +HOMEPAGE="http://distcc.org/" +SRC_URI="http://distcc.googlecode.com/files/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd" +IUSE="avahi gnome gtk ipv6 selinux" + +RESTRICT="test" + +RDEPEND=">=dev-lang/python-2.4 + dev-libs/popt + avahi? ( >=net-dns/avahi-0.6 ) + gnome? ( + >=gnome-base/libgnome-2 + >=gnome-base/libgnomeui-2 + >=x11-libs/gtk+-2 + x11-libs/pango + ) + gtk? ( + >=x11-libs/gtk+-2 + )" +DEPEND="${RDEPEND} + dev-util/pkgconfig" +RDEPEND="${RDEPEND} + !net-misc/pump + >=sys-devel/gcc-config-1.3.1 + selinux? ( sec-policy/selinux-distcc )" + +pkg_setup() { + if use ipv6; then + ewarn "To use IPv6 you must have IPv6 compiled into your kernel" + ewarn "either via a module or compiled code" + ewarn "You can recompile without ipv6 with: USE='-ipv6' emerge distcc" + epause 5 + fi + + enewuser distcc 240 -1 -1 daemon +} + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}/${P}-gentoo.patch" +} + +src_compile() { + # More legacy stuff? + [ "$(gcc-major-version)" = "2" ] && filter-lfs-flags + + # -O? is required + [ "${CFLAGS/-O}" = "${CFLAGS}" ] && CFLAGS="${CFLAGS} -O2" + + econf \ + $(use_with avahi) \ + $(use_with gtk) \ + $(use_with gnome) \ + $(use_enable ipv6 rfc2553) \ + --with-docdir="/usr/share/doc/${PF}" || die "econf failed" + emake || die "emake failed" +} + +src_install() { + emake DESTDIR="${D}" install || die + + dobin "${FILESDIR}/${PV}/distcc-config" + + newinitd "${FILESDIR}/${PV}/init" distccd + cp "${FILESDIR}/${PV}/conf" "${T}/conf" + if use avahi; then + ( + echo + echo '# Enable zeroconf support in distccd' + echo 'DISTCCD_OPTS="${DISTCCD_OPTS} --zeroconf"' + ) >> "${T}/conf" + fi + newconfd "${T}/conf" distccd + + # create the masquerade directory + local DCCC_PATH="/usr/$(get_libdir)/distcc/bin/" + dodir "${DCCC_PATH}" + for f in cc c++ gcc g++; do + dosym /usr/bin/distcc "${DCCC_PATH}${f}" + if [ "${f}" != "cc" ]; then + dosym /usr/bin/distcc "${DCCC_PATH}${CTARGET:-${CHOST}}-${f}" + fi + done + + # create the distccd pid directory + keepdir /var/run/distccd + fowners distcc:daemon /var/run/distccd + + if use gnome || use gtk; then + einfo "Renaming /usr/bin/distccmon-gnome to /usr/bin/distccmon-gui" + einfo "This is to have a little sensability in naming schemes between distccmon programs" + mv "${D}/usr/bin/distccmon-gnome" "${D}/usr/bin/distccmon-gui" || die + dosym distccmon-gui /usr/bin/distccmon-gnome + fi + + rm -rf "${D}/etc/default" + rm -f "${D}/etc/distcc/clients.allow" + rm -f "${D}/etc/distcc/commands.allow.sh" + prepalldocs +} + +pkg_postinst() { + use gnome && fdo-mime_desktop_database_update + + # By now everyone should be using the right envfile + if [ "${ROOT}" = "/" ]; then + einfo "Installing links to native compilers..." + /usr/bin/distcc-config --install + else + # distcc-config can *almost* handle ROOT installs itself + # but for now, but user must finsh things off + elog "*** Installation is not complete ***" + elog "You must run the following as root:" + elog " /usr/bin/distcc-config --install" + elog "after booting or chrooting into ${ROOT}" + fi + + elog + elog "Tips on using distcc with Gentoo can be found at" + elog "http://www.gentoo.org/doc/en/distcc.xml" + elog + elog "To use the distccmon programs with Gentoo you should use this command:" + elog "# DISTCC_DIR=\"${DISTCC_DIR}\" distccmon-text 5" + + if use gnome || use gtk; then + elog "Or:" + elog "# DISTCC_DIR=\"${DISTCC_DIR}\" distccmon-gnome" + fi + + elog + elog "***SECURITY NOTICE***" + elog "If you are upgrading distcc please make sure to run etc-update to" + elog "update your /etc/conf.d/distccd and /etc/init.d/distccd files with" + elog "added security precautions (the --listen and --allow directives)" + elog +} + +pkg_postrm() { + use gnome && fdo-mime_desktop_database_update +} diff --git a/sys-devel/distcc/files/3.0/conf b/sys-devel/distcc/files/3.0/conf new file mode 100644 index 000000000000..eb784c3ac88b --- /dev/null +++ b/sys-devel/distcc/files/3.0/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_OPTS="${DISTCCD_OPTS} -N 15" diff --git a/sys-devel/distcc/files/3.0/distcc-config b/sys-devel/distcc/files/3.0/distcc-config new file mode 100644 index 000000000000..ae5424f95c13 --- /dev/null +++ b/sys-devel/distcc/files/3.0/distcc-config @@ -0,0 +1,164 @@ +#!/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/3.0/distcc-config,v 1.1 2008/10/18 16:21:59 matsuu 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, 0755) + +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.isfile(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('/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/3.0/init b/sys-devel/distcc/files/3.0/init new file mode 100755 index 000000000000..0c1e62711286 --- /dev/null +++ b/sys-devel/distcc/files/3.0/init @@ -0,0 +1,23 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/files/3.0/init,v 1.1 2008/10/18 16:21:59 matsuu Exp $ + +depend() { + need net + use avahi-daemon ypbind +} + +start() { + ebegin "Starting distccd" + PATH="$(gcc-config --get-bin-path):${PATH}" \ + start-stop-daemon --start --quiet --exec "${DISTCCD_EXEC}" -- \ + --pid-file "${DISTCCD_PIDFILE}" --user distcc ${DISTCCD_OPTS} + eend $? +} + +stop() { + ebegin "Stopping distccd" + start-stop-daemon --stop --quiet --pidfile "${DISTCCD_PIDFILE}" + eend $? +} diff --git a/sys-devel/distcc/files/distcc-3.0-gentoo.patch b/sys-devel/distcc/files/distcc-3.0-gentoo.patch new file mode 100644 index 000000000000..e2464dfa5abc --- /dev/null +++ b/sys-devel/distcc/files/distcc-3.0-gentoo.patch @@ -0,0 +1,33 @@ +diff -Naur distcc-3.0.orig/include_server/c_extensions/distcc_pump_c_extensions_module.c distcc-3.0/include_server/c_extensions/distcc_pump_c_extensions_module.c +--- distcc-3.0.orig/include_server/c_extensions/distcc_pump_c_extensions_module.c 2008-08-07 05:52:20.000000000 +0900 ++++ distcc-3.0/include_server/c_extensions/distcc_pump_c_extensions_module.c 2008-10-14 22:34:38.000000000 +0900 +@@ -23,17 +23,18 @@ + + #include "Python.h" + +-static char *version = ".01"; ++static const char *version = ".01"; + + /* To suppress compiler warnings */ + #define UNUSED(v) ((void)&v) + +-char *rs_program_name = "distcc_include_server"; ++const char *rs_program_name = "distcc_include_server"; + + #include "distcc.h" + #include "rpc.h" + + static PyObject *distcc_pump_c_extensionsError; ++void initdistcc_pump_c_extensions(void); + + + /*********************************************************************** +@@ -385,7 +386,7 @@ + PyObject *module; + PyObject *py_str; + distcc_pump_c_extensionsError = PyErr_NewException( +- "distcc_pump_c_extensions.Error", NULL, NULL); ++ (char *)"distcc_pump_c_extensions.Error", NULL, NULL); + + module = Py_InitModule4("distcc_pump_c_extensions", + methods, |