summaryrefslogtreecommitdiff
path: root/bigclown-mqtt2influxdb/Makefile
blob: fd606f01a819d95574294ba5ede5d77c0666a07c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
include $(TOPDIR)/rules.mk

PKG_NAME:=bigclown-mqtt2influxdb
PKG_RELEASE:=2
PKG_SOURCE_URL:=https://github.com/bigclownlabs/bch-mqtt2influxdb.git
PKG_MAINTAINER:=Karel Kočí <cynerd@email.cz>

include $(TOPDIR)/package/autopkg-tag.mk
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python3-package.mk)

define Package/$(PKG_NAME)
	TITLE:=BigCLown MQTT to Influxdb bridge
	DEPENDS:=+python3 +python3-paho-mqtt +python3-pyyaml +python3-influxdb +python3-jsonpath-ng +python3-schema
endef

define Py3Package/$(PKG_NAME)/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) ./files/mqtt2influxdb $(1)/usr/bin/mqtt2influxdb
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) ./files/init $(1)/etc/init.d/bc-mqtt2influxdb
	$(INSTALL_DATA) ./files/config.yml $(1)/etc/bc-mqtt2influxdb.yml
endef

define Package/$(PKG_NAME)/conffiles
/etc/bc-mqtt2influxdb.yml
endef

define Build/Compile
	sed -i 's/@@VERSION@@/$(PKG_VERSION)/' "$(PKG_BUILD_DIR)/setup.py"
	$(call Build/Compile/Py3Mod,,install --prefix="/usr" --root=$(PKG_INSTALL_DIR))
endef

$(eval $(call Py3Package,$(PKG_NAME)))
$(eval $(call BuildPackage,$(PKG_NAME)))