distcc stable port information

Package: distcc
Version: 2.18.3
Revision: 1031
Description: Distributed compilation tool
License: GPL
Maintainer: Benjamin Reed

Depends: <<
daemonic,
libgettext3-shlibs,
libhowl-shlibs (>= 1.0.0-11),
libiconv,
passwd (>= 20031013-1),
popt-shlibs
<<
BuildDepends: <<
libgettext3-dev,
libhowl-dev (>= 1.0.0-11),
libiconv-dev,
libxml2,
passwd (>= 20031013-1),
pkgconfig,
popt
<<
Suggests: ccache

CustomMirror: <<
Primary: http://ranger.users.finkproject.org/distfiles
eur-NL: http://ranger.users.finkproject.org/distfiles
nam-US: http://ranger.befunk.com/fink
nam-US: http://astrange.ithinksw.net/~astrange/ranger-fink
nam-CA: http://www.southofheaven.net/befunk
<<
Source: mirror:custom:%n-%v-patched.tar.bz2
Source-MD5: b301583cfc9c757d6d27648e40db1682
SourceDirectory: %n-%v
PatchScript: sed -e 's,@FINKPREFIX@,%p,g' %a/%n.patch | patch -p1

SetCPPFLAGS: -I./src -I./lzo -I%p/include -I%p/include/howl
SetLIBS: -L%p/lib
NoSetCPPFLAGS: true
ConfigureParams: --mandir=%p/share/man --infodir=%p/share/info --disable-dependency-tracking
CompileScript: <<
#!/bin/sh -ev
unset DISTCC_HOSTS
unset CCACHE_PREFIX
unset CCACHE_PATH
export CCACHE_DISABLE=1
./configure %c
perl -pi -e 's,#define WITH_GNOME.*,#undef WITH_GNOME,g; s,#define WITH_GTK.*,#undef WITH_GTK,g;' src/config.h
make
<<

InstallScript: <<
#!/bin/sh -ev
unset DISTCC_HOSTS
unset CCACHE_PREFIX
unset CCACHE_PATH
export CCACHE_DISABLE=1
make install DESTDIR=%d

install -d -m 755 %i/etc
mv distcc.conf %i/etc/
mv distccd.conf %i/etc/

install -d -m 755 %i/bin
mv distccd-fink.sh %i/bin/
chmod 755 %i/bin/distccd-fink.sh

install -d -m 755 %i/etc/profile.d
mv distcc-default.* distcc.sh distcc.csh %i/etc/profile.d/
chmod 755 %i/etc/profile.d/*

DARWINVER=`uname -r | cut -d. -f1`
install -d -m 755 %i/var/lib/distcc/translated
install -d -m 755 %i/var/lib/distcc/untranslated
install -c -m 755 gcc-translator.pl %i/var/lib/distcc/
pushd %i/var/lib/distcc
for arch in powerpc i386; do
for version in "" "-3.3" "-4.0"; do
for gcc in cc c++ gcc g++; do
ln -sf "%p/var/lib/distcc/gcc-translator.pl" "translated/${arch}-apple-darwin${DARWINVER}-${gcc}${version}"
ln -sf "/usr/bin/${gcc}${version}" "untranslated/${arch}-apple-darwin${DARWINVER}-${gcc}${version}"
done
done
done
popd
<<
DocFiles: AUTHORS COPYING* INSTALL NEWS README*
SplitOff: <<
Package: %N-default
Description: Enable distcc+ccache by default
Depends: <<
%N (>= %v-%r),
ccache (>= 2.2-0),
ccache-default (>= 2.2-0)
<<
DocFiles: COPYING*
Files: %p/etc/profile.d/distcc-default*
<<

PostInstScript: <<
mkdir -p %p/var/cache/distcc >/dev/null 2>&1 || :
chmod 1777 %p/var/cache/distcc >/dev/null 2>&1 || :
<<
ConfFiles: %p/etc/distcc.conf %p/etc/distccd.conf
DaemonicFile: <<

distributed compiling daemon
distributed compiling daemon


%p/bin/distccd
%p/etc/distccd.conf
%p/var/run/distccd.pid



<<

Homepage: http://distcc.samba.org/
DescDetail: <<
distcc is a program to distribute compilation of C or C++ code
across several machines on a network. distcc should always
generate the same results as a local compile, is simple to
install and use, and is often two or more times faster than a
local compile.
<<
DescUsage: <<
To use distcc, you must set the DISTCC_HOSTS environment variable
to a list of hosts that have the distcc daemon running. See the
distcc manpage for details on how to use distcc as your compiler.

To use distcc by default, in conjunction with ccache, install the
distcc-default package.
<<

distcc stable port .patch


--- distcc-2.18.3/distcc-default.csh 1969-12-31 19:00:00.000000000 -0500
+++ distcc-2.18.3-new/distcc-default.csh 2007-02-24 12:10:14.000000000 -0500
@@ -0,0 +1,9 @@
+#!/bin/csh
+
+if ( ! $?CCACHE_PATH ) then
+ setenv CCACHE_PATH $PATH
+endif
+
+setenv CCACHE_PATH "@FINKPREFIX@/var/lib/distcc/untranslated:"$CCACHE_PATH
+setenv PATH $PATH":@FINKPREFIX@/var/lib/distcc/untranslated"
+setenv CCACHE_PREFIX "@FINKPREFIX@/var/lib/distcc/gcc-translator.pl"
--- distcc-2.18.3/distcc-default.sh 1969-12-31 19:00:00.000000000 -0500
+++ distcc-2.18.3-new/distcc-default.sh 2007-02-24 12:10:14.000000000 -0500
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ -z "$CCACHE_PATH" ]; then
+ CCACHE_PATH="$PATH"
+fi
+
+export CCACHE_PATH="@FINKPREFIX@/var/lib/distcc/untranslated:$CCACHE_PATH"
+export PATH="$PATH:@FINKPREFIX@/var/lib/distcc/untranslated"
+export CCACHE_PREFIX="@FINKPREFIX@/var/lib/distcc/gcc-translator.pl"
--- distcc-2.18.3/distcc.conf 1969-12-31 19:00:00.000000000 -0500
+++ distcc-2.18.3-new/distcc.conf 2007-02-24 12:10:14.000000000 -0500
@@ -0,0 +1,30 @@
+# whether to translate compiler calls into e.g.
+# powerpc-apple-darwin8-gcc -- don't set this
+# unless you know what you're doing!
+#DISTCC_TRANS=false
+
+# the location of the distcc configuration files
+# the default is @FINKPREFIX@/var/cache/distcc/[uid]
+#DISTCC_DIR=@FINKPREFIX@/var/cache/distcc/foo
+
+# the hosts to use when compiling
+DISTCC_HOSTS='localhost'
+
+# whether to give more verbose output
+DISTCC_VERBOSE=0
+
+# the full path of a log file to log to
+# DISTCC_LOG=LOGFILE
+
+# disable tcp corks (see manual for details)
+DISTCC_TCP_CORK=1
+
+# whether to use MMAP
+DISTCC_MMAP=0
+
+# Enable building with multiple concurrent make
+# sessions by default -- this can cause problems
+# with building some packages. If you have issues
+# building a package, comment this back out and
+# try again.
+#MAKEFLAGS=-j4
--- distcc-2.18.3/distcc.csh 1969-12-31 19:00:00.000000000 -0500
+++ distcc-2.18.3-new/distcc.csh 2007-02-24 12:10:14.000000000 -0500
@@ -0,0 +1,13 @@
+#!/bin/csh
+
+#### DO NOT EDIT BELOW HERE ####
+mkdir -p "@FINKPREFIX@/var/cache/distcc/`id -u`" && setenv DISTCC_DIR "@FINKPREFIX@/var/cache/distcc/`id -u`"
+
+grep -q -E '^ *DISTCC_TRANS' @FINKPREFIX@/etc/distcc.conf && setenv DISTCC_TRANS `grep '^ *DISTCC_TRANS' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_DIR' @FINKPREFIX@/etc/distcc.conf && setenv DISTCC_DIR `grep '^ *DISTCC_DIR' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_MMAP' @FINKPREFIX@/etc/distcc.conf && setenv DISTCC_MMAP `grep '^ *DISTCC_MMAP' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_HOSTS' @FINKPREFIX@/etc/distcc.conf && setenv DISTCC_HOSTS `grep '^ *DISTCC_HOSTS' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_VERBOSE' @FINKPREFIX@/etc/distcc.conf && setenv DISTCC_VERBOSE `grep '^ *DISTCC_VERBOSE' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_LOG' @FINKPREFIX@/etc/distcc.conf && setenv DISTCC_LOG `grep '^ *DISTCC_LOG' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_TCP_CORK' @FINKPREFIX@/etc/distcc.conf && setenv DISTCC_TCP_CORK `grep '^ *DISTCC_TCP_CORK' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *MAKEFLAGS' @FINKPREFIX@/etc/distcc.conf && setenv MAKEFLAGS `grep '^ *MAKEFLAGS' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
--- distcc-2.18.3/distcc.sh 1969-12-31 19:00:00.000000000 -0500
+++ distcc-2.18.3-new/distcc.sh 2007-02-24 12:10:14.000000000 -0500
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#### DO NOT EDIT BELOW HERE ####
+mkdir -p "@FINKPREFIX@/var/cache/distcc/`id -u`" && export DISTCC_DIR="@FINKPREFIX@/var/cache/distcc/`id -u `"
+
+grep -q -E '^ *DISTCC_TRANS' @FINKPREFIX@/etc/distcc.conf && export DISTCC_TRANS=`grep '^ *DISTCC_TRANS' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_DIR' @FINKPREFIX@/etc/distcc.conf && export DISTCC_DIR=`grep '^ *DISTCC_DIR' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_MMAP' @FINKPREFIX@/etc/distcc.conf && export DISTCC_MMAP=`grep '^ *DISTCC_MMAP' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_HOSTS' @FINKPREFIX@/etc/distcc.conf && export DISTCC_HOSTS=`grep '^ *DISTCC_HOSTS' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_VERBOSE' @FINKPREFIX@/etc/distcc.conf && export DISTCC_VERBOSE=`grep '^ *DISTCC_VERBOSE' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_LOG' @FINKPREFIX@/etc/distcc.conf && export DISTCC_LOG=`grep '^ *DISTCC_LOG' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_TCP_CORK' @FINKPREFIX@/etc/distcc.conf && export DISTCC_TCP_CORK=`grep '^ *DISTCC_TCP_CORK' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *MAKEFLAGS' @FINKPREFIX@/etc/distcc.conf && export MAKEFLAGS=`grep '^ *MAKEFLAGS' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
--- distcc-2.18.3/distccd-fink.sh 1969-12-31 19:00:00.000000000 -0500
+++ distcc-2.18.3-new/distccd-fink.sh 2007-02-24 12:10:14.000000000 -0500
@@ -0,0 +1,31 @@
+#!/bin/sh -e
+
+source @FINKPREFIX@/etc/distccd.conf
+export DISTCC_MMAP
+
+export DISTCCD_PATH="@FINKPREFIX@/var/lib/distcc/translated:$PATH"
+export DISTCC_TRANS="true"
+
+DISTCCD_COMMAND="@FINKPREFIX@/bin/distccd --daemon --pid-file @FINKPREFIX@/var/run/distccd.pid"
+
+[ -n "$DISTCCD_NICENESS" ] && DISTCCD_COMMAND="$DISTCCD_COMMAND --nice $DISTCCD_NICENESS"
+[ -n "$DISTCCD_PORT" ] && DISTCCD_COMMAND="$DISTCCD_COMMAND --port $DISTCCD_PORT"
+[ -n "$DISTCCD_LISTEN" ] && DISTCCD_COMMAND="$DISTCCD_COMMAND --listen $DISTCCD_LISTEN"
+[ -n "$DISTCCD_USER" ] && DISTCCD_COMMAND="$DISTCCD_COMMAND --user $DISTCCD_USER"
+[ -n "$DISTCCD_VERBOSE" ] && DISTCCD_COMMAND="$DISTCCD_COMMAND --verbose"
+[ -n "$DISTCCD_LOGFILE" ] && DISTCCD_COMMAND="$DISTCCD_COMMAND --log-file $DISTCCD_LOGFILE"
+
+[ "$DISTCCD_ZEROCONF" == 1 ] && DISTCCD_COMMAND="$DISTCCD_COMMAND --zeroconf"
+
+for allow in $DISTCCD_ALLOW; do
+ DISTCCD_COMMAND="$DISTCCD_COMMAND --allow $allow"
+done
+
+rm -f "@FINKPREFIX@/var/log/distccd.log"
+touch "@FINKPREFIX@/var/log/distccd.log"
+touch "@FINKPREFIX@/var/run/distccd.pid"
+chown distcc "@FINKPREFIX@/var/log/distccd.log"
+chown distcc "@FINKPREFIX@/var/run/distccd.pid"
+
+env -i DISTCC_MMAP="$DISTCC_MMAP" DISTCCD_PATH="$DISTCCD_PATH" DISTCC_TRANS="true" $DISTCCD_COMMAND
+
--- distcc-2.18.3/distccd.conf 1969-12-31 19:00:00.000000000 -0500
+++ distcc-2.18.3-new/distccd.conf 2007-02-24 12:10:14.000000000 -0500
@@ -0,0 +1,30 @@
+# whether to use MMAP
+DISTCC_MMAP=0
+
+# how nice should distccd be?
+DISTCCD_NICENESS=5
+
+# the port to listen on
+DISTCCD_PORT=3632
+
+# the IP address to listen on
+# 0.0.0.0 = all
+DISTCCD_LISTEN=0.0.0.0
+
+# the user to run as
+DISTCCD_USER=distcc
+
+# hosts to allow to connect to this distccd instance
+# format: 0.0.0.0[/CIDR_BITMASK] [0.0.0.0[/CIDR_BITMASK]] ...
+DISTCCD_ALLOW="0.0.0.0"
+
+# whether to be verbose in the logs
+# "" = no, anything else = yes
+DISTCCD_VERBOSE="true"
+
+# the log file to write to
+DISTCCD_LOGFILE="@FINKPREFIX@/var/log/distccd.log"
+
+# whether to use zeroconf
+# 0 = false, 1 = true
+DISTCCD_ZEROCONF=1
--- distcc-2.18.3/gcc-translator.pl 1969-12-31 19:00:00.000000000 -0500
+++ distcc-2.18.3-new/gcc-translator.pl 2007-02-24 12:10:14.000000000 -0500
@@ -0,0 +1,151 @@
+#!/usr/bin/perl -w
+
+# usage: put this file in $DATADIR, then make symlinks for each
+# of the compilers:
+#
+# cd $DATADIR
+# for arch in powerpc i386; do
+# for version in "" "-3.3" "-4.0"; do
+# for gcc in cc c++ gcc g++; do
+# if [ -f "/usr/bin/${gcc}${version}" ]; then
+# ln -s "/usr/bin/${gcc}${version}" "${arch}-apple-darwin${DARWINVER}-${gcc}${version}"
+# fi
+# done
+# done
+# done
+#
+# install distcc and ccache, then set:
+#
+# export CCACHE_PREFIX=$DATADIR/gcc-translator.pl
+#
+# assuming you've got ccache set up to do symlinks to take over gcc, the gcc-translator script
+# will automatically translate gcc calls into target-style gcc names (powerpc-apple-darwin8-gcc)
+
+use strict;
+
+my $DISTCCBIN = '@FINKPREFIX@/bin/distcc';
+my $DATADIR = '@FINKPREFIX@/var/lib/distcc';
+
+# shortcut if they're doing multiple architectures, the remote
+# compilers probably won't handle it right
+if (grep(/^-arch$/, @ARGV) >= 2) {
+ exit run_command($0, @ARGV);
+}
+
+if (not exists $ENV{'DISTCC_TRANS'} or $ENV{'DISTCC_TRANS'} !~ /^(true|1|yes|y)$/i) {
+ exit run_command($DISTCCBIN, @ARGV);
+}
+
+my $DEBUG = 0;
+
+my $arch_lookup = {
+ ppc => 'powerpc',
+ ppc64 => 'powerpc',
+ i386 => 'i386',
+};
+
+my $reverse_arch_lookup = {
+ 'powerpc' => 'ppc',
+ 'i386' => 'i386',
+};
+
+$ENV{'PATH'} = $DATADIR . '/translated:' . $ENV{'PATH'};
+
+if ($0 =~ /(powerpc|i386)-apple-([^\d]+)(\d+)-(.*)$/) {
+ my ($archname, $os, $version, $compiler) = ($1, $2, $3, $4);
+
+ my @command = ('/usr/bin/' . $compiler);
+ if (exists $reverse_arch_lookup->{$archname}) {
+ push(@command, '-arch', $reverse_arch_lookup->{$archname});
+ }
+ push(@command, @ARGV);
+ exit run_command(@command);
+}
+
+my $compiler = shift(@ARGV) || 'gcc';
+if ($compiler !~ m#/#) {
+ $compiler = which($compiler);
+}
+
+my $arch;
+my @args;
+
+$compiler = render_symlinks($compiler);
+
+my $lastarg;
+for my $arg (@ARGV) {
+ if ($arg eq "-arch") {
+ $lastarg = "arch";
+ } elsif (defined $lastarg and $lastarg eq "arch") {
+ $arch = $arch_lookup->{$arg} if (exists $arch_lookup->{$arg});
+ $lastarg = undef;
+ } else {
+ push(@args, $arg);
+ }
+}
+
+chomp(my $uname = lc(`uname -s -r -p`));
+my ($osname, $version, $archname) = split(/\s+/, $uname);
+$version =~ s/^(\d+).*$/$1/;
+
+if (not defined $arch) {
+ $arch = $archname;
+}
+
+$compiler = "${arch}-apple-${osname}${version}-" . basename($compiler);
+
+my @command = ($DISTCCBIN, $compiler, @args);
+exit run_command(@command);
+
+sub run_command {
+ print STDERR "@command\n" if ($DEBUG);
+
+ my $exit = system(@_);
+
+ if ($exit == -1) {
+ die "failed to execute $DISTCCBIN $compiler @args\n";
+ } elsif ($exit & 127) {
+ printf STDERR "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without';
+ } else {
+ return int($exit >> 8);
+ }
+}
+
+sub render_symlinks {
+ my $filename = shift;
+
+ if (defined $filename and -l $filename) {
+ my $linkname = readlink($filename);
+ if ($linkname !~ m#/#) {
+ $linkname = dirname($filename) . $linkname;
+ }
+ return render_symlinks($linkname);
+ }
+
+ return $filename;
+}
+
+sub which {
+ my $filename = shift;
+
+ for my $dir (split(/:/, $ENV{'PATH'})) {
+ my $fullname = $dir . '/' . $filename;
+ next if (-l $fullname and (readlink($fullname) =~ /distcc/ or readlink($fullname) =~ /ccache/));
+
+ if (-f $dir . '/' . $filename) {
+ return $dir . '/' . $filename;
+ }
+ }
+}
+
+sub basename {
+ my $filename = shift;
+
+ return @{[ $filename =~ m#^.*/([^/]+)$#]}[0];
+}
+
+sub dirname {
+ my $filename = shift;
+
+ return @{[ $filename =~ m#^(.*/)[^/]*$# ]}[0];
+}
--- distcc-2.18.3/src/zeroconf.c 2005-01-07 11:16:35.000000000 -0500
+++ distcc-2.18.3-new/src/zeroconf.c 2007-02-24 12:10:41.000000000 -0500
@@ -2,6 +2,7 @@

#include "config.h"

+#include
#include
#include
#include

distcc _unstable_ port information

Package: distcc
Version: 2.18.3
Revision: 1031
Description: Distributed compilation tool
License: GPL
Maintainer: Benjamin Reed

Depends: <<
daemonic,
libgettext3-shlibs,
libhowl-shlibs (>= 1.0.0-11),
libiconv,
passwd (>= 20031013-1),
popt-shlibs
<<
BuildDepends: <<
libgettext3-dev,
libhowl-dev (>= 1.0.0-11),
libiconv-dev,
libxml2,
passwd (>= 20031013-1),
pkgconfig,
popt
<<
Suggests: ccache

CustomMirror: <<
Primary: http://ranger.users.finkproject.org/distfiles
eur-NL: http://ranger.users.finkproject.org/distfiles
nam-US: http://ranger.befunk.com/fink
nam-US: http://astrange.ithinksw.net/~astrange/ranger-fink
nam-CA: http://www.southofheaven.net/befunk
<<
Source: mirror:custom:%n-%v-patched.tar.bz2
Source-MD5: b301583cfc9c757d6d27648e40db1682
SourceDirectory: %n-%v
PatchScript: sed -e 's,@FINKPREFIX@,%p,g' %a/%n.patch | patch -p1

SetCPPFLAGS: -I./src -I./lzo -I%p/include -I%p/include/howl
SetLIBS: -L%p/lib
NoSetCPPFLAGS: true
ConfigureParams: --mandir=%p/share/man --infodir=%p/share/info --disable-dependency-tracking
CompileScript: <<
#!/bin/sh -ev
unset DISTCC_HOSTS
unset CCACHE_PREFIX
unset CCACHE_PATH
export CCACHE_DISABLE=1
./configure %c
perl -pi -e 's,#define WITH_GNOME.*,#undef WITH_GNOME,g; s,#define WITH_GTK.*,#undef WITH_GTK,g;' src/config.h
make
<<

InstallScript: <<
#!/bin/sh -ev
unset DISTCC_HOSTS
unset CCACHE_PREFIX
unset CCACHE_PATH
export CCACHE_DISABLE=1
make install DESTDIR=%d

install -d -m 755 %i/etc
mv distcc.conf %i/etc/
mv distccd.conf %i/etc/

install -d -m 755 %i/bin
mv distccd-fink.sh %i/bin/
chmod 755 %i/bin/distccd-fink.sh

install -d -m 755 %i/etc/profile.d
mv distcc-default.* distcc.sh distcc.csh %i/etc/profile.d/
chmod 755 %i/etc/profile.d/*

DARWINVER=`uname -r | cut -d. -f1`
install -d -m 755 %i/var/lib/distcc/translated
install -d -m 755 %i/var/lib/distcc/untranslated
install -c -m 755 gcc-translator.pl %i/var/lib/distcc/
pushd %i/var/lib/distcc
for arch in powerpc i386; do
for version in "" "-3.3" "-4.0"; do
for gcc in cc c++ gcc g++; do
ln -sf "%p/var/lib/distcc/gcc-translator.pl" "translated/${arch}-apple-darwin${DARWINVER}-${gcc}${version}"
ln -sf "/usr/bin/${gcc}${version}" "untranslated/${arch}-apple-darwin${DARWINVER}-${gcc}${version}"
done
done
done
popd
<<
DocFiles: AUTHORS COPYING* INSTALL NEWS README*
SplitOff: <<
Package: %N-default
Description: Enable distcc+ccache by default
Depends: <<
%N (>= %v-%r),
ccache (>= 2.2-0),
ccache-default (>= 2.2-0)
<<
DocFiles: COPYING*
Files: %p/etc/profile.d/distcc-default*
<<

PostInstScript: <<
mkdir -p %p/var/cache/distcc >/dev/null 2>&1 || :
chmod 1777 %p/var/cache/distcc >/dev/null 2>&1 || :
<<
ConfFiles: %p/etc/distcc.conf %p/etc/distccd.conf
DaemonicFile: <<

distributed compiling daemon
distributed compiling daemon


%p/bin/distccd
%p/etc/distccd.conf
%p/var/run/distccd.pid



<<

Homepage: http://distcc.samba.org/
DescDetail: <<
distcc is a program to distribute compilation of C or C++ code
across several machines on a network. distcc should always
generate the same results as a local compile, is simple to
install and use, and is often two or more times faster than a
local compile.
<<
DescUsage: <<
To use distcc, you must set the DISTCC_HOSTS environment variable
to a list of hosts that have the distcc daemon running. See the
distcc manpage for details on how to use distcc as your compiler.

To use distcc by default, in conjunction with ccache, install the
distcc-default package.
<<

distcc _unstable_ port .patch


--- distcc-2.18.3/distcc-default.csh 1969-12-31 19:00:00.000000000 -0500
+++ distcc-2.18.3-new/distcc-default.csh 2007-02-24 12:10:14.000000000 -0500
@@ -0,0 +1,9 @@
+#!/bin/csh
+
+if ( ! $?CCACHE_PATH ) then
+ setenv CCACHE_PATH $PATH
+endif
+
+setenv CCACHE_PATH "@FINKPREFIX@/var/lib/distcc/untranslated:"$CCACHE_PATH
+setenv PATH $PATH":@FINKPREFIX@/var/lib/distcc/untranslated"
+setenv CCACHE_PREFIX "@FINKPREFIX@/var/lib/distcc/gcc-translator.pl"
--- distcc-2.18.3/distcc-default.sh 1969-12-31 19:00:00.000000000 -0500
+++ distcc-2.18.3-new/distcc-default.sh 2007-02-24 12:10:14.000000000 -0500
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ -z "$CCACHE_PATH" ]; then
+ CCACHE_PATH="$PATH"
+fi
+
+export CCACHE_PATH="@FINKPREFIX@/var/lib/distcc/untranslated:$CCACHE_PATH"
+export PATH="$PATH:@FINKPREFIX@/var/lib/distcc/untranslated"
+export CCACHE_PREFIX="@FINKPREFIX@/var/lib/distcc/gcc-translator.pl"
--- distcc-2.18.3/distcc.conf 1969-12-31 19:00:00.000000000 -0500
+++ distcc-2.18.3-new/distcc.conf 2007-02-24 12:10:14.000000000 -0500
@@ -0,0 +1,30 @@
+# whether to translate compiler calls into e.g.
+# powerpc-apple-darwin8-gcc -- don't set this
+# unless you know what you're doing!
+#DISTCC_TRANS=false
+
+# the location of the distcc configuration files
+# the default is @FINKPREFIX@/var/cache/distcc/[uid]
+#DISTCC_DIR=@FINKPREFIX@/var/cache/distcc/foo
+
+# the hosts to use when compiling
+DISTCC_HOSTS='localhost'
+
+# whether to give more verbose output
+DISTCC_VERBOSE=0
+
+# the full path of a log file to log to
+# DISTCC_LOG=LOGFILE
+
+# disable tcp corks (see manual for details)
+DISTCC_TCP_CORK=1
+
+# whether to use MMAP
+DISTCC_MMAP=0
+
+# Enable building with multiple concurrent make
+# sessions by default -- this can cause problems
+# with building some packages. If you have issues
+# building a package, comment this back out and
+# try again.
+#MAKEFLAGS=-j4
--- distcc-2.18.3/distcc.csh 1969-12-31 19:00:00.000000000 -0500
+++ distcc-2.18.3-new/distcc.csh 2007-02-24 12:10:14.000000000 -0500
@@ -0,0 +1,13 @@
+#!/bin/csh
+
+#### DO NOT EDIT BELOW HERE ####
+mkdir -p "@FINKPREFIX@/var/cache/distcc/`id -u`" && setenv DISTCC_DIR "@FINKPREFIX@/var/cache/distcc/`id -u`"
+
+grep -q -E '^ *DISTCC_TRANS' @FINKPREFIX@/etc/distcc.conf && setenv DISTCC_TRANS `grep '^ *DISTCC_TRANS' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_DIR' @FINKPREFIX@/etc/distcc.conf && setenv DISTCC_DIR `grep '^ *DISTCC_DIR' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_MMAP' @FINKPREFIX@/etc/distcc.conf && setenv DISTCC_MMAP `grep '^ *DISTCC_MMAP' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_HOSTS' @FINKPREFIX@/etc/distcc.conf && setenv DISTCC_HOSTS `grep '^ *DISTCC_HOSTS' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_VERBOSE' @FINKPREFIX@/etc/distcc.conf && setenv DISTCC_VERBOSE `grep '^ *DISTCC_VERBOSE' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_LOG' @FINKPREFIX@/etc/distcc.conf && setenv DISTCC_LOG `grep '^ *DISTCC_LOG' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_TCP_CORK' @FINKPREFIX@/etc/distcc.conf && setenv DISTCC_TCP_CORK `grep '^ *DISTCC_TCP_CORK' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *MAKEFLAGS' @FINKPREFIX@/etc/distcc.conf && setenv MAKEFLAGS `grep '^ *MAKEFLAGS' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
--- distcc-2.18.3/distcc.sh 1969-12-31 19:00:00.000000000 -0500
+++ distcc-2.18.3-new/distcc.sh 2007-02-24 12:10:14.000000000 -0500
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+#### DO NOT EDIT BELOW HERE ####
+mkdir -p "@FINKPREFIX@/var/cache/distcc/`id -u`" && export DISTCC_DIR="@FINKPREFIX@/var/cache/distcc/`id -u `"
+
+grep -q -E '^ *DISTCC_TRANS' @FINKPREFIX@/etc/distcc.conf && export DISTCC_TRANS=`grep '^ *DISTCC_TRANS' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_DIR' @FINKPREFIX@/etc/distcc.conf && export DISTCC_DIR=`grep '^ *DISTCC_DIR' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_MMAP' @FINKPREFIX@/etc/distcc.conf && export DISTCC_MMAP=`grep '^ *DISTCC_MMAP' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_HOSTS' @FINKPREFIX@/etc/distcc.conf && export DISTCC_HOSTS=`grep '^ *DISTCC_HOSTS' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_VERBOSE' @FINKPREFIX@/etc/distcc.conf && export DISTCC_VERBOSE=`grep '^ *DISTCC_VERBOSE' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_LOG' @FINKPREFIX@/etc/distcc.conf && export DISTCC_LOG=`grep '^ *DISTCC_LOG' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *DISTCC_TCP_CORK' @FINKPREFIX@/etc/distcc.conf && export DISTCC_TCP_CORK=`grep '^ *DISTCC_TCP_CORK' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
+grep -q -E '^ *MAKEFLAGS' @FINKPREFIX@/etc/distcc.conf && export MAKEFLAGS=`grep '^ *MAKEFLAGS' @FINKPREFIX@/etc/distcc.conf | head -1 | tr -d \'\" | cut -d= -f2` || :
--- distcc-2.18.3/distccd-fink.sh 1969-12-31 19:00:00.000000000 -0500
+++ distcc-2.18.3-new/distccd-fink.sh 2007-02-24 12:10:14.000000000 -0500
@@ -0,0 +1,31 @@
+#!/bin/sh -e
+
+source @FINKPREFIX@/etc/distccd.conf
+export DISTCC_MMAP
+
+export DISTCCD_PATH="@FINKPREFIX@/var/lib/distcc/translated:$PATH"
+export DISTCC_TRANS="true"
+
+DISTCCD_COMMAND="@FINKPREFIX@/bin/distccd --daemon --pid-file @FINKPREFIX@/var/run/distccd.pid"
+
+[ -n "$DISTCCD_NICENESS" ] && DISTCCD_COMMAND="$DISTCCD_COMMAND --nice $DISTCCD_NICENESS"
+[ -n "$DISTCCD_PORT" ] && DISTCCD_COMMAND="$DISTCCD_COMMAND --port $DISTCCD_PORT"
+[ -n "$DISTCCD_LISTEN" ] && DISTCCD_COMMAND="$DISTCCD_COMMAND --listen $DISTCCD_LISTEN"
+[ -n "$DISTCCD_USER" ] && DISTCCD_COMMAND="$DISTCCD_COMMAND --user $DISTCCD_USER"
+[ -n "$DISTCCD_VERBOSE" ] && DISTCCD_COMMAND="$DISTCCD_COMMAND --verbose"
+[ -n "$DISTCCD_LOGFILE" ] && DISTCCD_COMMAND="$DISTCCD_COMMAND --log-file $DISTCCD_LOGFILE"
+
+[ "$DISTCCD_ZEROCONF" == 1 ] && DISTCCD_COMMAND="$DISTCCD_COMMAND --zeroconf"
+
+for allow in $DISTCCD_ALLOW; do
+ DISTCCD_COMMAND="$DISTCCD_COMMAND --allow $allow"
+done
+
+rm -f "@FINKPREFIX@/var/log/distccd.log"
+touch "@FINKPREFIX@/var/log/distccd.log"
+touch "@FINKPREFIX@/var/run/distccd.pid"
+chown distcc "@FINKPREFIX@/var/log/distccd.log"
+chown distcc "@FINKPREFIX@/var/run/distccd.pid"
+
+env -i DISTCC_MMAP="$DISTCC_MMAP" DISTCCD_PATH="$DISTCCD_PATH" DISTCC_TRANS="true" $DISTCCD_COMMAND
+
--- distcc-2.18.3/distccd.conf 1969-12-31 19:00:00.000000000 -0500
+++ distcc-2.18.3-new/distccd.conf 2007-02-24 12:10:14.000000000 -0500
@@ -0,0 +1,30 @@
+# whether to use MMAP
+DISTCC_MMAP=0
+
+# how nice should distccd be?
+DISTCCD_NICENESS=5
+
+# the port to listen on
+DISTCCD_PORT=3632
+
+# the IP address to listen on
+# 0.0.0.0 = all
+DISTCCD_LISTEN=0.0.0.0
+
+# the user to run as
+DISTCCD_USER=distcc
+
+# hosts to allow to connect to this distccd instance
+# format: 0.0.0.0[/CIDR_BITMASK] [0.0.0.0[/CIDR_BITMASK]] ...
+DISTCCD_ALLOW="0.0.0.0"
+
+# whether to be verbose in the logs
+# "" = no, anything else = yes
+DISTCCD_VERBOSE="true"
+
+# the log file to write to
+DISTCCD_LOGFILE="@FINKPREFIX@/var/log/distccd.log"
+
+# whether to use zeroconf
+# 0 = false, 1 = true
+DISTCCD_ZEROCONF=1
--- distcc-2.18.3/gcc-translator.pl 1969-12-31 19:00:00.000000000 -0500
+++ distcc-2.18.3-new/gcc-translator.pl 2007-02-24 12:10:14.000000000 -0500
@@ -0,0 +1,151 @@
+#!/usr/bin/perl -w
+
+# usage: put this file in $DATADIR, then make symlinks for each
+# of the compilers:
+#
+# cd $DATADIR
+# for arch in powerpc i386; do
+# for version in "" "-3.3" "-4.0"; do
+# for gcc in cc c++ gcc g++; do
+# if [ -f "/usr/bin/${gcc}${version}" ]; then
+# ln -s "/usr/bin/${gcc}${version}" "${arch}-apple-darwin${DARWINVER}-${gcc}${version}"
+# fi
+# done
+# done
+# done
+#
+# install distcc and ccache, then set:
+#
+# export CCACHE_PREFIX=$DATADIR/gcc-translator.pl
+#
+# assuming you've got ccache set up to do symlinks to take over gcc, the gcc-translator script
+# will automatically translate gcc calls into target-style gcc names (powerpc-apple-darwin8-gcc)
+
+use strict;
+
+my $DISTCCBIN = '@FINKPREFIX@/bin/distcc';
+my $DATADIR = '@FINKPREFIX@/var/lib/distcc';
+
+# shortcut if they're doing multiple architectures, the remote
+# compilers probably won't handle it right
+if (grep(/^-arch$/, @ARGV) >= 2) {
+ exit run_command($0, @ARGV);
+}
+
+if (not exists $ENV{'DISTCC_TRANS'} or $ENV{'DISTCC_TRANS'} !~ /^(true|1|yes|y)$/i) {
+ exit run_command($DISTCCBIN, @ARGV);
+}
+
+my $DEBUG = 0;
+
+my $arch_lookup = {
+ ppc => 'powerpc',
+ ppc64 => 'powerpc',
+ i386 => 'i386',
+};
+
+my $reverse_arch_lookup = {
+ 'powerpc' => 'ppc',
+ 'i386' => 'i386',
+};
+
+$ENV{'PATH'} = $DATADIR . '/translated:' . $ENV{'PATH'};
+
+if ($0 =~ /(powerpc|i386)-apple-([^\d]+)(\d+)-(.*)$/) {
+ my ($archname, $os, $version, $compiler) = ($1, $2, $3, $4);
+
+ my @command = ('/usr/bin/' . $compiler);
+ if (exists $reverse_arch_lookup->{$archname}) {
+ push(@command, '-arch', $reverse_arch_lookup->{$archname});
+ }
+ push(@command, @ARGV);
+ exit run_command(@command);
+}
+
+my $compiler = shift(@ARGV) || 'gcc';
+if ($compiler !~ m#/#) {
+ $compiler = which($compiler);
+}
+
+my $arch;
+my @args;
+
+$compiler = render_symlinks($compiler);
+
+my $lastarg;
+for my $arg (@ARGV) {
+ if ($arg eq "-arch") {
+ $lastarg = "arch";
+ } elsif (defined $lastarg and $lastarg eq "arch") {
+ $arch = $arch_lookup->{$arg} if (exists $arch_lookup->{$arg});
+ $lastarg = undef;
+ } else {
+ push(@args, $arg);
+ }
+}
+
+chomp(my $uname = lc(`uname -s -r -p`));
+my ($osname, $version, $archname) = split(/\s+/, $uname);
+$version =~ s/^(\d+).*$/$1/;
+
+if (not defined $arch) {
+ $arch = $archname;
+}
+
+$compiler = "${arch}-apple-${osname}${version}-" . basename($compiler);
+
+my @command = ($DISTCCBIN, $compiler, @args);
+exit run_command(@command);
+
+sub run_command {
+ print STDERR "@command\n" if ($DEBUG);
+
+ my $exit = system(@_);
+
+ if ($exit == -1) {
+ die "failed to execute $DISTCCBIN $compiler @args\n";
+ } elsif ($exit & 127) {
+ printf STDERR "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without';
+ } else {
+ return int($exit >> 8);
+ }
+}
+
+sub render_symlinks {
+ my $filename = shift;
+
+ if (defined $filename and -l $filename) {
+ my $linkname = readlink($filename);
+ if ($linkname !~ m#/#) {
+ $linkname = dirname($filename) . $linkname;
+ }
+ return render_symlinks($linkname);
+ }
+
+ return $filename;
+}
+
+sub which {
+ my $filename = shift;
+
+ for my $dir (split(/:/, $ENV{'PATH'})) {
+ my $fullname = $dir . '/' . $filename;
+ next if (-l $fullname and (readlink($fullname) =~ /distcc/ or readlink($fullname) =~ /ccache/));
+
+ if (-f $dir . '/' . $filename) {
+ return $dir . '/' . $filename;
+ }
+ }
+}
+
+sub basename {
+ my $filename = shift;
+
+ return @{[ $filename =~ m#^.*/([^/]+)$#]}[0];
+}
+
+sub dirname {
+ my $filename = shift;
+
+ return @{[ $filename =~ m#^(.*/)[^/]*$# ]}[0];
+}
--- distcc-2.18.3/src/zeroconf.c 2005-01-07 11:16:35.000000000 -0500
+++ distcc-2.18.3-new/src/zeroconf.c 2007-02-24 12:10:41.000000000 -0500
@@ -2,6 +2,7 @@

#include "config.h"

+#include
#include
#include
#include