diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2016-11-25 20:39:40 +0100 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2016-11-25 20:39:46 +0100 |
commit | 381e9469b4315fc3a810adc771f9bacc4246d9b7 (patch) | |
tree | adaeb966c40e22d19f3157e8e6d865be40e9a535 | |
parent | 0d052d0578de9e3674bd66da6686dcd7f56b2cea (diff) | |
download | aports-381e9469b4315fc3a810adc771f9bacc4246d9b7.tar.bz2 aports-381e9469b4315fc3a810adc771f9bacc4246d9b7.tar.xz |
testing/home-assistant: new aport
-rw-r--r-- | testing/home-assistant/APKBUILD | 71 | ||||
-rw-r--r-- | testing/home-assistant/home-assistant.confd | 5 | ||||
-rwxr-xr-x | testing/home-assistant/home-assistant.initd | 18 | ||||
-rw-r--r-- | testing/home-assistant/home-assistant.pre-install | 6 | ||||
-rw-r--r-- | testing/home-assistant/update-deps.patch | 17 |
5 files changed, 117 insertions, 0 deletions
diff --git a/testing/home-assistant/APKBUILD b/testing/home-assistant/APKBUILD new file mode 100644 index 0000000000..c7979ad500 --- /dev/null +++ b/testing/home-assistant/APKBUILD @@ -0,0 +1,71 @@ +# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch> +pkgname=home-assistant +_pkgname=homeassistant +pkgver=0.33.3 +pkgrel=0 +pkgdesc="A Home automation platform" +url="https://home-assistant.io" +arch="all" +license="MIT" +depends="py3-requests py3-yaml py3-tz py3-jinja2 py3-voluptuous + py3-async-timeout" +makedepends="python3-dev" +subpackages="$pkgname-aiohttp" +pkgusers="hass" +pkggroups="hass" +install="$pkgname.pre-install" +source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz + update-deps.patch + $pkgname.initd + $pkgname.confd" +builddir="$srcdir"/$_pkgname-$pkgver + +# NOTE: https://github.com/home-assistant/home-assistant/issues/4288 +# hass needs aiohttp at older version then available in aports +# this should be fixed upstream after which this can be moved to community +_ver_aiohttp=1.0.5 +_builddir_aiohttp="$srcdir/aiohttp-$_ver_aiohttp" +depends="$depends $pkgname-aiohttp" +source="$source https://files.pythonhosted.org/packages/source/a/aiohttp/aiohttp-$_ver_aiohttp.tar.gz" + +build() { + cd "$builddir" + python3 setup.py build || return 1 + cd "$_builddir_aiohttp" + python3 setup.py build || return 1 +} + +package() { + cd "$builddir" + python3 setup.py install \ + --root="$pkgdir" --prefix=/usr --optimize=1 || return 1 + install -Dm 755 "$srcdir/$pkgname".initd \ + "$pkgdir"/etc/init.d/hass || return 1 + install -Dm 644 "$srcdir/$pkgname".confd \ + "$pkgdir"/etc/conf.d/hass || return 1 +} + +aiohttp() { + pkgdesc="$pkgdesc (aiohttp dependency)" + depends="python3 py3-async-timeout py3-chardet py3-multidict py3-yarl + !py3-aiohttp" + cd "$_builddir_aiohttp" + python3 setup.py install \ + --root="$subpkgdir" --prefix=/usr --optimize=1 || return 1 +} + +md5sums="967d4c16becbdd99ef0fb34d718b7efc homeassistant-0.33.3.tar.gz +14cd39ae5fc2e0ecd744022963554a0c update-deps.patch +f98b4840a76b5cee70b2f825cfb26103 home-assistant.initd +c0e33f27528af255c50c3bdfdf22098f home-assistant.confd +488026a1c1e716741842403b7b9f030a aiohttp-1.0.5.tar.gz" +sha256sums="87e09608a98eebc532d079c9894fd6a123070b53b6f608542abab4e201486e86 homeassistant-0.33.3.tar.gz +dc19ea6037f6a738d3614a122e55fe0b6c2a55686855372e659de9bb25e7d97e update-deps.patch +3518ebc275eee3041ff2821a83b7bb6151990b37c4512b0497874a9eb6b28cc8 home-assistant.initd +bff3fc8c883662661646e17d3c46e5a01bded42b67cf6ef60242a1c7dca8de96 home-assistant.confd +c3e1897726f97d40e067e8b658b2dbdfe216f32b801c5c589212e1b1f9aa8388 aiohttp-1.0.5.tar.gz" +sha512sums="8191d38653897ef978f7bb262b555a468e51fd924781bd223420ea47eb7d3d21014f84f00d2ae9d071eead6bb0b1bf65433ae5e12b58af4241b5991e063b29bd homeassistant-0.33.3.tar.gz +0c3287e9861e67ff97a9ccea60d57c6a772707a43cfa016f056832688bf776cc3df92c34e2f0dfb017a0566792331c1e6f4318db4845e283435f7422b4df6cdc update-deps.patch +34b8387836490228d94f6836bd0222812285d0a1161225b47b03c1398526f235c2ef2180ebaf0a81fe59165230467b5ad75eb06b3349175ef655da9bd00acd8e home-assistant.initd +3cba0923944c01557d99baee2bdd906d198c831ab34c77242574ed6bcc4545326a42133983ec6bd18b7ae15e4329355cc604fdf016a9324d85d6e8e527691f41 home-assistant.confd +db5661b77b90eaecf04d80cebc1023ec7930bd639aed075d24291f897784d040ccc3fc5f9db310a3886f1661a0d163aaf42a8c5549b566027e890df42bb1bc0d aiohttp-1.0.5.tar.gz" diff --git a/testing/home-assistant/home-assistant.confd b/testing/home-assistant/home-assistant.confd new file mode 100644 index 0000000000..59c2134581 --- /dev/null +++ b/testing/home-assistant/home-assistant.confd @@ -0,0 +1,5 @@ +# hass settings +HASS_CONF="/var/lib/hass" +HASS_PID="/run/hass/hass.pid" +HASS_USER="clandmeter" +HASS_GROUP="clandmeter" diff --git a/testing/home-assistant/home-assistant.initd b/testing/home-assistant/home-assistant.initd new file mode 100755 index 0000000000..b5dc6b0748 --- /dev/null +++ b/testing/home-assistant/home-assistant.initd @@ -0,0 +1,18 @@ +#!/sbin/openrc-run + +name="Home Assistant" +command="/usr/bin/hass" +command_args="--config $HASS_CONF --pid-file $HASS_PID --daemon" +start_stop_daemon_args="--user $HASS_USER --group $HASS_GROUP" +pidfile="$HASS_PID" +retry="TERM/30/KILL/5" + +depend() { + need net localmount + after firewall +} + +start_pre() { + checkpath --directory --owner $HASS_USER:$HASS_GROUP --mode 0775 \ + /run/hass +} diff --git a/testing/home-assistant/home-assistant.pre-install b/testing/home-assistant/home-assistant.pre-install new file mode 100644 index 0000000000..b94ac9b418 --- /dev/null +++ b/testing/home-assistant/home-assistant.pre-install @@ -0,0 +1,6 @@ +#!/bin/sh + +addgroup -S hass 2>/dev/null +adduser -S -D -h /var/lib/hass -s /sbin/nologin -G hass -g "Home Assistent" hass 2>/dev/null + +exit 0 diff --git a/testing/home-assistant/update-deps.patch b/testing/home-assistant/update-deps.patch new file mode 100644 index 0000000000..1c6f6fcd45 --- /dev/null +++ b/testing/home-assistant/update-deps.patch @@ -0,0 +1,17 @@ +--- ./setup.py.orig ++++ ./setup.py +@@ -17,12 +17,10 @@ + 'requests>=2,<3', + 'pyyaml>=3.11,<4', + 'pytz>=2016.7', +- 'pip>=7.0.0', + 'jinja2>=2.8', +- 'voluptuous==0.9.2', +- 'typing>=3,<4', ++ 'voluptuous>=0.9.2', + 'aiohttp==1.0.5', +- 'async_timeout==1.0.0', ++ 'async_timeout>=1.0.0', + ] + + setup( |