aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-misc/homeassistant-bin/Manifest1
-rw-r--r--app-misc/homeassistant-bin/homeassistant-bin-0.83.3-r1.ebuild130
2 files changed, 131 insertions, 0 deletions
diff --git a/app-misc/homeassistant-bin/Manifest b/app-misc/homeassistant-bin/Manifest
index 04591f0..b5be353 100644
--- a/app-misc/homeassistant-bin/Manifest
+++ b/app-misc/homeassistant-bin/Manifest
@@ -6,5 +6,6 @@ AUX recorder.yaml 114 BLAKE2B af04840805aa13124208584e7f1d40335905a083ee7deead5c
AUX update-homeassistant 1456 BLAKE2B 202466661d959fcae9b425c37b8f18ed5653f6c53331508e7d39abc9605aaee220137771fc816d0ead145eac2ac0ffcd22d24991d2531c5792a720ab73ed40f8 SHA512 b50a685e0f4ef75dbba87cbabd5bd6ae6ed9732068e9ad870210d21d0896e0ffef3c59de862571f03c1162b240732385fef99d15a6a0d9a517a70efd98c337ad
EBUILD homeassistant-bin-0.83.0.ebuild 2873 BLAKE2B 8bcbcfff6b2613a00714c06588b4292268d84feca3f34a665243dc541e57322a5754b1fb71a3841e7d35aafb6b3acdf3d3dfd3b468caec159408016b4a2dd22a SHA512 452fce27032fb1e60309663b85285ee8baaad1b0665c9121a149fda8a9ac72e9fa7d2ee4d477b4346debd3feb961824e7bb4d90a58f4c504eb89b8b5f8fa6643
EBUILD homeassistant-bin-0.83.2.ebuild 2873 BLAKE2B 8bcbcfff6b2613a00714c06588b4292268d84feca3f34a665243dc541e57322a5754b1fb71a3841e7d35aafb6b3acdf3d3dfd3b468caec159408016b4a2dd22a SHA512 452fce27032fb1e60309663b85285ee8baaad1b0665c9121a149fda8a9ac72e9fa7d2ee4d477b4346debd3feb961824e7bb4d90a58f4c504eb89b8b5f8fa6643
+EBUILD homeassistant-bin-0.83.3-r1.ebuild 3477 BLAKE2B c780ede22c4d6ce92459b8497c15835ff6a8acb64f8aaa7a9872b21f3cea25c8e5e32eb5dc62885d6f2ea5a9588dd3c693aa4cbadd894f7ad4bec1016b3f88cc SHA512 5d69731698224c59d57f16f468e6fcb1d907199ecc3bcc0b5b68bb3ce1902e1b976407c2fb21ca0ac1423d3744971828b61cb6c3813de30561e624ddb08df143
EBUILD homeassistant-bin-0.83.3.ebuild 3291 BLAKE2B 9d6eb5c7647817b071d0133723707c9ce34fe13bdf9abdb714f8462a3b901b7181c8f769affc0155675eef352b2b42aace18b21ae20df39ccc0790f0b89657a4 SHA512 a32b962ffcb13d351216675ed50d667c500e6b0496668fdbde20453f1c5ceeb22a66b8db49c36375ab6419390c1325dbdfc31c3869f868685df55f1163e5e60d
EBUILD homeassistant-bin-9999.ebuild 2566 BLAKE2B 8bc81f53fb3cb8744ac59aa48c14e01d442a48fde8ed408b72922f6c921f81b6cacf4ce759a256f720c14416eaf3a62d92bf1f26c1f28919b90743d088908df2 SHA512 cd28376bdc8f7cc988a1ed01e84a03ac4de8bf843a1169ca87ab4e1d9c116a30abec36dc049e34058455e27c7ae96ae6587ac4b13a122565bae7cc718ed990c4
diff --git a/app-misc/homeassistant-bin/homeassistant-bin-0.83.3-r1.ebuild b/app-misc/homeassistant-bin/homeassistant-bin-0.83.3-r1.ebuild
new file mode 100644
index 0000000..190a316
--- /dev/null
+++ b/app-misc/homeassistant-bin/homeassistant-bin-0.83.3-r1.ebuild
@@ -0,0 +1,130 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+PYTHON_COMPAT=( python3_6 )
+
+inherit user readme.gentoo-r1 eutils distutils-r1 systemd
+
+MY_PN="${PN/-bin/}"
+
+DESCRIPTION="Home automation platform (Python 3 required)"
+HOMEPAGE="https://home-assistant.io"
+SRC_URI="" # pip installs HA version $PV from PyPI
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="maint mysql"
+
+PY_HA="3.6"
+
+DEPEND="
+ ${PYTHON_DEPS}
+ !app-misc/homeassistant
+ dev-lang/python:${PY_HA}
+ dev-python/pip[${PYTHON_USEDEP}]
+ dev-python/virtualenv[${PYTHON_USEDEP}]
+ mysql? ( dev-python/mysqlclient )
+"
+RDEPEND="
+ ${DEPEND}
+ app-admin/logrotate
+ maint? (
+ app-crypt/certbot
+ app-crypt/ssl-cert-check
+ net-misc/dropbox-uploader
+ virtual/logger
+ )
+"
+
+INSTALL_DIR="/opt/${MY_PN}"
+
+DISABLE_AUTOFORMATTING=1
+DOC_CONTENTS="
+ The HA interface listens on port 8123 - this _will_ take a minute or two to appear
+
+ hass configuration is in: /etc/${MY_PN}
+ For openrc daemon command line arguments are configured in: /etc/conf.d/${MY_PN}
+
+ logging is to: /var/log/${MY_PN}/{server,errors,stdout}.log
+
+ The sqlite db is by default in: /etc/${MY_PN}
+ To move it after ${MY_PN} has run once and while ${MY_PN} is stopped:
+ - add /etc/${MY_PN}/recorder.yaml to /etc/${MY_PN}/configuration.yaml
+ - mv /etc/${MY_PN}/home-assistant_v2.db /var/db/${MY_PN}
+
+ support thread at:
+ https://community.home-assistant.io/t/gentoo-homeassistant-0-59-2-ebuild/35577
+
+ The script /usr/bin/update-homeassistant can be used to update homeassistant-bin (it keeps
+ a backup of the previous virtualenv under /opt). The script is for openrc only at the moment.
+"
+
+S="${WORKDIR}"
+
+pkg_setup() {
+ enewgroup "${MY_PN}"
+ enewuser "${MY_PN}" -1 -1 "$INSTALL_DIR" "${MY_PN}"
+}
+
+src_compile() {
+ true
+}
+
+src_install() {
+ dobin "${FILESDIR}/update-homeassistant"
+
+ keepdir "$INSTALL_DIR"
+
+ keepdir "/etc/${MY_PN}"
+ insinto "/etc/${MY_PN}"
+ doins "${FILESDIR}/recorder.yaml"
+ fowners -R "${MY_PN}:${MY_PN}" "/etc/${MY_PN}"
+
+ "python${PY_HA}" -m venv "${D}/$INSTALL_DIR"
+ # for no output from pip add: --quiet
+ # note the venv has a python3, but no python3.x
+ VIRTUAL_ENV="$INSTALL_DIR" "${D}/$INSTALL_DIR/bin/python3" -m pip --no-cache-dir install "${MY_PN}==${PV}" || die
+ sed -i "1c#!$INSTALL_DIR/bin/python3" "${D}/$INSTALL_DIR/bin/hass"
+ fowners -R "${MY_PN}:${MY_PN}" "$INSTALL_DIR"
+
+ if use mysql ; then
+ VIRTUAL_ENV="$INSTALL_DIR" "${D}/$INSTALL_DIR/bin/python3" -m pip --no-cache-dir install "mysqlclient" || die
+ fi
+
+ newconfd "${FILESDIR}/${MY_PN}.conf.d" "${MY_PN}"
+ newinitd "${FILESDIR}/${MY_PN}.init.d" "${MY_PN}"
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/${MY_PN}.logrotate" "${MY_PN}"
+
+ keepdir "/var/log/${MY_PN}/old"
+ fowners -R "${MY_PN}:${MY_PN}" "/var/log/${MY_PN}"
+
+ keepdir "/var/db/${MY_PN}"
+ fowners -R "${MY_PN}:${MY_PN}" "/var/db/${MY_PN}"
+
+ systemd_dounit "${FILESDIR}"/${MY_PN}.service
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ elog "homeassistant requires python 3.5 (or later)"
+ elog ""
+ elog "This ebuild installs homeassistant into a virtualenv built for:"
+ elog ""
+ elog " python ${PY_HA} (the current python 3.x in gentoo PYTHON_TARGETS)"
+ elog ""
+ elog "If you have previously run homeassistant with an older version of "
+ elog "python, then it is recommended that you do a clean install on moving to"
+ elog "python ${PY_HA}."
+
+ readme.gentoo_print_elog
+}
+
+pkg_config() {
+ "${INSTALL_DIR}/bin/hass" --script ensure_config
+}