aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathew Meins <mm@blackhelicopters.net>2020-11-21 07:47:39 +0000
committerLeo <thinkabit.ukim@gmail.com>2020-11-21 16:12:03 +0000
commit244de700a4e1ec69c6a237532730c3773d2b42fa (patch)
treecd5e9a6f0e296d0d5134adfae487e18d51522785
parent3377632b7c55e4c3c56f29bc7862e1d617db7678 (diff)
downloadaports-244de700a4e1ec69c6a237532730c3773d2b42fa.tar.gz
aports-244de700a4e1ec69c6a237532730c3773d2b42fa.tar.bz2
aports-244de700a4e1ec69c6a237532730c3773d2b42fa.tar.xz
testing/olsrd: new aport
http://www.olsr.org/mediawiki/index.php/Olsr_Daemon An implementation of the IETF RFC 3626: Optimized Link State Routing Protocol
-rw-r--r--testing/olsrd/APKBUILD80
-rw-r--r--testing/olsrd/bison.patch16
-rw-r--r--testing/olsrd/musl.patch11
-rw-r--r--testing/olsrd/olsrd.confd1
-rw-r--r--testing/olsrd/olsrd.initd14
5 files changed, 122 insertions, 0 deletions
diff --git a/testing/olsrd/APKBUILD b/testing/olsrd/APKBUILD
new file mode 100644
index 0000000000..f4c2994032
--- /dev/null
+++ b/testing/olsrd/APKBUILD
@@ -0,0 +1,80 @@
+# Contributor: Mathew Meins <mm@blackhelicopters.net>
+# Maintainer: Mathew Meins <mm@blackhelicopters.net>
+pkgname=olsrd
+pkgver=0.9.8
+pkgrel=0
+pkgdesc="An implementation of the IETF RFC 3626: Optimized Link State Routing Protocol"
+url="http://www.olsr.org/mediawiki/index.php/Olsr_Daemon"
+arch="all"
+license="BSD-3-Clause"
+makedepends="linux-headers flex bison"
+subpackages="$pkgname-openrc $pkgname-doc $pkgname-plugins"
+source="https://github.com/OLSR/olsrd/archive/v$pkgver/olsrd-$pkgver.tar.gz
+ bison.patch
+ musl.patch
+ olsrd.initd
+ olsrd.confd
+ "
+options="!check" # No test suite provided by upstream
+
+build() {
+ # build olsrd itself
+ make all
+
+ # build olsr_switch
+ make switch
+
+ # build plugins
+ for plugin in arprefresh bmf dot_draw dyn_gw dyn_gw_plain httpinfo \
+ jsoninfo mdns nameservice netjson p2pd pgraph poprouting \
+ quagga secure sgwdynspeed txtinfo watchdog; do
+ make -C $builddir/lib/$plugin
+ done
+}
+
+package() {
+ install -m755 -D "$builddir"/olsrd \
+ "$pkgdir"/usr/sbin/olsrd
+ install -m755 -D "$builddir"/olsr_switch \
+ "$pkgdir"/usr/sbin/olsr_switch
+ install -m644 -D "$builddir"/files/olsrd.conf.default.txt \
+ "$pkgdir"/etc/$pkgname/olsrd.conf
+ install -m755 -D "$srcdir"/$pkgname.initd \
+ "$pkgdir"/etc/init.d/$pkgname
+ install -m644 -D "$srcdir"/$pkgname.confd \
+ "$pkgdir"/etc/conf.d/$pkgname
+}
+
+doc() {
+ # man pages
+ install -m644 -D "$builddir"/files/olsrd.8.gz \
+ "$subpkgdir"/usr/share/man/man8/olsrd.8.gz
+ install -m644 -D "$builddir"/files/olsr_switch.8.gz \
+ "$subpkgdir"/usr/share/man/man8/olsr_switch.8.gz
+ install -m644 -D "$builddir"/files/olsrd.conf.5.gz \
+ "$subpkgdir"/usr/share/man/man5/olsrd.conf.5.gz
+
+ # miscellaneous docs
+ for f in README olsrd.conf.commotion olsrd.conf.default \
+ olsrd.conf.default.lq olsrd.conf.default.rfc \
+ olsrd.conf.default.txt olsrd.conf.funkfeuer olsrd.ufw.profile \
+ generateEffectiveConfigurationFile olsrd-adhoc-setup \
+ sgw_policy_routing_setup.sh; do
+ install -m644 -D "$builddir"/files/$f \
+ "$subpkgdir"/usr/share/doc/$pkgname/$f
+ done
+}
+
+plugins() {
+ pkgdesc="Optional plugins for olsrd"
+
+ find "$builddir"/lib/ -name 'olsrd_*.so.*' -exec sh -c '
+ install -m755 -D "$1" "$subpkgdir"/usr/lib/$(basename $1)
+ ' sh {} \;
+}
+
+sha512sums="cf3066310c4ea644ba1f482e847aa073ad006000308bfa993cecda4ccf4e9919a9005680b3c1d98e34f0c13818213f208e8dc93c8b060eeaaac160fc3df4ce8c olsrd-0.9.8.tar.gz
+b8c44fce64fd946459c67ea130b7230fbb88a761d5b64221303adea2a6ddf074c39521f22aade27820bff8748ba50851d9cbf7602c10d6bd9615992284cb2046 bison.patch
+1d2f74d017e50d17c4eabbf52412e2f5aeec7bb2ca0bb1738ae8c0527b9abd13299cbebb3428db1cc95d574b86eea50cec8c4cf388f18d6723577800fd6678fb musl.patch
+9051d65c0f3fdc82ceccc622062a5ffa7accc6584030c0e5ba855e7a7f478233476bc44ca12fa68b5c391000f0e9d4c3198bcdd879d549ae83c37d0301bec785 olsrd.initd
+f90201e78206b7e39c23689a208b5c74ff3f8eeafa12936030c2a0909746013b73999f4f64e0011a10390d8e886f484df5c6b7a3b48573d53fe0f494a7cd6c66 olsrd.confd"
diff --git a/testing/olsrd/bison.patch b/testing/olsrd/bison.patch
new file mode 100644
index 0000000000..b7e6fd5bd1
--- /dev/null
+++ b/testing/olsrd/bison.patch
@@ -0,0 +1,16 @@
+--- a/src/cfgparser/local.mk
++++ b/src/cfgparser/local.mk
+@@ -74,12 +74,8 @@ $(C)oparse.c: $(C)oparse.y $(C)olsrd_conf.h $(C)Makefile
+ ifeq ($(VERBOSE),0)
+ @echo "[BISON] $@"
+ endif
+- $(MAKECMDPREFIX)$(BISON) -d -o "$@-tmp" "$<"
+- $(MAKECMDPREFIX)sed -e 's/register //' \
+- -e '/^#line/s/$(call quote,$@-tmp)/$(call quote,$@)/' \
+- < "$@-tmp" >"$@"
+- $(MAKECMDPREFIX)mv "$(subst .c,.h,$@-tmp)" "$(subst .c,.h,$@)"
+- $(MAKECMDPREFIX)$(RM) "$@-tmp" "$(subst .c,.h,$@-tmp)"
++ $(MAKECMDPREFIX)$(BISON) -d -o "$@" "$<"
++ $(MAKECMDPREFIX)sed -e 's/register //' "$@" > "$@.o" && mv "$@.o" "$@"
+
+ $(C)oparse.o: CFLAGS := $(filter-out -Wunreachable-code,$(CFLAGS))
diff --git a/testing/olsrd/musl.patch b/testing/olsrd/musl.patch
new file mode 100644
index 0000000000..3023f435fa
--- /dev/null
+++ b/testing/olsrd/musl.patch
@@ -0,0 +1,11 @@
+--- a/lib/pud/nmealib/src/info.c
++++ b/lib/pud/nmealib/src/info.c
+@@ -172,7 +172,7 @@ bool nmeaTimeParseDate(const char *s, NmeaTime *date) {
+ void nmeaTimeSet(NmeaTime *utc, uint32_t *present, struct timeval *timeval) {
+ struct timeval tv;
+ struct tm tm;
+- long usec;
++ time_t usec;
+
+ if (!utc) {
+ return;
diff --git a/testing/olsrd/olsrd.confd b/testing/olsrd/olsrd.confd
new file mode 100644
index 0000000000..7b94e24aca
--- /dev/null
+++ b/testing/olsrd/olsrd.confd
@@ -0,0 +1 @@
+olsdr_opts=""
diff --git a/testing/olsrd/olsrd.initd b/testing/olsrd/olsrd.initd
new file mode 100644
index 0000000000..79afdf7292
--- /dev/null
+++ b/testing/olsrd/olsrd.initd
@@ -0,0 +1,14 @@
+#!/sbin/openrc-run
+
+name=olsrd
+command="/usr/sbin/$name"
+command_args="$olsrd_opts"
+command_background="yes"
+
+start_stop_daemon_args="-g wheel -k 027"
+pidfile="/run/$name.pid"
+
+depend() {
+ need net
+ after firewall
+}