diff --git a/debian/control b/debian/control index ce2d552..9559441 100644 --- a/debian/control +++ b/debian/control @@ -904,6 +904,22 @@ Description: nymea.io plugin for snapd This package will install the nymea.io plugin for snapd +Package: nymea-plugin-sunposition +Architecture: any +Depends: ${misc:Depends}, + libatlas-base-dev, + python3-pip, + nymea-plugins-translations, +Description: nymea.io plugin for calculating the sun position + The nymea daemon is a plugin based IoT (Internet of Things) server. The + server works like a translator for devices, things and services and + allows them to interact. + With the powerful rule engine you are able to connect any device available + in the system and create individual scenes and behaviors for your environment. + . + This package will install the nymea.io plugin for calculating the sun position + + Package: nymea-plugin-keba Architecture: any Depends: ${shlibs:Depends}, diff --git a/debian/nymea-plugin-sunposition.install.in b/debian/nymea-plugin-sunposition.install.in new file mode 100644 index 0000000..e8aa93f --- /dev/null +++ b/debian/nymea-plugin-sunposition.install.in @@ -0,0 +1,4 @@ +sunposition/integrationpluginsunposition.json usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/sunposition/ +sunposition/integrationpluginsunposition.py usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/sunposition/ +sunposition/sunposition.py usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/sunposition/ +sunposition/requirements.txt usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/sunposition/ diff --git a/debian/rules b/debian/rules index 7a8679f..b0be54f 100755 --- a/debian/rules +++ b/debian/rules @@ -6,6 +6,15 @@ PREPROCESS_FILES := $(wildcard debian/*.in) $(PREPROCESS_FILES:.in=): %: %.in sed 's,/@DEB_HOST_MULTIARCH@,$(DEB_HOST_MULTIARCH:%=/%),g' $< > $@ + chmod --reference=$< $@ + +# Auto-generate install/remove hooks to fetch/cleanup python dependencies from requirements.txt +PYTHON_REQUIREMENTS := $(shell find -name requirements.txt) +$(PYTHON_REQUIREMENTS:.txt=): %: %.txt + $(eval PYTHON_PLUGIN=$(subst /requirements.txt,,$<)) + echo "#DEBHELPER#" | tee debian/nymea-plugin-$(PYTHON_PLUGIN).postinst | tee debian/nymea-plugin-$(PYTHON_PLUGIN).prerm + echo "pip3 install --require-hashes --upgrade -r usr/lib/$(DEB_HOST_MULTIARCH)/nymea/plugins/$(PYTHON_PLUGIN)/requirements.txt -t usr/lib/$(DEB_HOST_MULTIARCH)/nymea/plugins/$(PYTHON_PLUGIN)/modules" >> debian/nymea-plugin-$(PYTHON_PLUGIN).postinst + echo "rm -rf usr/lib/$(DEB_HOST_MULTIARCH)/nymea/plugins/$(PYTHON_PLUGIN)/modules" >> debian/nymea-plugin-$(PYTHON_PLUGIN).prerm %: dh $@ --parallel @@ -14,7 +23,7 @@ override_dh_auto_build: dh_auto_build make lrelease -override_dh_install: $(PREPROCESS_FILES:.in=) +override_dh_install: $(PREPROCESS_FILES:.in=) $(PYTHON_REQUIREMENTS:.txt=) dh_install --fail-missing override_dh_auto_clean: diff --git a/nymea-plugins.pro b/nymea-plugins.pro index 35224cb..c3537ad 100644 --- a/nymea-plugins.pro +++ b/nymea-plugins.pro @@ -50,6 +50,7 @@ PLUGIN_DIRS = \ snapd \ somfytahoma \ sonos \ + sunposition \ tado \ tasmota \ tcpcommander \