diff --git a/openwrt/package/olsrd/Config.in b/openwrt/package/olsrd/Config.in index e598c2c89..9bef83f46 100644 --- a/openwrt/package/olsrd/Config.in +++ b/openwrt/package/olsrd/Config.in @@ -1,5 +1,45 @@ config BR2_PACKAGE_OLSRD - tristate "olsrd" + tristate "olsrd - OLSR (Optimized Link State Routing) daemon" default m if CONFIG_DEVEL help - The Optimized Link State Routing daemon + The Optimized Link State Routing daemon + + http://www.olsr.org/ + + +config BR2_PACKAGE_OLSRD_MOD_DOT_DRAW + depends BR2_PACKAGE_OLSRD + prompt "mod-dot-draw - a dot topology information plugin" + tristate + default m if CONFIG_DEVEL + +config BR2_PACKAGE_OLSRD_MOD_DYN_GW + depends BR2_PACKAGE_OLSRD + prompt "mod-dyn-gw - a dynamic internet gateway plugin" + tristate + default m if CONFIG_DEVEL + +config BR2_PACKAGE_OLSRD_MOD_HTTPINFO + depends BR2_PACKAGE_OLSRD + prompt "mod-httpinfo - a small informative web server plugin" + tristate + default m if CONFIG_DEVEL + +config BR2_PACKAGE_OLSRD_MOD_NAMESERVICE + depends BR2_PACKAGE_OLSRD + prompt "mod-nameservice - a lightweight hostname resolver plugin" + tristate + default m if CONFIG_DEVEL + +config BR2_PACKAGE_OLSRD_MOD_POWER + depends BR2_PACKAGE_OLSRD + prompt "mod-power - a power status plugin" + tristate + default m if CONFIG_DEVEL + +config BR2_PACKAGE_OLSRD_MOD_SECURE + depends BR2_PACKAGE_OLSRD + prompt "mod-secure - a message signing plugin to secure olsrd routing domain" + tristate + default m if CONFIG_DEVEL + diff --git a/openwrt/package/olsrd/Makefile b/openwrt/package/olsrd/Makefile index 9317d5502..0060fd9c7 100644 --- a/openwrt/package/olsrd/Makefile +++ b/openwrt/package/olsrd/Makefile @@ -9,52 +9,67 @@ PKG_MD5SUM:=593c0861fa10d2a8d0e7d8617479c5cf PKG_SOURCE_URL:=http://www.olsr.org/releases/0.4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_CAT:=bzcat -PKG_IPK:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk -PKG_IPK_DIR:=$(PKG_BUILD_DIR)/ipkg -$(DL_DIR)/$(PKG_SOURCE): - $(SCRIPT_DIR)/download.pl $(DL_DIR) $(PKG_SOURCE) $(PKG_MD5SUM) $(PKG_SOURCE_URL) +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install -$(PKG_BUILD_DIR)/.unpacked: $(DL_DIR)/$(PKG_SOURCE) - $(PKG_CAT) $(DL_DIR)/$(PKG_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - - touch $(PKG_BUILD_DIR)/.unpacked +include $(TOPDIR)/package/rules.mk -$(PKG_BUILD_DIR)/$(PKG_NAME): $(PKG_BUILD_DIR)/.unpacked +define PKG_mod_template + +$$(IPKG_$(1)): + install -d -m0755 $$(IDIR_$(1))/usr/lib + install -m0755 $(PKG_INSTALL_DIR)/usr/lib/olsrd_$(2).so.* $$(IDIR_$(1))/usr/lib/ + $(RSTRIP) $$(IDIR_$(1)) + $(IPKG_BUILD) $$(IDIR_$(1)) $(PACKAGE_DIR) + +endef + +$(eval $(call PKG_template,OLSRD,olsrd,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) +$(eval $(call PKG_template,OLSRD_MOD_DOT_DRAW,olsrd-mod-dot-draw,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) +$(eval $(call PKG_template,OLSRD_MOD_DYN_GW,olsrd-mod-dyn-gw,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) +$(eval $(call PKG_template,OLSRD_MOD_HTTPINFO,olsrd-mod-httpinfo,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) +$(eval $(call PKG_template,OLSRD_MOD_NAMESERVICE,olsrd-mod-nameservice,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) +$(eval $(call PKG_template,OLSRD_MOD_POWER,olsrd-mod-power,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) +$(eval $(call PKG_template,OLSRD_MOD_SECURE,olsrd-mod-secure,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH))) + +$(eval $(call PKG_mod_template,OLSRD_MOD_DOT_DRAW,dot_draw)) +$(eval $(call PKG_mod_template,OLSRD_MOD_DYN_GW,dyn_gw)) +$(eval $(call PKG_mod_template,OLSRD_MOD_HTTPINFO,httpinfo)) +$(eval $(call PKG_mod_template,OLSRD_MOD_NAMESERVICE,nameservice)) +$(eval $(call PKG_mod_template,OLSRD_MOD_POWER,power)) +$(eval $(call PKG_mod_template,OLSRD_MOD_SECURE,secure)) + +$(PKG_BUILD_DIR)/.configured: + touch $(PKG_BUILD_DIR)/.configured + +$(PKG_BUILD_DIR)/.built: $(MAKE) -C "$(PKG_BUILD_DIR)" \ + $(TARGET_CONFIGURE_OPTS) \ + OFLAGS="$(TARGET_CFLAGS)" \ OS="linux" \ - CC="$(TARGET_CC)" \ - CFLAGS="$(TARGET_CFLAGS) -DOLSR_PLUGIN -I. -Isrc -Dlinux -I../../src -DNODEBUG" \ - libs + all libs + rm -rf $(PKG_INSTALL_DIR) + mkdir -p $(PKG_INSTALL_DIR) $(MAKE) -C "$(PKG_BUILD_DIR)" \ + INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \ OS="linux" \ - CC="$(TARGET_CC)" \ - CFLAGS="$(TARGET_CFLAGS) -I. -Isrc -Dlinux -I../../src -DNODEBUG" \ - all + install install_libs + touch $(PKG_BUILD_DIR)/.built -$(PKG_IPK): $(PKG_BUILD_DIR)/$(PKG_NAME) - $(SCRIPT_DIR)/make-ipkg-dir.sh $(PKG_IPK_DIR) $(PKG_NAME).control $(PKG_VERSION)-$(PKG_RELEASE) $(ARCH) - mkdir -p $(PKG_IPK_DIR)/usr/sbin - mkdir -p $(PKG_IPK_DIR)/usr/lib - cp $(PKG_BUILD_DIR)/$(PKG_NAME) $(PKG_IPK_DIR)/usr/sbin/ - cp $(PKG_BUILD_DIR)/lib/dyn_gw/olsrd_dyn_gw.so.0.3 $(PKG_IPK_DIR)/usr/lib/ - cp $(PKG_BUILD_DIR)/lib/nameservice/olsrd_nameservice.so.0.2 $(PKG_IPK_DIR)/usr/lib/ - cp $(PKG_BUILD_DIR)/lib/httpinfo/olsrd_httpinfo.so.0.1 $(PKG_IPK_DIR)/usr/lib/ - cp $(PKG_BUILD_DIR)/lib/secure/olsrd_secure.so.0.5 $(PKG_IPK_DIR)/usr/lib/ - $(STRIP) $(PKG_IPK_DIR)/usr/sbin/* - $(STRIP) $(PKG_IPK_DIR)/usr/lib/* - mkdir -p $(PACKAGE_DIR) - $(IPKG_BUILD) $(PKG_IPK_DIR) $(PACKAGE_DIR) +$(IPKG_OLSRD): + install -d -m0755 $(IDIR_OLSRD)/etc + cp -fpR $(PKG_INSTALL_DIR)/etc/olsrd.conf $(IDIR_OLSRD)/etc/ + install -d -m0755 $(IDIR_OLSRD)/usr/sbin + cp -fpR $(PKG_INSTALL_DIR)/usr/sbin/olsrd $(IDIR_OLSRD)/usr/sbin/ + install -d -m0755 $(IDIR_OLSRD)/etc/init.d + cp -fpR ./files/olsrd.init $(IDIR_OLSRD)/etc/init.d/olsrd + $(RSTRIP) $(IDIR_OLSRD) + $(IPKG_BUILD) $(IDIR_OLSRD) $(PACKAGE_DIR) -$(IPKG_STATE_DIR)/info/$(PKG_NAME).list: $(PKG_IPK) - $(IPKG) install $(PKG_IPK) +$(IPKG_OLSRD_MOD_SECURE): $(IDIR_OLSRD_MOD_SECURE)/etc/olsrd.d/olsrd_secure_key -source: $(DL_DIR)/$(PKG_SOURCE) -prepare: $(PKG_BUILD_DIR)/.unpacked -compile: $(PKG_IPK) -install: $(IPKG_STATE_DIR)/info/$(PKG_NAME).list - -clean: - rm -rf $(PKG_BUILD_DIR) - rm -f $(PKG_IPK) +$(IDIR_OLSRD_MOD_SECURE)/etc/olsrd.d/olsrd_secure_key: + install -d -m0755 $(IDIR_OLSRD_MOD_SECURE)/etc/olsrd.d + cp -fpR ./files/olsrd_secure_key $(IDIR_OLSRD_MOD_SECURE)/etc/olsrd.d/ diff --git a/openwrt/package/olsrd/files/olsrd.init b/openwrt/package/olsrd/files/olsrd.init new file mode 100644 index 000000000..1f1fdb951 --- /dev/null +++ b/openwrt/package/olsrd/files/olsrd.init @@ -0,0 +1,15 @@ +#!/bin/sh + +DEFAULT=/etc/default/olsrd +[ -f $DEFAULT ] && . $DEFAULT + +case $1 in + start) + olsrd $OPTIONS + ;; + *) + echo "usage: $0 (start)" + exit 1 +esac + +exit $? diff --git a/openwrt/package/olsrd/files/olsrd_secure_key b/openwrt/package/olsrd/files/olsrd_secure_key new file mode 100644 index 000000000..4a7d7258f --- /dev/null +++ b/openwrt/package/olsrd/files/olsrd_secure_key @@ -0,0 +1 @@ +1234567890123456 \ No newline at end of file diff --git a/openwrt/package/olsrd/ipkg/olsrd-mod-dot-draw.control b/openwrt/package/olsrd/ipkg/olsrd-mod-dot-draw.control new file mode 100644 index 000000000..0cea9d6be --- /dev/null +++ b/openwrt/package/olsrd/ipkg/olsrd-mod-dot-draw.control @@ -0,0 +1,9 @@ +Package: olsrd-mod-dot-draw +Priority: optional +Section: net +Version: [TBDL] +Architecture: [TBDL] +Maintainer: Nico +Source: http://nthill.free.fr/openwrt/sources/olsrd/ +Description: a dot topology information plugin for olsrd +Depends: olsrd diff --git a/openwrt/package/olsrd/ipkg/olsrd-mod-dyn-gw.control b/openwrt/package/olsrd/ipkg/olsrd-mod-dyn-gw.control new file mode 100644 index 000000000..32767abf8 --- /dev/null +++ b/openwrt/package/olsrd/ipkg/olsrd-mod-dyn-gw.control @@ -0,0 +1,9 @@ +Package: olsrd-mod-dyn-gw +Priority: optional +Section: net +Version: [TBDL] +Architecture: [TBDL] +Maintainer: Nico +Source: http://nthill.free.fr/openwrt/sources/olsrd/ +Description: a dynamic internet gateway plugin for olsrd +Depends: olsrd diff --git a/openwrt/package/olsrd/ipkg/olsrd-mod-httpinfo.control b/openwrt/package/olsrd/ipkg/olsrd-mod-httpinfo.control new file mode 100644 index 000000000..c42cf3a01 --- /dev/null +++ b/openwrt/package/olsrd/ipkg/olsrd-mod-httpinfo.control @@ -0,0 +1,9 @@ +Package: olsrd-mod-httpinfo +Priority: optional +Section: net +Version: [TBDL] +Architecture: [TBDL] +Maintainer: Nico +Source: http://nthill.free.fr/openwrt/sources/olsrd/ +Description: a small informative web server plugin for olsrd +Depends: olsrd diff --git a/openwrt/package/olsrd/ipkg/olsrd-mod-nameservice.control b/openwrt/package/olsrd/ipkg/olsrd-mod-nameservice.control new file mode 100644 index 000000000..4db6638a3 --- /dev/null +++ b/openwrt/package/olsrd/ipkg/olsrd-mod-nameservice.control @@ -0,0 +1,9 @@ +Package: olsrd-mod-nameservice +Priority: optional +Section: net +Version: [TBDL] +Architecture: [TBDL] +Maintainer: Nico +Source: http://nthill.free.fr/openwrt/sources/olsrd/ +Description: a lightweight hostname resolver plugin for olsrd +Depends: olsrd diff --git a/openwrt/package/olsrd/ipkg/olsrd-mod-power.control b/openwrt/package/olsrd/ipkg/olsrd-mod-power.control new file mode 100644 index 000000000..4f3ba6fd4 --- /dev/null +++ b/openwrt/package/olsrd/ipkg/olsrd-mod-power.control @@ -0,0 +1,9 @@ +Package: olsrd-mod-power +Priority: optional +Section: net +Version: [TBDL] +Architecture: [TBDL] +Maintainer: Nico +Source: http://nthill.free.fr/openwrt/sources/olsrd/ +Description: a power status plugin for olsrd +Depends: olsrd diff --git a/openwrt/package/olsrd/ipkg/olsrd-mod-secure.conffiles b/openwrt/package/olsrd/ipkg/olsrd-mod-secure.conffiles new file mode 100644 index 000000000..34e90b80a --- /dev/null +++ b/openwrt/package/olsrd/ipkg/olsrd-mod-secure.conffiles @@ -0,0 +1 @@ +/etc/olsrd.d/olsrd_secure_key diff --git a/openwrt/package/olsrd/ipkg/olsrd-mod-secure.control b/openwrt/package/olsrd/ipkg/olsrd-mod-secure.control new file mode 100644 index 000000000..de154094f --- /dev/null +++ b/openwrt/package/olsrd/ipkg/olsrd-mod-secure.control @@ -0,0 +1,9 @@ +Package: olsrd-mod-secure +Priority: optional +Section: net +Version: [TBDL] +Architecture: [TBDL] +Maintainer: Nico +Source: http://nthill.free.fr/openwrt/sources/olsrd/ +Description: a message signing plugin to secure olsrd routing domain +Depends: olsrd diff --git a/openwrt/package/olsrd/ipkg/olsrd.conffiles b/openwrt/package/olsrd/ipkg/olsrd.conffiles new file mode 100644 index 000000000..a0b5e8eaa --- /dev/null +++ b/openwrt/package/olsrd/ipkg/olsrd.conffiles @@ -0,0 +1 @@ +/etc/olsrd.conf diff --git a/openwrt/package/olsrd/ipkg/olsrd.control b/openwrt/package/olsrd/ipkg/olsrd.control new file mode 100644 index 000000000..0d2a2bc14 --- /dev/null +++ b/openwrt/package/olsrd/ipkg/olsrd.control @@ -0,0 +1,10 @@ +Package: olsrd +Priority: optional +Section: net +Maintainer: Felix Fietkau +Source: buildroot internal +Description: The olsr.org OLSR daemon + olsrd 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. diff --git a/openwrt/package/olsrd/patches/olsrd-0.4.9-opt-flags.diff b/openwrt/package/olsrd/patches/olsrd-0.4.9-opt-flags.diff new file mode 100644 index 000000000..c601ae015 --- /dev/null +++ b/openwrt/package/olsrd/patches/olsrd-0.4.9-opt-flags.diff @@ -0,0 +1,13 @@ +diff -ruN olsrd-0.4.9-orig/Makefile olsrd-0.4.9-1/Makefile +--- olsrd-0.4.9-orig/Makefile 2005-03-31 20:39:24.000000000 +0200 ++++ olsrd-0.4.9-1/Makefile 2005-04-05 02:14:48.000000000 +0200 +@@ -72,7 +72,8 @@ + SRCS += $(wildcard src/linux/*.c) $(wildcard src/unix/*.c) + HDRS += $(wildcard src/linux/*.h) $(wildcard src/unix/*.h) + DEFINES = -Dlinux +-CFLAGS ?= $(CCWARNINGS) -O2 -g #-DDEBUG #-pg #-march=i686 ++OFLAGS ?= -O2 -g ++CFLAGS ?= $(CCWARNINGS) $(OFLAGS) #-DDEBUG #-pg #-march=i686 + LIBS = -lm -ldl #-pg + MAKEDEPEND = makedepend -f $(DEPFILE) $(DEFINES) -Y $(INCLUDES) $(SRCS) >/dev/null 2>&1 + diff --git a/openwrt/package/olsrd/patches/olsrd-0.4.9-secure-key-path.path b/openwrt/package/olsrd/patches/olsrd-0.4.9-secure-key-path.path new file mode 100644 index 000000000..fcae75986 --- /dev/null +++ b/openwrt/package/olsrd/patches/olsrd-0.4.9-secure-key-path.path @@ -0,0 +1,12 @@ +diff -ruN olsrd-0.4.9-orig/lib/secure/src/olsrd_secure.h olsrd-0.4.9-1/lib/secure/src/olsrd_secure.h +--- olsrd-0.4.9-orig/lib/secure/src/olsrd_secure.h 2005-03-10 20:57:48.000000000 +0100 ++++ olsrd-0.4.9-1/lib/secure/src/olsrd_secure.h 2005-04-05 00:51:40.000000000 +0200 +@@ -43,7 +43,7 @@ + + #include "olsrd_plugin.h" + +-#define KEYFILE "/root/.olsr/olsrd_secure_key" ++#define KEYFILE "/etc/olsrd.d/olsrd_secure_key" + + /* Schemes */ + #define ONE_CHECKSUM 1