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