summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Welch <zwelch@gentoo.org>2003-02-24 01:05:02 +0000
committerZack Welch <zwelch@gentoo.org>2003-02-24 01:05:02 +0000
commitc0648d231384aee0a556fffa783abf16df647f80 (patch)
treedfcb4b98d65f0c2f12551e2fd6fdbae8917efc25 /sys-devel
parentChanges in DEPEND (diff)
downloadgentoo-2-c0648d231384aee0a556fffa783abf16df647f80.tar.gz
gentoo-2-c0648d231384aee0a556fffa783abf16df647f80.tar.bz2
gentoo-2-c0648d231384aee0a556fffa783abf16df647f80.zip
add new distcc-1.2 ebuild
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/distcc/ChangeLog11
-rw-r--r--sys-devel/distcc/distcc-1.1-r11.ebuild4
-rw-r--r--sys-devel/distcc/distcc-1.2.ebuild97
-rw-r--r--sys-devel/distcc/files/1.2/conf12
-rw-r--r--sys-devel/distcc/files/1.2/distcc-config67
-rw-r--r--sys-devel/distcc/files/1.2/init (renamed from sys-devel/distcc/files/distccd.3)15
-rw-r--r--sys-devel/distcc/files/1.2/wrapper.patch202
-rw-r--r--sys-devel/distcc/files/digest-distcc-1.21
8 files changed, 400 insertions, 9 deletions
diff --git a/sys-devel/distcc/ChangeLog b/sys-devel/distcc/ChangeLog
index a5bb35d6f598..1c7024515640 100644
--- a/sys-devel/distcc/ChangeLog
+++ b/sys-devel/distcc/ChangeLog
@@ -1,9 +1,18 @@
# 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.27 2003/02/21 21:35:23 agriffis Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/ChangeLog,v 1.28 2003/02/24 01:05:02 zwelch Exp $
+
+*distcc-1.2 (21 Feb 2003)
+
+ 21 Feb 2003; Zach Welch <zwelch@gentoo.org> distcc-1.2.ebuild :
+ Add new version, cleanup patch from 1.1-r11
+ Add initial distcc-config script
*distcc-1.1-r11 (17 Feb 2003)
+ 21 Feb 2003; Zach Welch <zwelch@gentoo.org> distcc-1.1-r11.ebuild :
+ Remove extra cp of $S
+
19 Feb 2003; Zach Welch <zwelch@gentoo.org> distcc-1.1-r11.ebuild :
Added arm to keywords.
diff --git a/sys-devel/distcc/distcc-1.1-r11.ebuild b/sys-devel/distcc/distcc-1.1-r11.ebuild
index 844743a7f7c9..6e73e80cc9fc 100644
--- a/sys-devel/distcc/distcc-1.1-r11.ebuild
+++ b/sys-devel/distcc/distcc-1.1-r11.ebuild
@@ -1,6 +1,6 @@
# 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.1-r11.ebuild,v 1.4 2003/02/21 21:35:23 agriffis Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/distcc-1.1-r11.ebuild,v 1.5 2003/02/24 01:05:02 zwelch Exp $
inherit eutils
@@ -20,7 +20,7 @@ DEPEND=">=sys-apps/portage-2.0.46-r11
src_unpack() {
unpack distcc-${PV}.tar.bz2
- cp -a distcc-${PV} distcc-${PV}.orig
+# cp -a distcc-${PV} distcc-${PV}.orig
epatch "${FILESDIR}/wrapper-${PV}.patch"
}
diff --git a/sys-devel/distcc/distcc-1.2.ebuild b/sys-devel/distcc/distcc-1.2.ebuild
new file mode 100644
index 000000000000..89b3c761a00b
--- /dev/null
+++ b/sys-devel/distcc/distcc-1.2.ebuild
@@ -0,0 +1,97 @@
+# 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.ebuild,v 1.1 2003/02/24 01:05:02 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 arm"
+
+DEPEND=">=sys-apps/portage-2.0.46-r11
+ >=sys-devel/gcc-config-1.3.1
+ dev-libs/popt"
+
+src_unpack() {
+ unpack distcc-${PV}.tar.bz2
+# cp -a distcc-${PV} distcc-${PV}.orig
+ epatch "${FILESDIR}/${PV}/wrapper.patch"
+}
+
+src_compile() {
+ econf || die "econf failed"
+ emake || die "emake failed"
+}
+
+src_install() {
+ make DESTDIR="${D}" install
+
+ cd "${D}/usr/share/info" && rm -f distcc.info.gz
+
+ docinto "../${PN}"
+ dodoc "${S}/survey.txt"
+
+ exeinto /usr/bin
+ doexe "${FILESDIR}/${PV}/distcc-config"
+
+ insinto /etc/conf.d
+ newins "${FILESDIR}/${PV}/conf" distccd
+
+ exeinto /etc/init.d
+ newexe "${FILESDIR}/${PV}/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() {
+ # stop daemon since script is being updated
+ einfo "Stopping distccd..."
+ [ -x /etc/init.d/distccd ] && \
+ /etc/init.d/distccd stop > /dev/null 2>&1
+
+ # 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} -g daemon -s /bin/false -d /dev/null -c "distccd" distcc || die
+}
+
+pkg_postinst() {
+ local d
+ for d in /usr/lib/distcc/bin /var/run/distccd ; do
+ einfo "Configuring $d..."
+ chown distcc:daemon $d
+ chmod 0755 $d
+ done
+
+ einfo "Installing links to installed compilers..."
+ /usr/bin/distcc-config --install-links
+ /usr/bin/distcc-config --install-links "${CHOST}"
+
+ 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/conf b/sys-devel/distcc/files/1.2/conf
new file mode 100644
index 000000000000..f5ba075f483f
--- /dev/null
+++ b/sys-devel/distcc/files/1.2/conf
@@ -0,0 +1,12 @@
+# Copyright 2003 Gentoo Technologies, Inc
+# 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
+# DISTCC_OPTS="--nice 20"
+
diff --git a/sys-devel/distcc/files/1.2/distcc-config b/sys-devel/distcc/files/1.2/distcc-config
new file mode 100644
index 000000000000..35f9614db73b
--- /dev/null
+++ b/sys-devel/distcc/files/1.2/distcc-config
@@ -0,0 +1,67 @@
+#!/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
+
+# this should be getopt'd someday
+DCCC_VERBOSE=1
+
+dccc_echo() {
+ [ -n "${DCCC_VERBOSE}" ] && echo "$*"
+}
+
+###
+# 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="/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 /usr/lib/distcc/bin to distcc
+ 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="/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
+}
+
+###
+# main routine
+
+case "${1}" in
+ --install-links )
+ dccc_links install "${2}"
+ ;;
+ --remove-links )
+ dccc_links remove "${2}"
+ ;;
+ * )
+ echo "usage: ${0} {--install-links|--remove-links} [ CHOST ]"
+ ;;
+esac
+
diff --git a/sys-devel/distcc/files/distccd.3 b/sys-devel/distcc/files/1.2/init
index b567517a75e7..98408aec5278 100644
--- a/sys-devel/distcc/files/distccd.3
+++ b/sys-devel/distcc/files/1.2/init
@@ -1,24 +1,27 @@
#!/sbin/runscript
+# get our configuration options
+source /etc/conf.d/distccd
+
depend() {
need net
}
start() {
- rm -rf /var/run/distccd.pid
+ rm -f ${DISTCCD_PIDFILE}
ebegin "Starting distccd"
PATH="$(gcc-config --get-bin-path):${PATH}" \
/sbin/start-stop-daemon --start --quiet \
- --startas /usr/bin/distccd \
- -c nobody --pidfile /var/run/distccd.pid \
- -- --pid-file /var/run/distccd.pid
+ --startas ${DISTCCD_EXEC} \
+ -c distcc --pidfile ${DISTCCD_PIDFILE} \
+ -- --pid-file ${DISTCCD_PIDFILE} ${DISTCCD_OPTS}
eend $? "Failed to Start distccd"
}
stop() {
ebegin "Stopping distccd"
- start-stop-daemon --stop --quiet --pidfile /var/run/distccd.pid
- rm -rf /var/run/distccd.pid
+ start-stop-daemon --stop --quiet --pidfile "${DISTCCD_PIDFILE}"
+ rm -f "${DISTCCD_PIDFILE}"
eend $? "Failed to Stop distccd"
}
diff --git a/sys-devel/distcc/files/1.2/wrapper.patch b/sys-devel/distcc/files/1.2/wrapper.patch
new file mode 100644
index 000000000000..6678ef6eaf14
--- /dev/null
+++ b/sys-devel/distcc/files/1.2/wrapper.patch
@@ -0,0 +1,202 @@
+--- distcc-1.2.orig/src/distcc.c 2003-02-21 17:25:48.000000000 -0800
++++ distcc-1.2/src/distcc.c 2003-02-23 13:55:45.000000000 -0800
+@@ -481,6 +481,156 @@
+ }
+ }
+
++static char *dcc_safe_getcwd(void)
++{
++ char *cwdstr;
++ size_t len = 200;
++
++ do {
++ cwdstr = malloc(len);
++ if (NULL == cwdstr) break;
++
++ if (NULL == getcwd(cwdstr, len)) {
++ free(cwdstr);
++ cwdstr = NULL;
++ if (ERANGE == errno) {
++ len += 200;
++ continue;
++ }
++ }
++ } while(0);
++
++ if (NULL == cwdstr) {
++ rs_log_error("can't get working directory");
++ exit(1);
++ }
++
++ return cwdstr;
++}
++
++/**
++ * Filter PATH past point that wrapper was called
++ */
++static void dcc_wrapper_trunc_path(char *progname, char *path, char *argv[])
++{
++ static const char *envpath = "PATH=";
++ const char *p;
++ char *n, *str;
++ char *ppath = NULL;
++ int len, maxlen, plen = 0;
++
++ maxlen = strlen(path) + strlen(envpath) + 1;
++ str = malloc(maxlen);
++ if (NULL == str) exit(1);
++
++ /* if we were called explicitly, find the (partial) path */
++ if (progname != argv[0]) {
++ /* eliminate this explicit path from PATH */
++ char *cwdstr = NULL;
++ size_t cwdlen = 0;
++
++ if ('/' != argv[0][0]) {
++ cwdstr = dcc_safe_getcwd();
++ cwdlen = strlen(cwdstr);
++ /* or we could just error out and exit??? */
++ }
++
++ plen = progname - argv[0] - 1;
++ len = cwdlen + plen;
++ ppath = malloc(len);
++ if (NULL == ppath) exit(1);
++
++ ppath[0] = 0;
++ if (NULL != cwdstr) {
++ strncpy(ppath, cwdstr, len);
++ ppath[cwdlen++] = '/';
++ ppath[cwdlen] = 0;
++ free(cwdstr);
++ }
++ strncat(ppath, argv[0], cwdlen + plen);
++ rs_trace("looking for explicit path: %s\n", ppath);
++ }
++ else
++ ppath = NULL;
++
++ for (p = n = path; NULL != n; p = n ? n + 1 : NULL) {
++ n = strchr(p, ':');
++ if (NULL != n)
++ len = n - p;
++ else
++ len = strlen(p);
++
++ if (NULL != ppath) {
++ /* check for partial path name match,
++ pmatch is last portion of path */
++ rs_trace("checking for ppath in %s\n", p);
++ if (len != plen || 0 != strncmp(p, ppath, len))
++ continue;
++ }
++ else {
++ strncpy(str, p, len);
++ snprintf(str + len, maxlen - len, "/%s", progname);
++ rs_trace("checking %s\n", str);
++ if (0 != access(str, X_OK))
++ continue;
++ rs_trace("found %s\n", str);
++ }
++ /* getting here means either we found the path we ran in, or
++ we found the target program we're trying to run;
++ so PATH now starts at next entry */
++ if (NULL != n)
++ p = n + 1;
++ else
++ p = "";
++ break;
++ }
++
++ /* if temp path, p, still contains something, reset PATH;
++ p will be NULL if relative or non-PATH invocation, so
++ the current path is probably free from recursion */
++ if (NULL != p) {
++ strncpy(str, envpath, maxlen);
++ strncat(str, p, maxlen);
++ rs_trace("wrapper is setting %s\n", str);
++ n = strdup(str);
++ if ((NULL == n) || (-1 == putenv(n))) {
++ rs_log_error("putenv PATH failed");
++ exit(1);
++ }
++ }
++ else
++ rs_trace("wrapper not modifying PATH");
++
++ free(str);
++ free(ppath);
++}
++
++static char *dcc_support_wrapper(char *argv[])
++{
++ char *progname, *envstr;
++
++ /* see if program was called with a full or partial path */
++ if ((progname = strrchr(argv[0], '/')) != NULL)
++ progname++;
++ else
++ progname = argv[0];
++
++ if (NULL == (envstr = getenv("DISTCC_HOSTS"))) {
++ char localonly[] = "DISTCC_HOSTS=localhost";
++ if (-1 == putenv(localonly)) {
++ rs_log_error("unable to set default DISTCC_HOSTS");
++ exit(1);
++ }
++ }
++
++ /* right now, we're only playing with path... but
++ wouldn't it be interesting to look at CHOST, too? */
++ if (NULL != (envstr = getenv("PATH")))
++ dcc_wrapper_trunc_path(progname, envstr, argv);
++
++ return progname;
++}
++
+
+ /**
+ * distcc client entry point.
+@@ -490,6 +640,7 @@
+ * Performs basic setup and checks for distcc arguments, and then kicks of
+ * dcc_build_somewhere().
+ **/
++#include <libgen.h>
+ int main(int argc, char **argv)
+ {
+ int status;
+@@ -499,17 +650,25 @@
+
+ dcc_set_trace_from_env();
+
+- if (argc <= 1 || !strcmp(argv[1], "--help")) {
+- dcc_show_usage();
+- exit(0);
+- } else if (!strcmp(argv[1], "--version")) {
+- dcc_show_version("distcc");
+- exit(0);
+- }
+-
+ dcc_recursion_safeguard();
+
+- dcc_find_compiler(argv, &compiler_args);
++ if (NULL != strstr(basename(argv[0]), "distcc")) {
++
++ if (argc <= 1 || !strcmp(argv[1], "--help")) {
++ dcc_show_usage();
++ exit(0);
++ } else if (!strcmp(argv[1], "--version")) {
++ dcc_show_version("distcc");
++ exit(0);
++ }
++
++ dcc_find_compiler(argv, &compiler_args);
++ }
++ else {
++ char *progname = dcc_support_wrapper(argv);
++ dcc_shallowcopy_argv(argv, &compiler_args, 0);
++ compiler_args[0] = progname;
++ }
+
+ dcc_exit(dcc_build_somewhere(compiler_args, &status));
+ }
diff --git a/sys-devel/distcc/files/digest-distcc-1.2 b/sys-devel/distcc/files/digest-distcc-1.2
new file mode 100644
index 000000000000..508bb7541ab3
--- /dev/null
+++ b/sys-devel/distcc/files/digest-distcc-1.2
@@ -0,0 +1 @@
+MD5 aa6faaa5b610a334e62ac8963c031e0c distcc-1.2.tar.bz2 220973