1include $(TOPDIR)/rules.mk
2
3# Build package version from git sha-1
4PKG_NAME:=aperture
5PKG_SOURCE_PROTO:=git
6PKG_SOURCE_URL:=ssh://qca-git01.qualcomm.com:29418/streamboost/aperture
7PKG_BRANCH:=banana
8PKG_START_ORDER:=81
9PKG_RELEASE:=2
10
11include $(INCLUDE_DIR)/local-development.mk
12ifeq ($(DUMP)$(PKG_VERSION),)
13PKG_REV:=2e65dce
14PKG_VERSION:=g2e65dce
15endif
16PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
17PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18PKG_SOURCE_VERSION:=$(PKG_REV)
19PKG_SOURCE_MIRROR:=none
20PKG_BUILD_DEPENDS:=jansson argp-standalone curl libxml2
21
22include $(INCLUDE_DIR)/package-version-override.mk
23include $(INCLUDE_DIR)/package.mk
24
25# use SPACES here instead of tabs
26define Package/$(PKG_NAME)/Default
27  CATEGORY:=Bigfoot
28  SUBMENU:=Utilities
29  TITLE:=Automatic Bandwidth Monitor
30  DEPENDS:=+jansson +curl +libxml2 +app-flow-scripts
31  MAINTAINER:=Cristian Prundeanu <prundeanu@qca.qualcomm.com>
32endef
33
34define Package/$(PKG_NAME)
35$(call Package/$(PKG_NAME)/Default)
36  VARIANT:=full
37  DEPENDS+=@!PACKAGE_bwestd
38endef
39
40# the noauto variant is only able to perform manual measurements
41define Package/$(PKG_NAME)-noauto
42$(call Package/$(PKG_NAME)/Default)
43  VARIANT:=noauto
44  PROVIDES:=$(PKG_NAME)
45endef
46
47define Package/$(PKG_NAME)/description
48Aperture continuously monitors the available upload and download rate and
49adjusts the TBF of the root interfaces accordingly.
50endef
51
52define Package/$(PKG_NAME)-noauto/description
53$(call Package/$(PKG_NAME)/description)
54
55This is the package without auto-start.
56endef
57
58# nothing to configure
59define Build/Configure
60endef
61
62MAKE_FLAGS += LDLIBS+="-largp"
63
64define Package/$(PKG_NAME)-noauto/install
65	$(INSTALL_DIR) $(1)/usr/sbin/
66	$(INSTALL_DIR) $(1)/etc/appflow/streamboost.d/
67	$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin/
68	$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME)-controller.sh $(1)/usr/sbin/
69	$(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/usr/sbin/
70endef
71
72define Package/$(PKG_NAME)/install
73$(call Package/$(PKG_NAME)-noauto/install,$(1))
74	$(INSTALL_BIN) ./files/$(PKG_NAME).init $(1)/etc/appflow/streamboost.d/${PKG_START_ORDER}_$(PKG_NAME)
75endef
76
77$(eval $(call BuildPackage,$(PKG_NAME)))
78$(eval $(call BuildPackage,$(PKG_NAME)-noauto))
79