Gentoo Archives: gentoo-commits

From: Tony Vroon <chainsaw@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/fhem/, app-misc/fhem/files/
Date: Wed, 11 Jul 2018 08:20:44
Message-Id: 1531297235.2462b28277708b3d611ea89449f15cd410de4fe1.chainsaw@gentoo
1 commit: 2462b28277708b3d611ea89449f15cd410de4fe1
2 Author: Conrad Kostecki <conrad <AT> kostecki <DOT> com>
3 AuthorDate: Sat Jul 7 22:27:18 2018 +0000
4 Commit: Tony Vroon <chainsaw <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 11 08:20:35 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2462b282
7
8 app-misc/fhem: New package
9
10 Closes: https://bugs.gentoo.org/605628
11 Package-Manager: Portage-2.3.41, Repoman-2.3.9
12 Closes: https://github.com/gentoo/gentoo/pull/9110
13
14 app-misc/fhem/Manifest | 1 +
15 app-misc/fhem/fhem-5.8.ebuild | 99 ++++++++++++++++++++++++++++++++++++++++++
16 app-misc/fhem/files/fhem.cfg | 27 ++++++++++++
17 app-misc/fhem/files/fhem.initd | 17 ++++++++
18 app-misc/fhem/metadata.xml | 20 +++++++++
19 5 files changed, 164 insertions(+)
20
21 diff --git a/app-misc/fhem/Manifest b/app-misc/fhem/Manifest
22 new file mode 100644
23 index 00000000000..2e890afbf59
24 --- /dev/null
25 +++ b/app-misc/fhem/Manifest
26 @@ -0,0 +1 @@
27 +DIST fhem-5.8.tar.gz 22139481 BLAKE2B 444b041b591d3c960036a262e6eb3fda026d4b229a21df16d7817c32a1fd57282a7fbe5559164b760bd9cfad314c2977e7d6f611320d35be090cdb9df66fb8fd SHA512 6cfaa14288ce553a2418db4cb47c719f2d5edbccbde9e76f221cd47cf8a175a67125031c4971f9f9972b218fc709a267757c2abefe6a33be47eb4bb45e23be57
28
29 diff --git a/app-misc/fhem/fhem-5.8.ebuild b/app-misc/fhem/fhem-5.8.ebuild
30 new file mode 100644
31 index 00000000000..70fd300295f
32 --- /dev/null
33 +++ b/app-misc/fhem/fhem-5.8.ebuild
34 @@ -0,0 +1,99 @@
35 +# Copyright 1999-2018 Gentoo Foundation
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=6
39 +
40 +inherit user
41 +
42 +DESCRIPTION="A GPL'd perl server for house automation"
43 +HOMEPAGE="https://www.fhem.de/"
44 +SRC_URI="https://www.fhem.de/${P}.tar.gz"
45 +
46 +KEYWORDS="~amd64 ~x86"
47 +LICENSE="GPL-2+"
48 +SLOT="0"
49 +IUSE="doc"
50 +
51 +RDEPEND="dev-perl/Crypt-CBC
52 + dev-perl/Device-SerialPort
53 + dev-perl/Digest-CRC
54 + dev-perl/JSON"
55 +
56 +DEPEND="media-gfx/pngcrush"
57 +
58 +QA_PREBUILT="opt/fhem/contrib/lcd4linux/fritzbox_dpf/lcd4linux
59 + opt/fhem/contrib/lcd4linux/rpi_dpf/lcd4linux"
60 +
61 +pkg_setup() {
62 + enewgroup fhem
63 + enewuser fhem -1 -1 /opt/fhem fhem
64 +}
65 +
66 +src_prepare() {
67 + default
68 +
69 + # Allow install path to be set by DESTDIR in Makefile
70 + sed -i -e 's,^\(BINDIR=\),\1'\$\(DESTDIR\)',' Makefile || die
71 +
72 + # Remove docs in Makefile, as they will be installed manually
73 + sed -i -e 's/docs//g' Makefile || die
74 + sed -i -e '/README_DEMO.txt/d' Makefile || die
75 +
76 + # Remove manpage in Makefile, as it will be installed manually
77 + sed -i -e '/fhem.pl.1/d' Makefile || die
78 +
79 + # Remove log dir, as it will be replaced with a symlink
80 + rm -r log || die
81 +
82 + # Fix fhemicon_darksmall.png, as it reports "broken IDAT window length"
83 + # Reported to Upstream: https://forum.fhem.de/index.php/topic,86238.0.html
84 + pngcrush -fix -force -ow www/images/default/fhemicon_darksmall.png || die
85 +
86 + cp "${FILESDIR}"/fhem.cfg fhem.cfg || die
87 +}
88 +
89 +src_compile() {
90 + :
91 +}
92 +
93 +src_install() {
94 + local DOCS=(
95 + "CHANGED"
96 + "HISTORY"
97 + "README.SVN"
98 + "README_DEMO.txt"
99 + "docs"/*.txt
100 + "docs"/*.patch
101 + "docs"/*.pdf
102 + "docs/changelog"
103 + "docs/copyright"
104 + "docs/dotconfig"
105 + "docs/fhem.odg.readme"
106 + "docs/LIESMICH.update-thirdparty"
107 + "docs"/README*
108 + "docs/X10"
109 + )
110 +
111 + if use doc; then
112 + local DOCS+=( "docs/X10" )
113 + local HTML_DOCS=( "docs/"*.eps "docs/"*.html "docs"/*.jpg "docs"/*.js "docs"/*.odg "docs/"*.png "docs/km271" )
114 + fi
115 +
116 + diropts -o fhem -g fhem
117 + keepdir "/var/lib/fhem"
118 + keepdir "/var/log/fhem"
119 +
120 + dosym ../../var/lib/fhem /opt/fhem/data
121 + dosym ../../var/log/fhem /opt/fhem/log
122 +
123 + default
124 +
125 + newinitd "${FILESDIR}"/fhem.initd fhem
126 +
127 + newman docs/fhem.man fhem.pl.1
128 +
129 + echo 'CONFIG_PROTECT="/opt/fhem /var/lib/fhem"' > "${T}"/99fhem || die
130 + doenvd "${T}"/99fhem
131 +
132 + fowners fhem:fhem /opt/fhem/fhem.cfg
133 +}
134
135 diff --git a/app-misc/fhem/files/fhem.cfg b/app-misc/fhem/files/fhem.cfg
136 new file mode 100644
137 index 00000000000..04f7ae9a468
138 --- /dev/null
139 +++ b/app-misc/fhem/files/fhem.cfg
140 @@ -0,0 +1,27 @@
141 +attr global logfile ./log/fhem-%Y-%m.log
142 +attr global pidfilename /run/fhem/fhem.pid
143 +attr global modpath .
144 +attr global statefile ./data/fhem.save
145 +attr global verbose 3
146 +attr global updateInBackground
147 +
148 +define telnetPort telnet 7072 global
149 +
150 +define WEB FHEMWEB 8083 global
151 +
152 +define WEBphone FHEMWEB 8084 global
153 +attr WEBphone stylesheetPrefix smallscreen
154 +
155 +define WEBtablet FHEMWEB 8085 global
156 +attr WEBtablet stylesheetPrefix touchpad
157 +
158 +# Fake FileLog entry, to access the fhem log from FHEMWEB
159 +define Logfile FileLog ./log/fhem-%Y-%m.log fakelog
160 +
161 +define autocreate autocreate
162 +attr autocreate filelog ./data/%NAME-%Y.log
163 +
164 +define eventTypes eventTypes ./data/eventTypes.txt
165 +
166 +# Disable this to avoid looking for new USB devices on startup
167 +define initialUsbCheck notify global:INITIALIZED usb create
168
169 diff --git a/app-misc/fhem/files/fhem.initd b/app-misc/fhem/files/fhem.initd
170 new file mode 100644
171 index 00000000000..42494871901
172 --- /dev/null
173 +++ b/app-misc/fhem/files/fhem.initd
174 @@ -0,0 +1,17 @@
175 +#!/sbin/openrc-run
176 +# Copyright 1999-2018 Gentoo Foundation
177 +# Distributed under the terms of the GNU General Public License v2
178 +
179 +home="/opt/fhem"
180 +command="${home}/fhem.pl"
181 +command_args="${home}/fhem.cfg"
182 +command_group="fhem"
183 +command_user="fhem"
184 +name="FHEM"
185 +pidfile_path="/run/fhem"
186 +pidfile="${pidfile_path}/fhem.pid"
187 +start_stop_daemon_args="--chdir ${home}"
188 +
189 +start_pre() {
190 + checkpath -d -o "${command_user}:${command_group}" -q "${pidfile_path}"
191 +}
192
193 diff --git a/app-misc/fhem/metadata.xml b/app-misc/fhem/metadata.xml
194 new file mode 100644
195 index 00000000000..92b43298084
196 --- /dev/null
197 +++ b/app-misc/fhem/metadata.xml
198 @@ -0,0 +1,20 @@
199 +<?xml version="1.0" encoding="UTF-8"?>
200 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
201 +<pkgmetadata>
202 + <maintainer type="person">
203 + <email>ck+gentoo@××××××××.de</email>
204 + <name>Conrad Kostecki</name>
205 + </maintainer>
206 + <maintainer type="project">
207 + <email>proxy-maint@g.o</email>
208 + <name>Proxy Maintainers</name>
209 + </maintainer>
210 + <longdescription>
211 + FHEM is a GPL'd perl server for house automation.
212 + It is used to automate some common tasks in the household like
213 + switching lamps, shutters, heating and to log events like
214 + temperature, humidity, power consumption.
215 + In order to use FHEM you'll need some attached hardware
216 + like the CUL-, EnOcean- or Z-Wave-USB-Stick to access the actors and sensors.
217 + </longdescription>
218 +</pkgmetadata>