Skip to content

Instantly share code, notes, and snippets.

@eh8
Created January 17, 2022 06:24
Show Gist options
  • Save eh8/2a29b6d423438bfb522a8c39eca36800 to your computer and use it in GitHub Desktop.
Save eh8/2a29b6d423438bfb522a8c39eca36800 to your computer and use it in GitHub Desktop.
Stopgap update for home-assistant [community]
[Unit]
Description=Home assistant
After=network.target
[Service]
Restart=on-failure
User=hass
Group=hass
DynamicUser=true
LogsDirectory=hass
StateDirectory=hass
WorkingDirectory=/var/lib/hass
Environment=HOME=/var/lib/hass
ExecStart=/usr/bin/hass \
--config /var/lib/hass/ \
--log-file /var/log/hass/home-assistant.log \
--log-rotate-days 1 \
--runner
RestartForceExitStatus=100
AmbientCapabilities=
CapabilityBoundingSet=
LockPersonality=true
ProtectControlGroups=true
ProtectKernelModules=true
ProtectKernelTunables=true
[Install]
WantedBy=multi-user.target
# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Ethan Skinner <aur@etskinner.com>
# Contributor: Grégoire Seux <grego_aur@familleseux.net>
# Contributor: Dean Galvin <deangalvin3@gmail.com>
# Contributor: NicoHood <archlinux@nicohood.de>
pkgname=home-assistant
pkgdesc='Open source home automation that puts local control and privacy first'
pkgver=2021.12.9
pkgrel=1
arch=(any)
url=https://home-assistant.io/
license=(APACHE)
depends=(
gcc
python-aiohttp
python-aiohttp-cors
python-astral
python-async-timeout
python-atomicwrites
python-attrs
python-awesomeversion
python-bcrypt
python-certifi
python-ciso8601
python-cryptography
python-defusedxml
python-httpx
python-jinja
python-mutagen
python-pillow
python-pip
python-pyjwt
python-pytz
python-requests
python-ruamel-yaml
python-slugify
python-sqlalchemy
python-voluptuous
python-voluptuous-serialize
python-yaml
python-yarl
python-zeroconf
)
makedepends=(
git
python-setuptools
)
optdepends=(
'net-tools: Nmap host discovery'
'openzwave: Z-Wave integration'
'python-dtlssocket: Ikea Tradfri integration'
'python-lxml: Meteo France integration'
)
_tag=b6f432645d7bc6b4947a20afa28647eb1515e4f8
source=(
git+https://github.com/home-assistant/home-assistant.git#tag=${_tag}
home-assistant.service
)
b2sums=('SKIP'
'e4104493cb70ef0e07cb046c61188d126d47dacdfb55d989321510a326a1477124b109eefa465bd60190196cb08f8aa6b61fde6dd7b608117d0a9bf6b46db525')
pkgver() {
cd home-assistant
git describe --tags
}
prepare() {
cd home-assistant
# lift hard dep constraints, we'll deal with breaking changes ourselves
sed 's/==/>=/g' -i requirements.txt setup.py homeassistant/package_constraints.txt
# allow pip >= 20.3 to be used
sed 's/,<20.3//g' -i requirements.txt setup.py homeassistant/package_constraints.txt
# remove python-yaml restriction
sed 's/pyyaml>=6.0//g' -i requirements.txt setup.py homeassistant/package_constraints.txt
}
build() {
cd home-assistant
python setup.py build
}
package() {
cd home-assistant
python setup.py install --root="${pkgdir}" --prefix=/usr --optimize=1 --skip-build
install -Dm 644 ../home-assistant.service -t "${pkgdir}"/usr/lib/systemd/system/
}
# vim: ts=2 sw=2 et:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment