Skip to content
Permalink
Browse files

net/olsrd: Add olsrd port

  • Loading branch information...
decke committed Aug 26, 2019
1 parent e70e0b5 commit 8e3a3c496340f632268dd2f1d94c7fe925ea077c
@@ -0,0 +1,39 @@
# Created by: dave@dogwood.com
# $FreeBSD: head/net/olsrd/Makefile 453479 2017-11-04 19:30:37Z joneum $

PORTNAME= olsrd
DISTVERSION= 0.9.6.1
CATEGORIES= net
MASTER_SITES= http://www.olsr.org/releases/0.9/

MAINTAINER= koue@chaosophia.net
COMMENT= OLSR routing daemon

LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/license.txt

MAKE_ARGS= VERBOSE=1
USES= bison gmake tar:bzip2
USE_LDCONFIG= yes
USE_RC_SUBR= olsrd

ALL_TARGET= build_all
INSTALL_TARGET= install_all

OPTIONS_DEFINE= MULTI_IF
MULTI_IF_DESC= IPv4 multiple interface support

MULTI_IF_LIB_DEPENDS= libnet.so:net/libnet
MULTI_IF_MAKE_ARGS= LIBNET=1

post-patch:
@${REINPLACE_CMD} -e 's|/sbin/ldconfig|:|g' ${WRKSRC}/make/Makefile.fbsd
@${CP} ${WRKSRC}/src/cfgparser/cfgfile_gen.c \
${WRKSRC}/src/cfgparser/olsrd_conf.h \
${WRKSRC}/lib/httpinfo/src/

post-install:
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/sbin/${PORTNAME}
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/*.so.*

.include <bsd.port.mk>
@@ -0,0 +1,3 @@
TIMESTAMP = 1509820621
SHA256 (olsrd-0.9.6.1.tar.bz2) = 9cac290e9bff5fc7422110b9ccd972853f10962c962d2f31a63de9c6d1520612
SIZE (olsrd-0.9.6.1.tar.bz2) = 908871
@@ -0,0 +1,20 @@
#!/bin/sh
#
# $FreeBSD: head/net/olsrd/files/olsrd.in 340872 2014-01-24 00:14:07Z mat $
#
# PROVIDE: olsrd
# REQUIRE: NETWORKING SERVERS

. /etc/rc.subr

name="olsrd"
rcvar=olsrd_enable

command=%%PREFIX%%/sbin/olsrd
command_args="-d 0"

olsrd_enable=${olsrd_enable:-"NO"}

load_rc_config $name
run_rc_command "$1"

@@ -0,0 +1,32 @@
--- Makefile.orig 2016-11-22 19:39:42 UTC
+++ Makefile
@@ -167,20 +167,17 @@ uninstall_bin:
install_olsrd: install_bin
@echo ========= C O N F I G U R A T I O N - F I L E ============
@echo $(EXENAME) uses the configfile $(CFGFILE)
- @echo a default configfile. A sample RFC-compliance aimed
- @echo configfile can be found in olsrd.conf.default.rfc.
- @echo However none of the larger OLSRD using networks use that
- @echo so install a configfile with activated link quality exstensions
- @echo per default.
- @echo can be found at files/olsrd.conf.default.lq
+ @echo a default configfile. Sample config files are installed
+ @echo as $(CFGFILE).default.full, $(CFGFILE).default.rfc,
+ @echo $(CFGFILE).default.lq and $(CFGFILE).default.lq-fisheye
+ @echo copy and edit one of these to $(CFGFILE)
+ @echo If in doubt start with $(CFGFILE).default.lq
@echo ==========================================================
mkdir -p $(ETCDIR)
- $(MAKECMDPREFIX)if [ -e $(CFGFILE) ]; then \
- cp -f files/olsrd.conf.default.lq $(CFGFILE).new; \
- echo "Configuration file was saved as $(CFGFILE).new"; \
- else \
- cp -f files/olsrd.conf.default.lq $(CFGFILE); \
- fi
+ -cp files/olsrd.conf.default.full $(CFGFILE).default.full
+ -cp files/olsrd.conf.default.rfc $(CFGFILE).default.rfc
+ -cp files/olsrd.conf.default.lq $(CFGFILE).default.lq
+ -cp files/olsrd.conf.default.lq-fisheye $(CFGFILE).default.lq-fisheye
@echo -------------------------------------------
@echo Edit $(CFGFILE) before running olsrd!!
@echo -------------------------------------------
@@ -0,0 +1,10 @@
--- lib/httpinfo/Makefile.orig 2016-11-22 19:39:42 UTC
+++ lib/httpinfo/Makefile
@@ -52,7 +52,6 @@ ifdef ADMIN_INTERFACE
CPPFLAGS += -DADMIN_INTERFACE
endif

-OBJS += $(TOPDIR)/src/cfgparser/cfgfile_gen.o

default_target: $(PLUGIN_FULLNAME)
ifdef ADMIN_INTERFACE
@@ -0,0 +1,73 @@
--- make/Makefile.fbsd.orig 2016-11-22 19:39:42 UTC
+++ make/Makefile.fbsd
@@ -45,44 +45,49 @@
# FREEBSD SPECIFIC CONFIGURATION
#

-PREFIX ?= /usr/local
-SBINDIR = $(PREFIX)/sbin
-ETCDIR = $(PREFIX)/etc/olsrd
-LIBDIR = $(PREFIX)/lib
-DOCDIR = $(PREFIX)/share/doc
-MANDIR = $(PREFIX)/man
+DESTDIR ?=
+prefix ?= /usr/local
+etcdir ?= $(prefix)/etc/olsrd
+libdir ?= $(prefix)/lib
+datarootdir ?= $(prefix)/share
+mandir ?= $(prefix)/man
+sbindir ?= $(prefix)/sbin

-SRCS += $(wildcard src/bsd/*.c) $(wildcard src/unix/*.c)
-HDRS += $(wildcard src/bsd/*.h) $(wildcard src/unix/*.h)
+# the rest are defined in Makefile.inc, but we don't need to override defaults
+ETCDIR = $(DESTDIR)$(etcdir)
+LIBDIR = $(DESTDIR)$(libdir)
+MANDIR = $(DESTDIR)$(mandir)
+SBINDIR = $(DESTDIR)$(sbindir)
+SHAREDIR = $(DESTDIR)$(datarootdir)

-LIBS =
+SRCS += $(wildcard src/bsd/*.c src/unix/*.c)
+HDRS += $(wildcard src/bsd/*.h src/unix/*.h)

CPPFLAGS += -DOLSRD_GLOBAL_CONF_FILE=\"$(CFGFILE)\"
+LIBS +=

ifdef NO_80211
CPPFLAGS += -DFBSD_NO_80211=1
endif

ifdef LIBNET
-
-CPPFLAGS += -DSPOOF -I$(PREFIX)/include
-LIBS += -L$(PREFIX)/lib -lnet
-
+CPPFLAGS += -I$(prefix)/include -DSPOOF
+LIBS += -L$(prefix)/lib -lnet
endif

+PLUGIN_SONAME ?= lib$(PLUGIN_NAME).so
+PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER)
+INSTALL_LIB = install -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME); \
+ /sbin/ldconfig -m $(LIBDIR)
+UNINSTALL_LIB = rm -f $(LIBDIR)/$(PLUGIN_FULLNAME); \
+ /sbin/ldconfig -m $(LIBDIR)
+
ifdef OLSRD_PLUGIN
CFLAGS += -fPIC
LDFLAGS += -fPIC
endif

-PLUGIN_SONAME ?= $(PLUGIN_NAME)
-PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER)
-INSTALL_LIB = install -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME); \
- /sbin/ldconfig
-UNINSTALL_LIB = rm -f $(LIBDIR)/$(PLUGIN_FULLNAME); \
- /sbin/ldconfig
-
-OS_LIB_PTHREAD = -pthread
+OS_LIB_PTHREAD = -lpthread
OS_CFLAG_PTHREAD = -pthread
OS_LIB_DYNLOAD =

@@ -0,0 +1,11 @@
--- src/bsd/net.c.orig 2016-06-22 12:04:33 UTC
+++ src/bsd/net.c
@@ -125,6 +125,8 @@

#include <sys/sysctl.h>

+#include "olsr_random.h"
+
static int ignore_redir;
static int send_redir;
static int gateway;
@@ -0,0 +1,8 @@
From the website:

The olsr.org OLSR daemon is an implementation of the Optimized Link
State Routing protocol. OLSR is a routing protocol for mobile ad-hoc
networks. The protocol is pro-active, table driven and utilizes a
technique called multipoint relaying for message flooding.

WWW: http://www.olsr.org/
@@ -0,0 +1,7 @@
[
{ type: install
message: <<EOM
Set olsrd_enable="YES" in /etc/rc.conf to enable
EOM
}
]
@@ -0,0 +1,15 @@
sbin/olsrd
%%ETCDIR%%/olsrd.conf.default.rfc
%%ETCDIR%%/olsrd.conf.default.lq
lib/olsrd_dot_draw.so.0.3
lib/olsrd_httpinfo.so.0.1
lib/olsrd_jsoninfo.so.1.1
lib/olsrd_mini.so.0.1
lib/olsrd_nameservice.so.0.4
lib/olsrd_netjson.so.1.1
lib/olsrd_pgraph.so.1.1
lib/olsrd_secure.so.0.6
lib/olsrd_txtinfo.so.1.1
lib/olsrd_watchdog.so.0.1
man/man5/olsrd.conf.5.gz
man/man8/olsrd.8.gz

0 comments on commit 8e3a3c4

Please sign in to comment.
You can’t perform that action at this time.