alfred: Support multiple listening interfaces
[feed/routing.git] / alfred / Makefile
1 #
2 # Copyright (C) 2013 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=alfred
11 PKG_VERSION:=2019.3
12 PKG_RELEASE:=1
13 PKG_HASH:=a4c37920de497701680abb55c49cdcd11e4e7135e0e7e79259c35492a3df4766
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
17 PKG_LICENSE:=GPL-2.0
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/alfred
22 URL:=https://www.open-mesh.org/
23 SECTION:=net
24 CATEGORY:=Network
25 TITLE:=A.L.F.R.E.D. - Almighty Lightweight Fact Remote Exchange Daemon
26 DEPENDS:= +libc @IPV6 +libnl-tiny +librt \
27 +ALFRED_NEEDS_lua:lua \
28 +ALFRED_NEEDS_libgps:libgps
29 endef
30
31 define Package/alfred/description
32 alfred is a user space daemon for distributing arbitrary local information over
33 the mesh/network in a decentralized fashion. This data can be anything which
34 appears to be useful - originally designed to replace the batman-adv
35 visualization (vis), you may distribute hostnames, phone books, administration
36 information, DNS information, the local weather forecast ...
37
38 alfred runs as daemon in the background of the system. A user may insert
39 information by using the alfred binary on the command line, or use special
40 programs to communicate with alfred (done via unix sockets). alfred then takes
41 care of distributing the local information to other alfred servers on other
42 nodes. This is done via IPv6 link-local multicast, and does not require any
43 configuration. A user can request data from alfred, and will receive the
44 information available from all alfred servers in the network.
45 endef
46
47 define Package/alfred/conffiles
48 /etc/config/alfred
49 endef
50
51 define Package/alfred/config
52 source "$(SOURCE)/Config.in"
53 endef
54
55 MAKE_FLAGS += \
56 CONFIG_ALFRED_VIS=$(if $(CONFIG_PACKAGE_ALFRED_VIS),y,n) \
57 CONFIG_ALFRED_GPSD=$(if $(CONFIG_PACKAGE_ALFRED_GPSD),y,n) \
58 CONFIG_ALFRED_CAPABILITIES=n \
59 LIBNL_NAME="libnl-tiny" \
60 LIBNL_GENL_NAME="libnl-tiny" \
61 REVISION="openwrt-$(PKG_VERSION)-$(PKG_RELEASE)"
62
63 TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
64 TARGET_LDFLAGS += -Wl,--gc-sections -fuse-linker-plugin
65
66 define Package/alfred/install
67 $(INSTALL_DIR) $(1)/usr/sbin
68 cp -fpR $(PKG_BUILD_DIR)/alfred $(1)/usr/sbin/
69 [ "x$(CONFIG_PACKAGE_ALFRED_VIS)" == "xy" ] && cp -fpR $(PKG_BUILD_DIR)/vis/batadv-vis $(1)/usr/sbin/ ; true
70 [ "x$(CONFIG_PACKAGE_ALFRED_GPSD)" == "xy" ] && cp -fpR $(PKG_BUILD_DIR)/gpsd/alfred-gpsd $(1)/usr/sbin/ ; true
71 $(INSTALL_DIR) $(1)/etc/init.d
72 $(INSTALL_BIN) ./files/alfred.init $(1)/etc/init.d/alfred
73 $(INSTALL_DIR) $(1)/etc/config
74 $(INSTALL_DATA) ./files/alfred.config $(1)/etc/config/alfred
75 $(INSTALL_DIR) $(1)/etc/alfred
76 [ "x$(CONFIG_PACKAGE_ALFRED_BATHOSTS)" == "xy" ] && $(INSTALL_BIN) ./files/bat-hosts.lua $(1)/etc/alfred/bat-hosts.lua ; true
77 endef
78
79 $(eval $(call BuildPackage,alfred))