diff options
| author | Marcin Juszkiewicz <hrw@openedhand.com> | 2007-04-27 13:23:08 +0000 |
|---|---|---|
| committer | Marcin Juszkiewicz <hrw@openedhand.com> | 2007-04-27 13:23:08 +0000 |
| commit | 0b01f1f9638018ad4727045b0620a9d5a6d0381a (patch) | |
| tree | fe2ca59cc1aa5c8f9febbfb340afb0ba4551df9e | |
| parent | 64d91d2b96991c1c8ce28f26f6f401a9b8bea9f6 (diff) | |
| download | poky-0b01f1f9638018ad4727045b0620a9d5a6d0381a.tar.gz | |
distcc: autostart distccd on boot
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1570 311d38ba-8fff-0310-9ca6-ca027cbcb966
| -rw-r--r-- | meta/packages/distcc/distcc_2.18.3.bb | 21 | ||||
| -rw-r--r-- | meta/packages/distcc/files/default | 19 | ||||
| -rwxr-xr-x | meta/packages/distcc/files/distcc | 98 |
3 files changed, 133 insertions, 5 deletions
diff --git a/meta/packages/distcc/distcc_2.18.3.bb b/meta/packages/distcc/distcc_2.18.3.bb index 124f87fc7f..7f557c41d1 100644 --- a/meta/packages/distcc/distcc_2.18.3.bb +++ b/meta/packages/distcc/distcc_2.18.3.bb | |||
| @@ -2,23 +2,34 @@ DESCRIPTION = "distcc is a parallel build system that distributes \ | |||
| 2 | compilation of C/C++/ObjC code across machines on a network." | 2 | compilation of C/C++/ObjC code across machines on a network." |
| 3 | SECTION = "devel" | 3 | SECTION = "devel" |
| 4 | LICENSE = "GPLv2" | 4 | LICENSE = "GPLv2" |
| 5 | PR = "r1" | ||
| 5 | 6 | ||
| 6 | DEPENDS = "avahi gtk+" | 7 | DEPENDS = "avahi gtk+" |
| 7 | RRECOMMENDS = "avahi-daemon" | 8 | RRECOMMENDS = "avahi-daemon" |
| 8 | 9 | ||
| 9 | SRC_URI = "http://distcc.samba.org/ftp/distcc/distcc-${PV}.tar.bz2 \ | 10 | SRC_URI = "http://distcc.samba.org/ftp/distcc/distcc-${PV}.tar.bz2 \ |
| 10 | http://0pointer.de/public/distcc-avahi.patch;patch=1" | 11 | http://0pointer.de/public/distcc-avahi.patch;patch=1 \ |
| 12 | file://default \ | ||
| 13 | file://distcc" | ||
| 11 | 14 | ||
| 12 | inherit autotools pkgconfig | 15 | inherit autotools pkgconfig update-rc.d |
| 16 | |||
| 17 | INITSCRIPT_NAME = "distcc" | ||
| 13 | 18 | ||
| 14 | EXTRA_OECONF = " --with-gtk " | 19 | EXTRA_OECONF = " --with-gtk " |
| 15 | 20 | ||
| 21 | do_install_append() { | ||
| 22 | install -d ${D}${sysconfdir}/init.d/ | ||
| 23 | install -d ${D}${sysconfdir}/default | ||
| 24 | install -m 0755 ${WORKDIR}/distcc ${D}${sysconfdir}/init.d/ | ||
| 25 | install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/distcc | ||
| 26 | } | ||
| 27 | |||
| 16 | PACKAGES += "distcc-distmon-gnome" | 28 | PACKAGES += "distcc-distmon-gnome" |
| 17 | 29 | ||
| 18 | FILES_${PN} = " ${bindir}/distcc \ | 30 | FILES_${PN} = " ${sysconfdir} \ |
| 31 | ${bindir}/distcc \ | ||
| 19 | ${bindir}/distccd \ | 32 | ${bindir}/distccd \ |
| 20 | ${bindir}/distccmon-text" | 33 | ${bindir}/distccmon-text" |
| 21 | FILES_distcc-distmon-gnome = " ${bindir}/distccmon-gnome \ | 34 | FILES_distcc-distmon-gnome = " ${bindir}/distccmon-gnome \ |
| 22 | ${datadir}/distcc" | 35 | ${datadir}/distcc" |
| 23 | |||
| 24 | |||
diff --git a/meta/packages/distcc/files/default b/meta/packages/distcc/files/default new file mode 100644 index 0000000000..95290f8488 --- /dev/null +++ b/meta/packages/distcc/files/default | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | # Defaults for distcc initscript | ||
| 2 | # sourced by /etc/init.d/distcc | ||
| 3 | |||
| 4 | # | ||
| 5 | # should distcc be started on boot? | ||
| 6 | # | ||
| 7 | # STARTDISTCC="true" | ||
| 8 | |||
| 9 | STARTDISTCC="true" | ||
| 10 | |||
| 11 | # | ||
| 12 | # Which networks/hosts should be allowed to connect to the daemon? | ||
| 13 | # You can list multiple hosts/networks separated by spaces. | ||
| 14 | # Networks have to be in CIDR notation, f.e. 192.168.1.0/24 | ||
| 15 | # Hosts are represented by a single IP Adress | ||
| 16 | # | ||
| 17 | # ALLOWEDNETS="127.0.0.1" | ||
| 18 | |||
| 19 | ALLOWEDNETS="192.168.7.0/24" | ||
diff --git a/meta/packages/distcc/files/distcc b/meta/packages/distcc/files/distcc new file mode 100755 index 0000000000..bbd4707497 --- /dev/null +++ b/meta/packages/distcc/files/distcc | |||
| @@ -0,0 +1,98 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # distccd Debian init.d script contributed by Jason Thomas. (Debian #161136) | ||
| 4 | # | ||
| 5 | # skeleton example file to build /etc/init.d/ scripts. | ||
| 6 | # This file should be used to construct scripts for /etc/init.d. | ||
| 7 | # | ||
| 8 | # Written by Miquel van Smoorenburg <miquels@cistron.nl>. | ||
| 9 | # Modified for Debian GNU/Linux | ||
| 10 | # by Ian Murdock <imurdock@gnu.ai.mit.edu>. | ||
| 11 | # | ||
| 12 | # Version: @(#)skeleton 1.9.1 08-Apr-2002 miquels@cistron.nl | ||
| 13 | # | ||
| 14 | |||
| 15 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
| 16 | DAEMON=/usr/bin/distccd | ||
| 17 | NAME=distcc | ||
| 18 | DESC="Distributed Compiler Daemon" | ||
| 19 | DAEMON_ARGS="--pid-file=/var/run/$NAME.pid --daemon" | ||
| 20 | # please change those variables by overriding them in /etc/defaults/distcc | ||
| 21 | ALLOWEDNETS="127.0.0.1" | ||
| 22 | |||
| 23 | # Reads config file (will override defaults above) | ||
| 24 | [ -r /etc/default/distcc ] && . /etc/default/distcc | ||
| 25 | |||
| 26 | test -x $DAEMON || exit 0 | ||
| 27 | |||
| 28 | set -e | ||
| 29 | |||
| 30 | # construct access list | ||
| 31 | ALLOW="" | ||
| 32 | for net in $ALLOWEDNETS | ||
| 33 | do | ||
| 34 | ALLOW="$ALLOW --allow $net" | ||
| 35 | done | ||
| 36 | |||
| 37 | should_start() { | ||
| 38 | if [ "$STARTDISTCC" != "true" ] && [ "$STARTDISTCC" != "YES" ]; then | ||
| 39 | echo "STARTDISTCC is set to false in /etc/default/distcc" | ||
| 40 | echo "$DAEMON not starting" | ||
| 41 | exit 0 | ||
| 42 | fi | ||
| 43 | } | ||
| 44 | |||
| 45 | case "$1" in | ||
| 46 | start) | ||
| 47 | should_start | ||
| 48 | echo -n "Starting $DESC: $NAME" | ||
| 49 | start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ | ||
| 50 | --exec $DAEMON -- $DAEMON_ARGS $ALLOW || | ||
| 51 | { | ||
| 52 | code=$? | ||
| 53 | echo "$0: start failed with error code $code" >&2 | ||
| 54 | exit $code | ||
| 55 | } | ||
| 56 | echo "." | ||
| 57 | ;; | ||
| 58 | stop) | ||
| 59 | echo -n "Stopping $DESC: $NAME" | ||
| 60 | start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ | ||
| 61 | --exec $DAEMON || | ||
| 62 | { | ||
| 63 | code=$? | ||
| 64 | echo "$0: stop failed with error code $code" >&2 | ||
| 65 | exit $code | ||
| 66 | } | ||
| 67 | echo "." | ||
| 68 | ;; | ||
| 69 | restart|force-reload) | ||
| 70 | # | ||
| 71 | # If the "reload" option is implemented, move the "force-reload" | ||
| 72 | # option to the "reload" entry above. If not, "force-reload" is | ||
| 73 | # just the same as "restart". | ||
| 74 | # | ||
| 75 | echo -n "Restarting $DESC: $NAME" | ||
| 76 | start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ | ||
| 77 | --exec $DAEMON | ||
| 78 | sleep 1 | ||
| 79 | should_start | ||
| 80 | start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ | ||
| 81 | --exec $DAEMON -- $DAEMON_ARGS $ALLOW || | ||
| 82 | { | ||
| 83 | code=$? | ||
| 84 | echo "$0: restart failed with error code $code" >&2 | ||
| 85 | exit $code | ||
| 86 | } | ||
| 87 | echo "." | ||
| 88 | ;; | ||
| 89 | *) | ||
| 90 | N=/etc/init.d/$NAME | ||
| 91 | echo "Usage: $N {start|stop|restart|force-reload}" >&2 | ||
| 92 | exit 1 | ||
| 93 | ;; | ||
| 94 | esac | ||
| 95 | |||
| 96 | exit 0 | ||
| 97 | |||
| 98 | |||
