aboutsummaryrefslogtreecommitdiffstats
path: root/main/distcc
diff options
context:
space:
mode:
Diffstat (limited to 'main/distcc')
-rw-r--r--main/distcc/APKBUILD46
-rw-r--r--main/distcc/distcc-3.1-clone.patch14
-rw-r--r--main/distcc/distcc-hardened.patch24
-rw-r--r--main/distcc/distccd.confd45
-rw-r--r--main/distcc/distccd.initd38
5 files changed, 167 insertions, 0 deletions
diff --git a/main/distcc/APKBUILD b/main/distcc/APKBUILD
new file mode 100644
index 0000000000..002885ea05
--- /dev/null
+++ b/main/distcc/APKBUILD
@@ -0,0 +1,46 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=distcc
+pkgver=3.1
+pkgrel=1
+pkgdesc="A distributed C, C++, Obj C compiler"
+url="http://distcc.org"
+license="GPL-2"
+depends="popt"
+makedepends="popt-dev"
+source="http://$pkgname.googlecode.com/files/$pkgname-$pkgver.tar.bz2
+ distcc-3.1-clone.patch
+ distcc-hardened.patch
+ distccd.initd distccd.confd"
+subpackages="$pkgname-doc"
+
+build ()
+{
+ cd "$srcdir/$pkgname-$pkgver"
+ for i in ../*.patch; do
+ msg "applying $i"
+ patch -p1 < $i || return 1
+ done
+ ./configure --prefix=/usr \
+ --without-gtk \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man
+
+ make || return 1
+ make DESTDIR="$pkgdir" install
+
+ install -D -m644 ../distccd.confd "$pkgdir"/etc/conf.d/distccd
+ install -D -m755 ../distccd.initd "$pkgdir"/etc/init.d/distccd
+
+ local d="$pkgdir/usr/lib/$pkgname/bin"
+ mkdir -p "$d"
+ ln -sf /usr/bin/$pkgname "$d"/cc
+ ln -sf /usr/bin/$pkgname "$d"/gcc
+ ln -sf /usr/bin/$pkgname "$d"/g++
+ ln -sf /usr/bin/$pkgname "$d"/cpp
+}
+
+md5sums="a1a9d3853df7133669fffec2a9aab9f3 distcc-3.1.tar.bz2
+29fe296aa2985eea7af7402f421db187 distcc-3.1-clone.patch
+351ca958ff4869f8a2795d8ca6647de1 distcc-hardened.patch
+5cf566965873279fedc16934a2ba6cd0 distccd.initd
+e9e0ccc9f5813b9c3c88c8687b2ebc73 distccd.confd"
diff --git a/main/distcc/distcc-3.1-clone.patch b/main/distcc/distcc-3.1-clone.patch
new file mode 100644
index 0000000000..70e8f8351f
--- /dev/null
+++ b/main/distcc/distcc-3.1-clone.patch
@@ -0,0 +1,14 @@
+--- distcc-3.1.orig/lzo/minilzo.c Mon Jan 12 09:05:53 2009
++++ distcc-3.1/lzo/minilzo.c Mon Jan 12 10:27:02 2009
+@@ -1298,9 +1298,9 @@
+ #if defined(__LZO_CHECKER)
+ return 0;
+ #else
+- const int clone[] = {1, 2, 0};
++ const int _clone[] = {1, 2, 0};
+ const int *q;
+- q = clone;
++ q = _clone;
+ return (*q) ? 0 : 1;
+ #endif
+ }
diff --git a/main/distcc/distcc-hardened.patch b/main/distcc/distcc-hardened.patch
new file mode 100644
index 0000000000..69b3a65169
--- /dev/null
+++ b/main/distcc/distcc-hardened.patch
@@ -0,0 +1,24 @@
+From: Gordon Malm <gengor@gentoo.org>
+
+Make distcc client pass -D__KERNEL__ macro. Hardened GCC uses this
+macro to determine if code intended to be run in-kernel is being compiled.
+If the code is kernel code, certain compile flags are not applied.
+
+When using distcc to build kernel code (modules, etc.) without this patch,
+the distccd host doesn't get passed -D__KERNEL__. Consequently, gcc on
+the distccd host applies all kinds of flags that it shouldn't.
+
+--- distcc-2.18.3/src/strip.c
++++ distcc-2.18.3-hardened/src/strip.c
+@@ -73,7 +73,10 @@ int dcc_strip_local_args(char **from, ch
+ /* skip through argv, copying all arguments but skipping ones that
+ * ought to be omitted */
+ for (from_i = to_i = 0; from[from_i]; from_i++) {
+- if (str_equal("-D", from[from_i])
++ if (str_equal("-D__KERNEL__", from[from_i])) {
++ to[to_i++] = from[from_i];
++ }
++ else if (str_equal("-D", from[from_i])
+ || str_equal("-I", from[from_i])
+ || str_equal("-U", from[from_i])
+ || str_equal("-L", from[from_i])
diff --git a/main/distcc/distccd.confd b/main/distcc/distccd.confd
new file mode 100644
index 0000000000..b4e72b6c15
--- /dev/null
+++ b/main/distcc/distccd.confd
@@ -0,0 +1,45 @@
+# /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"
+
+#ifdef AVAHI
+# Enable zeroconf support in distccd
+DISTCCD_AVAHI="no"
+#endif
diff --git a/main/distcc/distccd.initd b/main/distcc/distccd.initd
new file mode 100644
index 0000000000..c1490fae31
--- /dev/null
+++ b/main/distcc/distccd.initd
@@ -0,0 +1,38 @@
+#!/sbin/runscript
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/files/2.18-r1/init,v 1.1 2008/01/04 03:53:15 betelgeuse Exp $
+
+depend() {
+ local avahi
+#ifdef AVAHI
+ [ ${DISTCCD_AVAHI} = yes ] && avahi="avahi-daemon"
+#endif
+ need net ${avahi}
+ use ypbind
+}
+
+start() {
+ [ -e "${DISTCCD_PIDFILE}" ] && rm -f ${DISTCCD_PIDFILE} &>/dev/null
+
+ local args
+#ifdef AVAHI
+ [ ${DISTCCD_AVAHI} = yes ] && args="--zeroconf"
+#endif
+
+ ebegin "Starting distccd"
+ chown distcc `dirname ${DISTCCD_PIDFILE}` >/dev/null 2>&1
+ TMPDIR="${TMPDIR}" \
+ /sbin/start-stop-daemon --start --quiet --exec ${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 $?
+}
+