diff options
author | Lisa M. Seelye <lisa@gentoo.org> | 2003-09-24 00:46:08 +0000 |
---|---|---|
committer | Lisa M. Seelye <lisa@gentoo.org> | 2003-09-24 00:46:08 +0000 |
commit | 1d859ddb5a8dc7565b9fbbc17b6990a86e7e2d32 (patch) | |
tree | 64df07093cf9a4e4c0d3af2163f4969a124961f8 /sys-devel/distcc/files | |
parent | Version bump, and it now requires Portage-2.0.49-r6 or greater. (sorry this t... (diff) | |
download | gentoo-2-1d859ddb5a8dc7565b9fbbc17b6990a86e7e2d32.tar.gz gentoo-2-1d859ddb5a8dc7565b9fbbc17b6990a86e7e2d32.tar.bz2 gentoo-2-1d859ddb5a8dc7565b9fbbc17b6990a86e7e2d32.zip |
Version bump, and it now requires Portage-2.0.49-r6 or greater. (sorry this took so long -r3 users)
Diffstat (limited to 'sys-devel/distcc/files')
-rw-r--r-- | sys-devel/distcc/files/2.11/conf | 21 | ||||
-rw-r--r-- | sys-devel/distcc/files/2.11/distcc-config | 324 | ||||
-rw-r--r-- | sys-devel/distcc/files/2.11/init | 27 | ||||
-rw-r--r-- | sys-devel/distcc/files/digest-distcc-2.11 | 1 |
4 files changed, 373 insertions, 0 deletions
diff --git a/sys-devel/distcc/files/2.11/conf b/sys-devel/distcc/files/2.11/conf new file mode 100644 index 000000000000..ab0b752c548e --- /dev/null +++ b/sys-devel/distcc/files/2.11/conf @@ -0,0 +1,21 @@ +# Copyright 2003 Gentoo Technologies, Inc +# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/files/2.11/conf,v 1.1 2003/09/24 00:46:02 lisa Exp $ +# distccd configuration file + +# 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="--port 3632" + +# set this for niceness +# Default is 15 +DISTCCD_NICE="15" + +# This is the path that distccd and the monitors will look +# for the state files. +DISTCC_DIR="/var/tmp/distccd" diff --git a/sys-devel/distcc/files/2.11/distcc-config b/sys-devel/distcc/files/2.11/distcc-config new file mode 100644 index 000000000000..72fdff6b662e --- /dev/null +++ b/sys-devel/distcc/files/2.11/distcc-config @@ -0,0 +1,324 @@ +#!/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 +# +# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/files/2.11/distcc-config,v 1.1 2003/09/24 00:46:02 lisa Exp $ +# Changelog +# +# 21 Jul 2003 - Changed install environment to EXCLUDE DISTCC_HOSTS from /etc/env.d/02distcc. +# The hosts are stored by default to /etc/distcc/hosts. <lisa@gentoo.org> + +[ -z "${ROOT}" ] && ROOT=/ + +# distcc-config manges the DISTCC_{HOSTS,LOG,VERBOSE} settings here +# moved to accomodate 02ccache and leave 0[14]* free +DCCC_ENV_FILE="${ROOT}etc/env.d/02distcc" +DCCC_OLD_ENV="${ROOT}etc/env.d/04distcc" + +is_super_user() { + [ "$(id -u)" = 0 ] +} +# this should be getopt'd someday (override with DCCC_QUIET) +DCCC_VERBOSE=1 + +source /sbin/functions.sh + +dccc_echo() { + [ -z "${DCCC_QUIET}" -a -n "${DCCC_VERBOSE}" ] && echo "$*" +} +dccc_exit() { + dccc_echo "$*" + exit 1 +} + +# create the appropriate configuration directory +is_super_user && \ + DCCC_HOSTS_FILE="${ROOT}etc/distcc/hosts" || \ + DCCC_HOSTS_FILE="${ROOT}${HOME#/}/.distcc/hosts" +mkdir -p $(dirname ${DCCC_HOSTS_FILE}) || \ + dccc_exit "unable to create configuration directory" + + +### +# 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_QUIET=1 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 ${DCCC_ENV_FILE} + +dccc_install_env() { + [ -f ${DCCC_OLD_ENV} ] && mv ${DCCC_OLD_ENV} ${DCCC_ENV_FILE} + [ -f ${DCCC_ENV_FILE} ] && return + einfo "Creating ${DCCC_ENV_FILE}..." + cat <<_EOF_ > ${DCCC_ENV_FILE} || \ + dccc_exit "Unable to create ${DCCC_ENV_FILE}..." +# This file is managed by distcc-config; use it to change these settings. +# DISTCC_VERBOSE is not set +# DISTCC_LOG is not set +# DCCC_PATH is not set +_EOF_ +} + +dccc_show_env() { + grep -v '^#' ${DCCC_ENV_FILE} | sed -e 's,^,export ,' +} + +dccc_test_env() { + dccc_show_env | grep "$1" | tail -1 | sed -e "s,${1}=,," +} + +dccc_load_defaults() { + rm -f ${DCCC_ENV_FILE} + dccc_install_env +} + +dccc_set_env() { + local xxENV="${1}" + shift + dccc_install_env + mv -f ${DCCC_ENV_FILE} ${DCCC_ENV_FILE}.tmp + if [ -n "${*}" ]; then + einfo "Setting ${xxENV}=\"${*}\"" + else + einfo "Clearing ${xxENV}" + fi + # redirect the following block to create new file + { + egrep -v "${xxENV}[= ]" ${DCCC_ENV_FILE}.tmp + if [ -n "${*}" ]; then + echo "${xxENV}=\"${*}\"" + else + echo "# ${xxENV} is not set" + fi + } >> ${DCCC_ENV_FILE} + rm -f ${DCCC_ENV_FILE}.tmp +} +dccc_regen_env() { + env-update + if [ -z "${DCCC_NO_WARN}" ]; then + einfo "If you want to use these new settings in an existing shell," + einfo "you need to 'source /etc/profile' to get the changes." + fi +} + +dccc_get_env() { + if [ -f ${DCCC_ENV_FILE} ]; then + local xxENV="$(grep ${1} ${DCCC_ENV_FILE} | \ + grep -v '^#' | tail -1)" + echo ${xxENV#*=} | sed -e 's,^",,;s,"$,,' + elif [ -n "${2}" ]; then + echo "${2}" + fi +} + +dccc_set_hosts() { + echo "${*}" > $DCCC_HOSTS_FILE +} +dccc_get_hosts() { + cat $DCCC_HOSTS_FILE +} + +dccc_set_verbose() { + dccc_set_env DISTCC_VERBOSE ${1} + dccc_regen_env +} +dccc_get_verbose() { + dccc_get_env DISTCC_VERBOSE +} + +dccc_set_log() { + dccc_set_env DISTCC_LOG ${1} + dccc_regen_env +} +dccc_get_log() { + dccc_get_env DISTCC_LOG +} + +dccc_set_j() { + local j="$(echo ${1} | sed -e 's,[^0-9],,g')" + [ -z "${j}" ] && \ + dccc_exit "$0: invalid -j option (must be a number)" + dccc_set_env MAKEOPTS "-j${j}" + dccc_regen_env +} +dccc_get_j() { + dccc_get_env MAKEOPTS +} + +#### +# 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 + +# helper checks that user has privs +must_be_root() { + if ! is_super_user + then + [ -n "${1}" -a "${1}" = "${2}" ] && return + dccc_exit "$0 $1 must be run by root" + fi +} + + +# The --no-profile-warning option is meant to be used with +# the following helper function (add to ~/.bashrc) +# +# distcc-config() { +# command distcc-config --no-profile-warning "$@" && \ +# source /etc/profile +# } + +if [ "${1}" = "--no-profile-warning" ]; then + DCCC_NO_WARN=1 + shift +fi + +case "${1}" in + --get-* ) + eval "dccc_$(echo ${1} | sed -e 's/^--//;s/-/_/g')" + ;; + --set-* ) + must_be_root "--set-hosts" "${1}" + SET_FUNC="$(echo ${1} | sed -e 's/^--//;s/-/_/g')" + shift + [ "${#}" -eq 0 ] && dccc_exit "argument required" + eval "dccc_${SET_FUNC} ${*}" + ;; + --has-path ) + dccc_test_env DCCC_PATH + ;; + --add-path ) + must_be_root + dccc_set_env DCCC_PATH "/usr/lib/distcc/bin" + dccc_regen_env + if [ -z "${DCCC_NO_WARN}" ]; then + einfo "You must then set PATH=\"${DCCC_PATH}/\${PATH}\"" + fi + ;; + --no-path ) + must_be_root + dccc_set_env DCCC_PATH "" + dccc_regen_env + ;; + --show-env ) + dccc_show_env + ;; + --load-defaults ) + must_be_root + dccc_load_defaults + ;; + --install ) + must_be_root + dccc_install + ;; + --install-user ) + must_be_root + dccc_install_user + ;; + --install-links ) + must_be_root + dccc_links install "${2}" + ;; + --remove-links ) + must_be_root + 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/2.11/init b/sys-devel/distcc/files/2.11/init new file mode 100644 index 000000000000..de7333e3fdd3 --- /dev/null +++ b/sys-devel/distcc/files/2.11/init @@ -0,0 +1,27 @@ +#!/sbin/runscript +# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/files/2.11/init,v 1.1 2003/09/24 00:46:02 lisa Exp $ + +depend() { + need net +} + +start() { + rm -f ${DISTCCD_PIDFILE} + ebegin "Starting distccd" + DISTCC_DIR="${DISTCC_DIR}" \ + 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.11 b/sys-devel/distcc/files/digest-distcc-2.11 new file mode 100644 index 000000000000..dadd02017bde --- /dev/null +++ b/sys-devel/distcc/files/digest-distcc-2.11 @@ -0,0 +1 @@ +MD5 f3458779c13255d88ee89ea7ccddda29 distcc-2.11.tar.bz2 249365 |