summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Welch <zwelch@gentoo.org>2003-03-17 23:34:07 +0000
committerZack Welch <zwelch@gentoo.org>2003-03-17 23:34:07 +0000
commit8fceb294413ca1455d00bd9c473281cf160556a5 (patch)
tree8ce6de52cfc870585fdbe82bff4070cf2b30c536 /sys-devel
parentmarked as stable (diff)
downloadgentoo-2-8fceb294413ca1455d00bd9c473281cf160556a5.tar.gz
gentoo-2-8fceb294413ca1455d00bd9c473281cf160556a5.tar.bz2
gentoo-2-8fceb294413ca1455d00bd9c473281cf160556a5.zip
update distcc ebuild to fix bug 17716 and add new functionality
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/distcc/ChangeLog9
-rw-r--r--sys-devel/distcc/distcc-1.2.3-r1.ebuild102
-rw-r--r--sys-devel/distcc/files/1.2.3/distcc-config246
-rw-r--r--sys-devel/distcc/files/1.2.3/info.patch14
-rw-r--r--sys-devel/distcc/files/digest-distcc-1.2.3-r11
5 files changed, 371 insertions, 1 deletions
diff --git a/sys-devel/distcc/ChangeLog b/sys-devel/distcc/ChangeLog
index a53f899f8be6..3204f8a791a8 100644
--- a/sys-devel/distcc/ChangeLog
+++ b/sys-devel/distcc/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-devel/distcc
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/ChangeLog,v 1.32 2003/03/12 05:32:40 zwelch Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/ChangeLog,v 1.33 2003/03/17 23:34:07 zwelch Exp $
+
+*distcc-1.2.3-r1 (17 Mar 2003)
+
+ 17 Mar 2003; Zach Welch <zwelch@gentoo.org> distcc-1.2.3-r1.ebuild,
+ files/1.2.3/distcc-config, files/1.2.3/info.patch:
+ Add distcc environment file and options to distcc-config to manage it
+ Fix ebuild to address defects reported in but 17716
*distcc-1.2.3 (03 Mar 2003)
diff --git a/sys-devel/distcc/distcc-1.2.3-r1.ebuild b/sys-devel/distcc/distcc-1.2.3-r1.ebuild
new file mode 100644
index 000000000000..d51d2c98dd37
--- /dev/null
+++ b/sys-devel/distcc/distcc-1.2.3-r1.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/distcc-1.2.3-r1.ebuild,v 1.1 2003/03/17 23:34:07 zwelch Exp $
+
+inherit eutils
+
+IUSE=""
+
+HOMEPAGE="http://distcc.samba.org/"
+SRC_URI="http://distcc.samba.org/ftp/distcc/distcc-${PV}.tar.bz2"
+DESCRIPTION="a program to distribute compilation of C code across several machines on a network"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~ppc ~sparc ~alpha ~hppa ~mips arm"
+
+OPV="1.2"
+LPV="1.2.1"
+
+DEPEND=">=sys-apps/portage-2.0.46-r11
+ >=sys-devel/gcc-config-1.3.1
+ sys-apps/shadow
+ dev-libs/popt"
+
+src_unpack() {
+ unpack distcc-${PV}.tar.bz2
+# cp -a distcc-${PV} distcc-${PV}.orig
+ epatch "${FILESDIR}/${PV}/wrapper.patch" || die
+ epatch "${FILESDIR}/${PV}/info.patch" || die
+}
+
+src_compile() {
+ econf || die "econf failed"
+ emake || die "emake failed"
+}
+
+src_install() {
+ make DESTDIR="${D%/}" install
+
+ insinto /usr/share/doc/${PN}
+ doins "${S}/survey.txt"
+
+ exeinto /usr/bin
+ doexe "${FILESDIR}/${PV}/distcc-config"
+
+ insinto /etc/conf.d
+ newins "${FILESDIR}/${OPV}/conf" distccd
+
+ exeinto /etc/init.d
+ newexe "${FILESDIR}/${OPV}/init" distccd
+
+ # create and keep the symlink dir
+ dodir /usr/lib/distcc/bin
+ keepdir /usr/lib/distcc/bin
+
+ # create the distccd pid directory
+ dodir /var/run/distccd
+ keepdir /var/run/distccd
+}
+
+pkg_preinst() {
+ # non-/ installs don't require us to do anything here
+ [ "${ROOT}" != "/" ] && return 0
+
+ # stop daemon since script is being updated
+ [ -n "$(pidof distccd)" -a -x /etc/init.d/distccd ] && \
+ /etc/init.d/distccd stop
+
+ # moved user creation and permissions to distcc-config script
+ # because of ROOT install requirements
+}
+
+pkg_postinst() {
+ if [ "${ROOT}" = "/" ]; then
+ einfo "Installing links to native compilers..."
+ /usr/bin/distcc-config --install-user
+ /usr/bin/distcc-config --install-links
+ /usr/bin/distcc-config --install-links "${CHOST}"
+ else
+ # distcc-config can *almost* handle ROOT installs itself
+ # but for now, but user must finsh things off
+ ewarn "*** Installation is not complete ***"
+ ewarn "You must run the following as root:"
+ ewarn " /usr/bin/distcc-config --install"
+ ewarn "after booting or chrooting into ${ROOT}"
+ fi
+
+ einfo "To use distcc with **non-Portage** C compiling, add"
+ einfo "/usr/lib/distcc/bin to your path before /usr/bin. If you're"
+ einfo "combining this with ccache, put the distcc dir AFTER ccache."
+ einfo "Portage 2.0.46-r11+ will take advantage of distcc if you put"
+ einfo "distcc into the FEATURES setting in make.conf (and define"
+ einfo "DISTCC_HOSTS as well). Do NOT set CC=distcc or similar."
+ ewarn "See http://cvs.gentoo.org/~zwelch/distcc.html for information."
+}
+
+#pkg_prerm() {
+# # ztw - not sure if this is the right place
+# distcc-config --remove-links "${CHOST}"
+# distcc-config --remove-links
+#}
+
diff --git a/sys-devel/distcc/files/1.2.3/distcc-config b/sys-devel/distcc/files/1.2.3/distcc-config
new file mode 100644
index 000000000000..384af08147f1
--- /dev/null
+++ b/sys-devel/distcc/files/1.2.3/distcc-config
@@ -0,0 +1,246 @@
+#!/bin/bash
+#
+# distcc-config - helper script for distcc and distccd
+#
+# Copyright 2003 Superlucidity Services, LLC
+# This program licensed under the GNU GPL version 2.
+#
+# This script developed by Zachary T Welch at Superlucidity Services, LLC
+# based on ideas from irc discussion and the clear need for this support
+#
+# Additional features to come; this provides a starting point
+
+
+[ -z "${ROOT}" ] && ROOT=/
+
+# distcc-config manges the DISTCC_{HOSTS,LOG,VERBOSE} settings here
+DISTCC_ENV_FILE="${ROOT}etc/env.d/04distcc"
+
+# this should be getopt'd someday
+DCCC_VERBOSE=1
+
+source /sbin/functions.sh
+
+dccc_echo() {
+ [ -n "${DCCC_VERBOSE}" ] && echo "$*"
+}
+dccc_exit() {
+ dccc_echo "$*"
+ exit 1
+}
+
+[ "$(id -u)" != 0 ] && dccc_exit "$0 must be run by root"
+
+###
+# the following functions manage the distcc symlinks
+# they allow the user or other scripts (namely gcc-config) to
+# automatically update distcc's links when upgrading toolchains
+#
+dccc_remove_link() {
+ local t="${ROOT}usr/lib/distcc/bin/${1}"
+ if [ -L ${t} ]; then
+ dccc_echo "Removing ${t}..."
+ rm -f "${t}"
+ fi
+}
+dccc_install_link() {
+ # Search the PATH for the specified compiler
+ # then create shadow link in ${ROOT}usr/lib/distcc/bin to distcc
+ # note: this `type' doesn't do the right thing if ROOT != /
+ if [ -n "$(type -p ${1})" ]; then
+ # first be sure any old link is removed
+ DCCC_VERBOSE="" dccc_remove_link "${1}"
+
+ # then create the new link
+ local t="${ROOT}usr/lib/distcc/bin/${1}"
+ dccc_echo "Creating distcc shadow link: ${t}..."
+ ln -s /usr/bin/distcc "${t}"
+ fi
+}
+dccc_links() {
+ local a
+ for a in gcc cc c++ g++ ; do
+ [ -n "${2}" ] && a="${2}-${a}"
+ eval "dccc_${1}_link" "${a}"
+ done
+}
+
+dccc_install_user() {
+ # update or create, depending on whether user already exists
+ einfo "Updating or creating distcc user..."
+ local USERFIX
+ id distcc >/dev/null 2>&1 && USERFIX=usermod || USERFIX=useradd
+ USERFIX="/usr/sbin/${USERFIX}"
+ if [ -x "${USERFIX}" ]
+ then
+ if ! ${USERFIX} -g daemon -s /bin/false -d /dev/null \
+ -c "distccd" distcc
+ then
+ dccc_exit "unable to create or modify user"
+ fi
+ elif [ "${USERFIX}" = "/usr/sbin/useradd" ]
+ then
+ ewarn "${USERFIX} not found: You need to add the distcc user"
+ ewarn "to /etc/passwd by hand. Add the following line:\n"
+ ewarn " distcc:x:240:2:distccd:/dev/null:/bin/false\n"
+ ewarn "and then run 'distcc-config --install' again root."
+ dccc_exit "Unable to create distcc user!"
+ fi
+
+ for d in ${ROOT}usr/lib/distcc/bin ${ROOT}var/run/distccd ; do
+ einfo "Configuring $d..."
+ chown distcc:daemon $d && chmod 0755 $d || \
+ dccc_exit "Unable to configure ${d}!"
+ done
+}
+
+dccc_guess_chost() {
+ echo "$(grep CHOST /etc/make.conf | \
+ grep -v '^#' | sed 's,^.*=\"\(.*\)\",\1,')"
+
+}
+
+######
+# routines for manipulating ${DISTCC_ENV_FILE}
+
+dccc_install_env() {
+ [ -f ${DISTCC_ENV_FILE} ] && return
+ einfo "Creating ${DISTCC_ENV_FILE}..."
+ cat <<_EOF_ > ${DISTCC_ENV_FILE} || \
+ dccc_exit "Unable to create ${DISTCC_ENV_FILE}..."
+# This file is managed by distcc-config; use it to change these settings.
+DISTCC_HOSTS="localhost"
+# DISTCC_VERBOSE is not set
+# DISTCC_LOG is not set
+# PATH is not set
+_EOF_
+}
+
+dccc_show_env() {
+ grep -v '^#' ${DISTCC_ENV_FILE}
+}
+
+dccc_load_defaults() {
+ rm -f ${DISTCC_ENV_FILE}
+ dccc_install_env
+}
+
+dccc_set_env() {
+ local xxENV="${1}"
+ shift
+ dccc_install_env
+ mv -f ${DISTCC_ENV_FILE} ${DISTCC_ENV_FILE}.tmp
+ # redirect the following block to create new file
+ {
+ egrep -v "${xxENV}[= ]" ${DISTCC_ENV_FILE}.tmp
+ if [ -n "${*}" ]; then
+ einfo "Setting ${xxENV}=\"${*}\""
+ echo "${xxENV}=\"${*}\""
+ else
+ einfo "Setting ${xxENV}=\"${*}\""
+ echo "# ${xxENV} is not set"
+ fi
+ } >> ${DISTCC_ENV_FILE}
+ rm -f ${DISTCC_ENV_FILE}.tmp
+ env-update
+ einfo "If you want to use these new settings in an existing shell,"
+ einfo "you need to 'source /etc/profile' to get the changes."
+}
+dccc_get_env() {
+ if [ -f ${DISTCC_ENV_FILE} ]; then
+ local xxENV="$(grep ${1} ${DISTCC_ENV_FILE} | \
+ grep -v '^#' | tail -1)"
+ echo ${xxENV#*=} | sed -e 's,^",,;s,"$,,'
+ elif [ -n "${2}" ]; then
+ echo "${2}"
+ fi
+}
+
+dccc_set_hosts() {
+ dccc_set_env DISTCC_HOSTS "${@}"
+}
+dccc_get_hosts() {
+ dccc_get_env DISTCC_HOSTS localhost
+}
+
+dccc_set_verbose() {
+ dccc_set_env DISTCC_VERBOSE ${1}
+}
+dccc_get_verbose() {
+ dccc_get_env DISTCC_VERBOSE
+}
+
+dccc_set_log() {
+ dccc_set_env DISTCC_LOG ${1}
+}
+dccc_get_log() {
+ dccc_get_env DISTCC_LOG
+}
+
+####
+# main install routine
+
+dccc_install() {
+ local xxCHOST
+ dccc_install_user
+ dccc_links install ""
+ for f in make.conf make.globals make.profile/make.defaults
+ do
+ xxCHOST="$(dccc_guess_chost /etc/${f})"
+ if [ -n "${xxCHOST}" ]; then
+ dccc_links install "${xxCHOST}"
+ break
+ fi
+ done
+
+ dccc_install_env
+}
+
+
+###
+# main routine
+
+case "${1}" in
+ --get-* )
+ eval "dccc_$(echo ${1} | sed -e 's/^--//;s/-/_/g')"
+ ;;
+ --set-* )
+ SET_FUNC="$(echo ${1} | sed -e 's/^--//;s/-/_/g')"
+ shift
+ [ "${#}" -eq 0 ] && dccc_exit "argument required"
+ eval "dccc_${SET_FUNC} ${*}"
+ ;;
+ --add-path )
+ dccc_set_env PATH "/usr/lib/distcc/bin"
+ ;;
+ --no-path )
+ dccc_set_env PATH ""
+ ;;
+ --show-env )
+ dccc_show_env
+ ;;
+ --load-defaults )
+ dccc_load_defaults
+ ;;
+ --install )
+ dccc_install
+ ;;
+ --install-user )
+ dccc_install_user
+ ;;
+ --install-links )
+ dccc_links install "${2}"
+ ;;
+ --remove-links )
+ dccc_links remove "${2}"
+ ;;
+ * )
+ echo "usage: ${0} --set-hosts $DISTCC_HOSTS | --get-hosts"
+ echo " ${0} --set-verbose { 0 | 1 } | --get-verbose"
+ echo " ${0} --set-log FILE | --get-log"
+ echo " ${0} --add-path | --no-path"
+ echo " ${0} --install-links | --remove-links } [ CHOST ]"
+ exit 1
+ ;;
+esac
+
diff --git a/sys-devel/distcc/files/1.2.3/info.patch b/sys-devel/distcc/files/1.2.3/info.patch
new file mode 100644
index 000000000000..aac642a67f48
--- /dev/null
+++ b/sys-devel/distcc/files/1.2.3/info.patch
@@ -0,0 +1,14 @@
+diff -auNr distcc-1.2.3.orig/linuxdoc/distcc.info distcc-1.2.3/linuxdoc/distcc.info
+--- distcc-1.2.3.orig/linuxdoc/distcc.info 2003-03-01 15:29:15.000000000 -0800
++++ distcc-1.2.3/linuxdoc/distcc.info 2003-03-17 15:19:05.000000000 -0800
+@@ -1,6 +1,10 @@
+ This is distcc.info, produced by makeinfo version 4.2 from
+ /tmp/linuxdoc-dir-17600/sgmltmp.distcc.info.2.
+
++START-INFO-DIR-ENTRY
++* distcc: (distcc). distributed C and C++ compiler utility
++END-INFO-DIR-ENTRY
++
+ 
+ File: distcc.info, Node: Top, Next: Overview, Up: (dir)
+
diff --git a/sys-devel/distcc/files/digest-distcc-1.2.3-r1 b/sys-devel/distcc/files/digest-distcc-1.2.3-r1
new file mode 100644
index 000000000000..2064bb1d46a2
--- /dev/null
+++ b/sys-devel/distcc/files/digest-distcc-1.2.3-r1
@@ -0,0 +1 @@
+MD5 4e6f47493d39a87d2361f72ac94673f1 distcc-1.2.3.tar.bz2 214321