Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/fhem/, app-misc/fhem/files/
Date: Fri, 25 Jun 2021 23:38:51
Message-Id: 1624664311.0cb1146fd6908f526abca2d3e3211fd116175a8e.conikost@gentoo
1 commit: 0cb1146fd6908f526abca2d3e3211fd116175a8e
2 Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jun 25 23:35:57 2021 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 25 23:38:31 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0cb1146f
7
8 app-misc/fhem: update systemd init script
9
10 Type must be forking.
11
12 Closes: https://bugs.gentoo.org/798318
13 Package-Manager: Portage-3.0.20, Repoman-3.0.3
14 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
15
16 app-misc/fhem/fhem-6.0-r1.ebuild | 103 ++++++++++++++++++++++++++++++++++++
17 app-misc/fhem/files/fhem.service-r1 | 14 +++++
18 2 files changed, 117 insertions(+)
19
20 diff --git a/app-misc/fhem/fhem-6.0-r1.ebuild b/app-misc/fhem/fhem-6.0-r1.ebuild
21 new file mode 100644
22 index 00000000000..9ad9768d833
23 --- /dev/null
24 +++ b/app-misc/fhem/fhem-6.0-r1.ebuild
25 @@ -0,0 +1,103 @@
26 +# Copyright 1999-2021 Gentoo Authors
27 +# Distributed under the terms of the GNU General Public License v2
28 +
29 +EAPI=7
30 +
31 +inherit systemd tmpfiles
32 +
33 +DESCRIPTION="A GPL'd perl server for house automation"
34 +HOMEPAGE="https://www.fhem.de/"
35 +SRC_URI="https://www.fhem.de/${P}.tar.gz"
36 +
37 +LICENSE="GPL-2+"
38 +SLOT="0"
39 +KEYWORDS="amd64 x86"
40 +IUSE="doc"
41 +
42 +RDEPEND="
43 + acct-group/fhem
44 + acct-user/fhem
45 + dev-perl/Crypt-CBC
46 + dev-perl/Device-SerialPort
47 + dev-perl/Digest-CRC
48 + dev-perl/JSON
49 +"
50 +
51 +DEPEND="media-gfx/pngcrush"
52 +
53 +src_prepare() {
54 + default
55 +
56 + # Allow install path to be set by DESTDIR in Makefile
57 + sed -i -e 's,^\(BINDIR=\),\1'\$\(DESTDIR\)',' Makefile || die
58 +
59 + # Remove docs in Makefile, as they will be installed manually
60 + sed -i -e 's/docs//g' Makefile || die
61 + sed -i -e '/README_DEMO.txt/d' Makefile || die
62 +
63 + # Remove manpage in Makefile, as it will be installed manually
64 + sed -i -e '/fhem.pl.1/d' Makefile || die
65 +
66 + # Remove lcd4linux binaries, as they are provied by app-misc/lcd4linux
67 + rm -r contrib/lcd4linux || die
68 +
69 + # Remove log dir, as it will be replaced with a symlink
70 + rm -r log || die
71 +
72 + # Fix fhemicon_darksmall.png, as it reports "broken IDAT window length"
73 + # Reported to Upstream: https://forum.fhem.de/index.php/topic,86238.0.html
74 + pngcrush -fix -force -ow www/images/default/fhemicon_darksmall.png || die
75 +
76 + cp "${FILESDIR}"/fhem.cfg fhem.cfg || die
77 +}
78 +
79 +src_compile() {
80 + :
81 +}
82 +
83 +src_install() {
84 + local DOCS=(
85 + "CHANGED"
86 + "HISTORY"
87 + "MAINTAINER.txt"
88 + "README.SVN"
89 + "README_DEMO.txt"
90 + "docs"/*.txt
91 + "docs"/*.patch
92 + "docs"/*.pdf
93 + "docs/changelog"
94 + "docs/copyright"
95 + "docs/dotconfig"
96 + "docs/fhem.odg.readme"
97 + "docs/LIESMICH.update-thirdparty"
98 + "docs"/README*
99 + "docs/X10"
100 + )
101 +
102 + if use doc; then
103 + local DOCS+=( "docs/X10" )
104 + local HTML_DOCS=( "docs/"*.eps "docs/"*.html "docs"/*.jpg "docs"/*.js "docs"/*.odg "docs/"*.png "docs/km271" )
105 + fi
106 +
107 + diropts -o fhem -g fhem
108 + keepdir "/var/lib/fhem"
109 + keepdir "/var/log/fhem"
110 + diropts
111 +
112 + dosym ../../var/lib/fhem /opt/fhem/data
113 + dosym ../../var/log/fhem /opt/fhem/log
114 +
115 + default
116 +
117 + newinitd "${FILESDIR}"/fhem.initd fhem
118 +
119 + systemd_newunit "${FILESDIR}"/fhem.service-r1 fhem.service
120 + newtmpfiles "${FILESDIR}"/fhem.tmpfiles fhem.conf
121 +
122 + newman docs/fhem.man fhem.pl.1
123 +
124 + echo 'CONFIG_PROTECT="/opt/fhem /var/lib/fhem"' > "${T}"/99fhem || die
125 + doenvd "${T}"/99fhem
126 +
127 + fowners fhem:fhem /opt/fhem/fhem.cfg
128 +}
129
130 diff --git a/app-misc/fhem/files/fhem.service-r1 b/app-misc/fhem/files/fhem.service-r1
131 new file mode 100644
132 index 00000000000..aaf48fc88c4
133 --- /dev/null
134 +++ b/app-misc/fhem/files/fhem.service-r1
135 @@ -0,0 +1,14 @@
136 +[Unit]
137 +Description=FHEM Home Automation
138 +After=network-online.target
139 +
140 +[Service]
141 +Type=forking
142 +User=fhem
143 +Group=fhem
144 +WorkingDirectory=/opt/fhem
145 +ExecStart=/opt/fhem/fhem.pl /opt/fhem/fhem.cfg
146 +Restart=always
147 +
148 +[Install]
149 +WantedBy=multi-user.target