summaryrefslogtreecommitdiff
path: root/social/olsrd
diff options
context:
space:
mode:
authorNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-06-06 11:50:12 -0300
committerNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-06-06 11:50:12 -0300
commitcda85aa4f1dc3c6364300f1123b276f053cdb4f8 (patch)
tree17c132b512843e9b7096bd60315a38881ba2e85c /social/olsrd
parent574ed570a9e7c7f598732f613cf314a08a34e995 (diff)
downloadabslibre-cda85aa4f1dc3c6364300f1123b276f053cdb4f8.tar.gz
abslibre-cda85aa4f1dc3c6364300f1123b276f053cdb4f8.tar.bz2
abslibre-cda85aa4f1dc3c6364300f1123b276f053cdb4f8.zip
olsrd-0.6.1-1
Diffstat (limited to 'social/olsrd')
-rw-r--r--social/olsrd/PKGBUILD30
-rwxr-xr-xsocial/olsrd/olsrd.install21
-rwxr-xr-xsocial/olsrd/rc.d.olsrd36
3 files changed, 87 insertions, 0 deletions
diff --git a/social/olsrd/PKGBUILD b/social/olsrd/PKGBUILD
new file mode 100644
index 000000000..dea029844
--- /dev/null
+++ b/social/olsrd/PKGBUILD
@@ -0,0 +1,30 @@
+# Contributor: William Rea <sillywilly@gmail.com>
+# Maintainer: Claudio Pisa <clauz@ninux.org>
+pkgname=olsrd
+pkgver="0.6.1"
+pkgrel=1
+pkgdesc="OLSR routing daemon (RFC 3626)"
+arch=(i686 x86_64 ppc)
+url="http://www.olsr.org"
+license=('BSD')
+depends=('glibc')
+makedepends=('bison')
+backup=(etc/olsrd.conf)
+install=(olsrd.install)
+source=(http://www.olsr.org/releases/0.6/${pkgname}-${pkgver}.tar.bz2 rc.d.olsrd)
+md5sums=('a75fc9b6252df5b5f49f13418fafeff1' 'bc3e393e0179ffff0a6d6c9d6a5c4b60')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+
+ make OS=linux build_all
+}
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+ make DESTDIR=$pkgdir install_all
+
+ install -D -m755 $srcdir/rc.d.olsrd $pkgdir/etc/rc.d/olsrd
+ install -D -m644 license.txt $pkgdir/usr/share/licenses/olsrd/LICENSE
+}
+
diff --git a/social/olsrd/olsrd.install b/social/olsrd/olsrd.install
new file mode 100755
index 000000000..f49372538
--- /dev/null
+++ b/social/olsrd/olsrd.install
@@ -0,0 +1,21 @@
+post_install() {
+echo "--------------------------------------------------------------------"
+echo " Remember to edit /etc/olsrd.conf to match your network settings."
+echo "--------------------------------------------------------------------"
+/bin/true
+}
+
+post_upgrade() {
+/bin/true
+}
+
+pre_remove() {
+/etc/rc.d/olsrd stop
+/bin/true
+}
+
+op=$1
+shift
+
+$op "$@"
+
diff --git a/social/olsrd/rc.d.olsrd b/social/olsrd/rc.d.olsrd
new file mode 100755
index 000000000..d257e22ef
--- /dev/null
+++ b/social/olsrd/rc.d.olsrd
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/sbin/olsrd`
+case "$1" in
+ start)
+ stat_busy "Starting OLSR Daemon"
+ [ -z "$PID" ] && /usr/sbin/olsrd -d 0 &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon olsrd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping OLSR Daemon"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon olsrd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
+