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