# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="6" inherit user DESCRIPTION="FHEM is a GPL'd perl server for house automation" HOMEPAGE="http://www.fhem.de/" SRC_URI="http://www.fhem.de/${P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="-* ~amd64 ~x86" IUSE="doc" DEPEND="dev-perl/Device-SerialPort" RDEPEND="${DEPEND}" QA_PREBUILT="opt/fhem/contrib/lcd4linux/fritzbox_dpf/lcd4linux opt/fhem/contrib/lcd4linux/rpi_dpf/lcd4linux" pkg_setup() { enewgroup ${PN} enewuser ${PN} -1 -1 /opt/${PN} ${PN} } src_prepare() { sed -i 's,^\(BINDIR=\).*,\1'${D}/opt/${PN}',' ${S}/Makefile cp ${FILESDIR}/${PN}.cfg "${S}"/${PN}.cfg eapply_user } src_compile() { return } src_install() { emake install dodoc ${D}/opt/${PN}/README_DEMO.txt rm ${D}/opt/${PN}/README_DEMO.txt if ! use doc; then rm -r ${D}/opt/${PN}/docs fi rm -r ${D}/opt/${PN}/log dodir /var/log/${PN} dosym /var/log/${PN} /opt/${PN}/log fowners -R ${PN}:${PN} /var/log/${PN} dodir /var/lib/${PN} dosym /var/lib/${PN} /opt/${PN}/data fowners -R ${PN}:${PN} /var/lib/${PN} fowners -R ${PN}:${PN} /opt/${PN} fperms 755 /opt/${PN}/${PN}.pl echo 'CONFIG_PROTECT="/var/lib/fhem"' > 99${PN} doenvd 99${PN} newinitd ${FILESDIR}/${PN}.initd ${PN} newconfd ${FILESDIR}/${PN}.confd ${PN} }