Skip to content

Commit

Permalink
routing: merge openwrt-routing/packages
Browse files Browse the repository at this point in the history
Following the discussion at openwrt-routing/packages there is a majority
in favor to merge the two repositories[0]. The reasonable doubt of
@bittorf[1] (notification bloat) is solvable by using a CODEOWNERS[2]
file, allowing individual notifications on specific folders.

This eventually unifies things belonging together, adds more eyes to the
routing packages, introduces automatic pull requests testing and even
removes a line from feeds.conf!

[0]: openwrt/routing#184 (comment)
[1]: openwrt/routing#184 (comment)
[2]: https://help.github.com/en/articles/about-code-owners

Signed-off-by: Paul Spooren <[email protected]>
  • Loading branch information
aparcar committed Jul 5, 2019
1 parent 2b29d83 commit 968e92a
Show file tree
Hide file tree
Showing 227 changed files with 20,810 additions and 0 deletions.
57 changes: 57 additions & 0 deletions net/ahcpd/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# Copyright (C) 2007-2011 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:=ahcpd
PKG_VERSION:=0.53
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.pps.univ-paris-diderot.fr/~jch/software/files/
PKG_MD5SUM:=a1a610bf20965aa522cd766bf3d5829a
PKG_LICENSE:=MIT


include $(INCLUDE_DIR)/package.mk

define Package/ahcpd
SECTION:=net
CATEGORY:=Network
TITLE:=Ad-Hoc Configuration Protocol daemon
URL:=http://www.pps.univ-paris-diderot.fr/~jch/software/ahcp/
MAINTAINER:=Gabriel Kerneis <[email protected]>
DEPENDS:=@IPV6 +ip +librt
endef

define Package/ahcpd/description
Ahcpd is a daemon for configuring an IPv6 network using the Ad-Hoc
Configuration Protocol (AHCP). AHCP is designed for wireless mesh
networks, where IPv6 autoconfiguration and DHCPv6 do not work, but may
also be used on wired networks.
endef

define Package/ahcpd/conffiles
/etc/config/ahcpd
endef

MAKE_FLAGS += \
EXTRA_DEFINES="$(TARGET_CFLAGS)"

define Package/ahcpd/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_DIR) $(1)/etc/ahcp
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ahcp-config.sh $(1)/etc/ahcp/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ahcpd $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/ahcpd.config $(1)/etc/config/ahcpd
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/ahcpd.init $(1)/etc/init.d/ahcpd
endef

$(eval $(call BuildPackage,ahcpd))
32 changes: 32 additions & 0 deletions net/ahcpd/files/ahcpd.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package ahcpd

config ahcpd
# Choose ahcp mode: client (default), server or forwarder
## option 'mode' 'client'
# Uncomment the following lines to enable ahcpd on the desired
# interfaces.
## list 'interface' 'lan'
## list 'interface' 'wlan'

# The following only makes sense in 'server' mode.
# Tweak to suit your needs.
## list 'prefix' 'fde6:20f5:c9ac:358::/64'
## list 'prefix' '192.168.4.128/25'
## list 'name_server' 'fde6:20f5:c9ac:358::1'
## list 'name_server' '192.168.4.1'
## list 'ntp_server' '192.168.4.2'
## option 'lease_dir' '/var/lib/leases'

# option 'id_file' '/var/lib/ahcp-unique-id'
# option 'log_file' '/var/log/ahcpd.log'
# The configuration file is not necessary since you can configure
# everything from this file. But still, you might prefer using it.
## option 'conf_file' '/etc/ahcp/ahcp.conf'

# option 'multicast_address' 'ff02::cca6:c0f9:e182:5359'
# option 'port' '5359'
# option 'ipv4_only' 'false'
# option 'ipv6_only' 'false'
# option 'lease_time' '3666'
# option 'debug' '1'

109 changes: 109 additions & 0 deletions net/ahcpd/files/ahcpd.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2007-2011 OpenWrt.org

START=71

SERVICE_USE_PID=1

EXTRA_COMMANDS="status"
EXTRA_HELP=" status Print ahcpd's status to the log file."

append_bool() {
local section="$1"
local option="$2"
local value="$3"
local _loctmp
config_get_bool _loctmp "$section" "$option" 0
[ "$_loctmp" -gt 0 ] && append args "$value"
}

append_parm() {
local section="$1"
local option="$2"
local switch="$3"
local _loctmp
config_get _loctmp "$section" "$option"
[ -z "$_loctmp" ] && return 0
append args "$switch $_loctmp"
}

append_stmt() {
local name="$1"
local switch="$2"
append args "-C '$switch $name'"
}

append_opt_stmt() {
local section="$1"
local option="$2"
local switch="$3"
local _loctmp
config_get _loctmp "$section" "$option"
[ -z "$_loctmp" ] && return 0
append args "-C '$switch $_loctmp'"
}

ahcp_addif() {
local ifname=$(uci_get_state network "$1" ifname "$1")
append interfaces "$ifname"
}

ahcp_server() {
local cfg="$1"

append_opt_stmt "$cfg" 'mode' 'mode'
append_opt_stmt "$cfg" 'lease_dir' 'lease-dir'
config_list_foreach "$cfg" 'prefix' append_stmt 'prefix'
config_list_foreach "$cfg" 'name_server' append_stmt 'name-server'
config_list_foreach "$cfg" 'ntp_server' append_stmt 'ntp-server'

append_parm "$cfg" 'id_file' '-i'
append_parm "$cfg" 'log_file' '-L'
}

ahcp_config() {
local cfg="$1"
local interface
local _loctmp

config_list_foreach "$cfg" 'interface' ahcp_addif

# Add interfaces with "option proto ahcp" in /etc/config/network
# (only for client mode)
config_get _loctmp "$cfg" "mode"
if [ -z "$_loctmp" -o "$_loctmp" = "client" ]; then
for interface in $(uci -P /var/state show network|grep proto=ahcp|cut -d. -f2); do
ahcp_addif $interface
done
fi

append_bool "$cfg" 'ipv4_only' '-4'
append_bool "$cfg" 'ipv6_only' '-6'
append_bool "$cfg" 'no_dns' '-N'

append_parm "$cfg" 'multicast_address' '-m'
append_parm "$cfg" 'port' '-p'
append_parm "$cfg" 'lease_time' '-t'
append_parm "$cfg" 'debug' '-d'
append_parm "$cfg" 'conf_file' '-c'
append_parm "$cfg" 'script' '-s'
}

start() {
mkdir -p /var/lib
config_load ahcpd
unset args
unset interfaces
config_foreach ahcp_config ahcpd
config_foreach ahcp_server ahcpd
[ -z "$interfaces" ] && return 0
eval "service_start /usr/sbin/ahcpd -D $args $interfaces"
}

stop() {
service_stop /usr/sbin/ahcpd
}

status() {
SERVICE_SIG="USR1" service_signal /usr/sbin/ahcpd
}
22 changes: 22 additions & 0 deletions net/alfred/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
config ALFRED_NEEDS_lua
bool

config ALFRED_NEEDS_libgps
bool

config PACKAGE_ALFRED_VIS
bool "enable vis server for alfred"
depends on PACKAGE_alfred
default y

config PACKAGE_ALFRED_BATHOSTS
bool "enable autogeneration of /etc/bat-hosts"
depends on PACKAGE_alfred
select ALFRED_NEEDS_lua
default n

config PACKAGE_ALFRED_GPSD
bool "enable gpsd service for alfred"
depends on PACKAGE_alfred
select ALFRED_NEEDS_libgps
default n
87 changes: 87 additions & 0 deletions net/alfred/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#
# Copyright (C) 2013 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:=alfred
PKG_VERSION:=2019.2
PKG_RELEASE:=0
PKG_HASH:=b656f0e9a97a99c7531b6d49ebfd663451c16cdd275bbf7d48ff8daed3880bf2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0

include $(INCLUDE_DIR)/package.mk

init-y := alfred

define Package/alfred
URL:=https://www.open-mesh.org/
SECTION:=net
CATEGORY:=Network
TITLE:=A.L.F.R.E.D. - Almighty Lightweight Fact Remote Exchange Daemon
DEPENDS:= +libc @IPV6 +libnl-tiny +librt \
+ALFRED_NEEDS_lua:lua \
+ALFRED_NEEDS_libgps:libgps
endef

define Package/alfred/description
alfred is a user space daemon for distributing arbitrary local information over
the mesh/network in a decentralized fashion. This data can be anything which
appears to be useful - originally designed to replace the batman-adv
visualization (vis), you may distribute hostnames, phone books, administration
information, DNS information, the local weather forecast ...

alfred runs as daemon in the background of the system. A user may insert
information by using the alfred binary on the command line, or use special
programs to communicate with alfred (done via unix sockets). alfred then takes
care of distributing the local information to other alfred servers on other
nodes. This is done via IPv6 link-local multicast, and does not require any
configuration. A user can request data from alfred, and will receive the
information available from all alfred servers in the network.
endef

define Package/alfred/conffiles
/etc/config/alfred
endef

define Package/alfred/config
source "$(SOURCE)/Config.in"
endef

MAKE_ALFRED_FLAGS=\
CONFIG_ALFRED_VIS=$(if $(CONFIG_PACKAGE_ALFRED_VIS),y,n) \
CONFIG_ALFRED_GPSD=$(if $(CONFIG_PACKAGE_ALFRED_GPSD),y,n) \
CONFIG_ALFRED_CAPABILITIES=n \
LIBNL_NAME="libnl-tiny" \
LIBNL_GENL_NAME="libnl-tiny" \
REVISION="openwrt-$(PKG_VERSION)-$(PKG_RELEASE)"

TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
TARGET_LDFLAGS += -Wl,--gc-sections -fuse-linker-plugin

define Build/Compile
CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
$(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) $(MAKE_ALFRED_FLAGS) all
endef

define Package/alfred/install
$(INSTALL_DIR) $(1)/usr/sbin
cp -fpR $(PKG_BUILD_DIR)/alfred $(1)/usr/sbin/
[ "x$(CONFIG_PACKAGE_ALFRED_VIS)" == "xy" ] && cp -fpR $(PKG_BUILD_DIR)/vis/batadv-vis $(1)/usr/sbin/ ; true
[ "x$(CONFIG_PACKAGE_ALFRED_GPSD)" == "xy" ] && cp -fpR $(PKG_BUILD_DIR)/gpsd/alfred-gpsd $(1)/usr/sbin/ ; true
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/alfred.init $(1)/etc/init.d/alfred
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/alfred.config $(1)/etc/config/alfred
$(INSTALL_DIR) $(1)/etc/alfred
[ "x$(CONFIG_PACKAGE_ALFRED_BATHOSTS)" == "xy" ] && $(INSTALL_BIN) ./files/bat-hosts.lua $(1)/etc/alfred/bat-hosts.lua ; true
endef

$(eval $(call BuildPackage,alfred))
8 changes: 8 additions & 0 deletions net/alfred/files/alfred.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
config 'alfred' 'alfred'
option interface 'br-lan'
option mode 'master'
option batmanif 'bat0'
option start_vis '1'
option run_facters '1'
# REMOVE THIS LINE TO ENABLE ALFRED
option disabled '1'
Loading

0 comments on commit 968e92a

Please sign in to comment.