summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaverio Proto <zioproto@gmail.com>2018-05-02 13:48:10 +0200
committerGitHub <noreply@github.com>2018-05-02 13:48:10 +0200
commitf1875d656c800171e276c0b0e983b2e986cbaa86 (patch)
tree14b6ebdab02bc39fcb58bd7e5ca911b572c9e88c
parent190f1b079f1c585134d6a521165db14b63e99315 (diff)
parent3dd4096da285f83ab59512cd974f2a0380a77c43 (diff)
Merge pull request #373 from gabri94/lede-17.01
prince: version bump to v0.4
-rw-r--r--poprouting/Makefile45
-rw-r--r--prince/Makefile66
-rw-r--r--prince/files/prince.conf16
-rw-r--r--prince/files/prince.init20
4 files changed, 102 insertions, 45 deletions
diff --git a/poprouting/Makefile b/poprouting/Makefile
deleted file mode 100644
index 0f51a8b..0000000
--- a/poprouting/Makefile
+++ /dev/null
@@ -1,45 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=prince
-PKG_VERSION:=v0.3.1
-PKG_RELEASE:=1
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_USE_MIPS16:=0
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE:=prince-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://github.com/gabri94/poprouting.git
-PKG_SOURCE_VERSION:=v0.3.1
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
-include $(INCLUDE_DIR)/package.mk
-
-define Package/prince
- SECTION :=net
- CATEGORY :=Network
- SUBMENU :=Routing and Redirection
- Mantainer :=Gabriele Gemmi <gabriel@autistici.org>
- TITLE :=PopRouting daemon
- URL :=https://github.com/gabri94/poprouting
- MENU :=0
- DEPENDS := +libjson-c +libpthread
-endef
-
-define Package/prince/description
-Prince is an open source implementation of the PopRouting Algorithm.
-It has been developed as a Google Summer of Code Project in collaboration with Freifunk and the University of Trento.
-
-It work by fetching topology data from a Link State routing demon(OONF, OLSR, OSPF, etc),
-calculating the betweenness centrality using the topology, then using these data
-the timer's value are optimized. Finally the timers are pushed back to the routing demon.
-Currently it only supports OLSRd2 (aka OONF).
-endef
-
-define Package/prince/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/output/prince $(1)/usr/sbin/
- $(INSTALL_DATA) $(PKG_BUILD_DIR)/output/libprince_oonf_c.so $(1)/usr/lib/
-endef
-
-
-$(eval $(call BuildPackage,prince))
diff --git a/prince/Makefile b/prince/Makefile
new file mode 100644
index 0000000..046dc17
--- /dev/null
+++ b/prince/Makefile
@@ -0,0 +1,66 @@
+#
+# Copyright (C) 2009-2018 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=prince
+PKG_VERSION:=v0.4
+PKG_RELEASE:=1
+
+# out of source build
+CMAKE_BINARY_SUBDIR:=build
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/prince-$(PKG_VERSION)
+PKG_MIRROR_HASH:=19a3cae09f28a5ef07fc0f5ff12cf62c776a94fbf1626336ab04951775c104de
+PKG_INSTALL:=0
+PKG_LICENSE:=MIT
+PKG_SOURCE:=prince-$(PKG_VERSION).tar.xz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=prince-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/AdvancedNetworkingSystems/prince.git
+PKG_SOURCE_VERSION:=v0.4
+PKG_USE_MIPS16:=0
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/prince
+ SECTION :=net
+ CATEGORY :=Network
+ SUBMENU :=Routing and Redirection
+ Mantainer :=Gabriele Gemmi <gabriel@autistici.org>
+ TITLE :=Prince
+ URL :=https://github.com/AdvancedNetworkingSystems/prince
+ MENU :=0
+ DEPENDS := +libjson-c +libpthread
+endef
+
+define Package/prince/description
+ Prince is an open source implementation of the PopRouting Algorithm.
+ It has been developed as a Google Summer of Code Project in collaboration with Freifunk and the University of Trento.
+
+ Prince fetches topology data from a Link State routing daemon (OONF, OLSR, OSPF, etc),
+ calculates the betweenness centrality using the topology and then computes the
+ the timers' optimal values using these data. At the end of the computation the timers are pushed back to the routing daemon.
+ Since v0.4 it supports both OONF and OLSRd.
+endef
+
+define Package/prince/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/prince $(1)/usr/bin/prince
+ $(INSTALL_BIN) ./files/prince.init $(1)/etc/init.d/prince
+ $(INSTALL_DATA) ./files/prince.conf $(1)/etc/prince.conf
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/build/libprince_oonf.so $(1)/usr/lib
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/build/libprince_olsr.so $(1)/usr/lib
+endef
+
+CFLAGS += $(TARGET_CFLAGS) $(TARGET_CPPFLAGS)
+LDFLAGS += $(TARGET_LDFLAGS)
+
+$(eval $(call BuildPackage,prince))
diff --git a/prince/files/prince.conf b/prince/files/prince.conf
new file mode 100644
index 0000000..7ffbcd4
--- /dev/null
+++ b/prince/files/prince.conf
@@ -0,0 +1,16 @@
+{
+ "proto": {
+ "protocol": "oonf",
+ "host": "127.0.0.1",
+ "port": 2009 ,
+ "refresh": 10,
+ "timer_port": 2009
+ },
+ "graph-parser": {
+ "heuristic": 1,
+ "weights": 1,
+ "recursive": 0,
+ "stop_unchanged": 0,
+ "multithreaded": 0
+ }
+}
diff --git a/prince/files/prince.init b/prince/files/prince.init
new file mode 100644
index 0000000..12f0c8f
--- /dev/null
+++ b/prince/files/prince.init
@@ -0,0 +1,20 @@
+#!/bin/sh /etc/rc.common
+# Init script for Prince
+# Copyright (C) 2018 OpenWrt.org
+
+USE_PROCD=1
+START=99
+STOP=15
+
+PROG="/usr/bin/prince"
+CONF="/etc/prince.conf"
+
+start_service(){
+ procd_open_instance
+ procd_set_param command $PROG $CONF
+ procd_set_param stdout 1
+ procd_set_param stderr 1
+ procd_set_param user nobody
+ procd_close_instance
+ echo "Prince started"
+}