Skip to content

Instantly share code, notes, and snippets.

@RubenKelevra
Created July 25, 2016 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RubenKelevra/8e33266e2f5c2efebae895d16d0806e1 to your computer and use it in GitHub Desktop.
Save RubenKelevra/8e33266e2f5c2efebae895d16d0806e1 to your computer and use it in GitHub Desktop.
# Maintainer: Grégoire Seux <grego_aur@familleseux.net>
# Contributor: Dean Galvin <deangalvin3@gmail.com>
_pkgname="home-assistant"
pkgname="python-home-assistant"
pkgdesc='Home Assistant is an open-source home automation platform running on Python 3'
pkgver=0.24.1
pkgrel=1
url="https://home-assistant.io/"
license=('MIT')
arch=('any')
makedepends=('python-setuptools')
# NB: this package will install additional python packages in /var/lib/hass/lib depending on components present in the configuration files.
depends=('python>=3.4' 'python-pip' 'python-requests' 'python-yaml' 'python-pytz' 'python-vincenty' 'python-jinja>=2' 'python-voluptuous>=0.8.9' 'python-netifaces' 'python-webcolors' 'python-eventlet>=0.19.0' 'python-sqlalchemy')
optdepends=('git: install component requirements from github'
'net-tools: necessary for nmap discovery')
conflicts=('python-home-assistant' 'python-home-assistant-git')
source=("https://github.com/${_pkgname}/${_pkgname}/archive/${pkgver}.tar.gz"
"home-assistant.service"
"https://github.com/home-assistant/home-assistant/commit/6199470979608f36e713a2153d97d1ea5fd4559d.patch"
"https://github.com/home-assistant/home-assistant/commit/ca4b06a5db36c894a64505a55a890de9955af905.patch"
"https://github.com/home-assistant/home-assistant/commit/e98fa74bf0217d1583274814b6445cf0b7628775.patch")
sha256sums=('fa69c9761077b1157812750541b68ec1b78e42e749726bc01404ce5f749200a3'
'SKIP'
'SKIP'
'SKIP'
'SKIP')
backup=('var/lib/hass/configuration.yaml')
install='hass.install'
prepare() {
cd ${srcdir}/${_pkgname}-${pkgver}
# package for voluptuous is more recent on AUR
sed -i 's/voluptuous==0.8.9/voluptuous>=0.8.9,<1/' setup.py
# package for sqlalchemy is less recent
sed -i 's/sqlalchemy==1.0.14/sqlalchemy>=1.0.13/' setup.py
for s in "${source[@]}"
do
s="$(echo $s | cut -d '/' -f 7)"
case "$s" in
(*.patch)
patch -p1 < "${srcdir}/${s}"
esac
done
}
package() {
mkdir -p "${pkgdir}/usr/lib/systemd/system/"
cp home-assistant.service "${pkgdir}/usr/lib/systemd/system/"
cd ${srcdir}/${_pkgname}-${pkgver}
python3 setup.py install --root="$pkgdir" --prefix=/usr --optimize=1
install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment