Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/lirc/, app-misc/lirc/files/
Date: Sat, 30 Jul 2016 08:32:03
Message-Id: 1469867440.b56cfd2afbca914c16a992678c4f203706254c75.soap@gentoo
1 commit: b56cfd2afbca914c16a992678c4f203706254c75
2 Author: Craig Andrews <candrews <AT> integralblue <DOT> com>
3 AuthorDate: Wed Jul 20 15:49:46 2016 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 30 08:30:40 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b56cfd2a
7
8 app-misc/lirc-0.9.4a-r1 fix documentation and socket directories
9
10 set localstatedir to /var so lirc correctly uses /var/run instead of /var/lib/run
11 install documentation to /usr/share/doc/lirc-${PF}
12 use irexec-initd-0.9.4a-r1 instead of irexec-initd as the irexec initd script to resolve a QA notice
13
14 Gentoo-bug: 589246
15 Closes: https://github.com/gentoo/gentoo/pull/1922
16
17 Signed-off-by: David Seifert <soap <AT> gentoo.org>
18
19 app-misc/lirc/files/irexec-initd-0.9.4a-r1 | 28 +++++
20 app-misc/lirc/files/lirc-0.9.4-doc-path-fix.patch | 27 +++++
21 app-misc/lirc/lirc-0.9.4a-r1.ebuild | 131 ++++++++++++++++++++++
22 3 files changed, 186 insertions(+)
23
24 diff --git a/app-misc/lirc/files/irexec-initd-0.9.4a-r1 b/app-misc/lirc/files/irexec-initd-0.9.4a-r1
25 new file mode 100644
26 index 0000000..203ad3a
27 --- /dev/null
28 +++ b/app-misc/lirc/files/irexec-initd-0.9.4a-r1
29 @@ -0,0 +1,28 @@
30 +#!/sbin/openrc-run
31 +# Copyright 2003 Martin Hierling <mad@×××××××××××.de>
32 +# Distributed under the terms of the GNU General Public License v2
33 +# $Id$
34 +
35 +: ${IREXEC_USER:=root}
36 +
37 +depend() {
38 + need lircd
39 +}
40 +
41 +start() {
42 + if [ "x${IREXEC_USER}" = "xroot" -a "x${IREXEC_DISABLE_ROOT_WARNING}" != "xyes" ]; then
43 + ewarn "Warning: Running irexec as root can open security holes"
44 + fi
45 +
46 + ebegin "Starting irexec"
47 + start-stop-daemon --start --chuid ${IREXEC_USER} --user ${IREXEC_USER} --chdir / \
48 + --exec /usr/bin/irexec -- --daemon ${IREXEC_OPTS}
49 + eend $? "Failed to start irexec."
50 +}
51 +
52 +stop() {
53 + ebegin "Stopping irexec"
54 + start-stop-daemon --stop --exec /usr/bin/irexec --user ${IREXEC_USER}
55 + eend $? "Failed to stop irexec."
56 +}
57 +
58
59 diff --git a/app-misc/lirc/files/lirc-0.9.4-doc-path-fix.patch b/app-misc/lirc/files/lirc-0.9.4-doc-path-fix.patch
60 new file mode 100644
61 index 0000000..9a2d6c2
62 --- /dev/null
63 +++ b/app-misc/lirc/files/lirc-0.9.4-doc-path-fix.patch
64 @@ -0,0 +1,27 @@
65 +https://sourceforge.net/p/lirc/tickets/214/
66 +
67 +diff --git a/doc/Makefile.am b/doc/Makefile.am
68 +index 53d0f21..f833b4b 100644
69 +--- a/doc/Makefile.am
70 ++++ b/doc/Makefile.am
71 +@@ -33,7 +33,6 @@ nodist_man_MANS += man/xmode2.1 man/irxevent.1
72 + manpage_html += man-html/irxevent.html man-html/xmode2.html
73 + endif
74 +
75 +-docdir = @datadir@/doc/@PACKAGE@
76 + dist_doc_DATA = irxevent.keys
77 +
78 + if HAVE_DOXYGEN
79 +@@ -58,10 +57,10 @@ if HAVE_PYMOD_YAML
80 + nodist_website_html_DATA += table.html
81 + endif
82 +
83 +-vardocsdir = $(localstatedir)/lib/lirc/plugins
84 ++vardocsdir = $(docdir)/plugins
85 + vardocs_DATA = index.html html-source/lirc.css
86 +
87 +-varimagedir = $(localstatedir)/lib/lirc/images
88 ++varimagedir = $(docdir)/images
89 + varimage_DATA = $(dist_image_DATA)
90 +
91 + website_imagedir = $(docdir)/lirc.org/images
92
93 diff --git a/app-misc/lirc/lirc-0.9.4a-r1.ebuild b/app-misc/lirc/lirc-0.9.4a-r1.ebuild
94 new file mode 100644
95 index 0000000..e77f5fa
96 --- /dev/null
97 +++ b/app-misc/lirc/lirc-0.9.4a-r1.ebuild
98 @@ -0,0 +1,131 @@
99 +# Copyright 1999-2016 Gentoo Foundation
100 +# Distributed under the terms of the GNU General Public License v2
101 +# $Id$
102 +
103 +EAPI=6
104 +
105 +inherit eutils flag-o-matic systemd
106 +
107 +DESCRIPTION="decode and send infra-red signals of many commonly used remote controls"
108 +HOMEPAGE="http://www.lirc.org/"
109 +
110 +LIRC_DRIVER_DEVICE="/dev/lirc0"
111 +
112 +MY_P=${PN}-${PV/_/}
113 +
114 +if [[ "${PV/_pre/}" = "${PV}" ]]; then
115 + SRC_URI="mirror://sourceforge/lirc/${MY_P}.tar.bz2"
116 +else
117 + SRC_URI="http://www.lirc.org/software/snapshots/${MY_P}.tar.bz2"
118 +fi
119 +
120 +LICENSE="GPL-2"
121 +SLOT="0"
122 +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
123 +IUSE="doc static-libs X audio irman ftdi inputlirc iguanair systemd usb"
124 +
125 +S="${WORKDIR}/${MY_P}"
126 +
127 +REQUIRED_USE="
128 + iguanair? ( irman )
129 +"
130 +DEPEND="
131 + doc? ( app-doc/doxygen )
132 +"
133 +
134 +RDEPEND="
135 + X? (
136 + x11-libs/libX11
137 + x11-libs/libSM
138 + x11-libs/libICE
139 + )
140 + systemd? ( sys-apps/systemd )
141 + audio? (
142 + >media-libs/portaudio-18
143 + media-libs/alsa-lib
144 + )
145 + irman? ( media-libs/libirman )
146 + iguanair? ( app-misc/iguanaIR )
147 + ftdi? ( dev-embedded/libftdi:0 )
148 + inputlirc? ( app-misc/inputlircd )
149 + usb? ( virtual/libusb:0 )
150 +"
151 +
152 +PATCHES=(
153 + "${FILESDIR}"/lirc-0.9.4-doc-path-fix.patch # https://bugs.gentoo.org/show_bug.cgi?id=589246 https://sourceforge.net/p/lirc/tickets/214/
154 +)
155 +
156 +src_configure() {
157 + filter-flags -Wl,-O1
158 + econf \
159 + --docdir=/usr/share/doc/${PF} \
160 + --localstatedir=/var \
161 + $(use_enable static-libs static) \
162 + $(use_with X x)
163 +}
164 +
165 +src_install() {
166 + default
167 +
168 + newinitd "${FILESDIR}"/lircd-0.8.6-r2 lircd
169 + newinitd "${FILESDIR}"/lircmd lircmd
170 + newconfd "${FILESDIR}"/lircd.conf.4 lircd
171 +
172 + insinto /etc/modprobe.d/
173 + newins "${FILESDIR}"/modprobed.lirc lirc.conf
174 +
175 + newinitd "${FILESDIR}"/irexec-initd-0.9.4a-r1 irexec
176 + newconfd "${FILESDIR}"/irexec-confd irexec
177 +
178 + keepdir /etc/lirc
179 + if [[ -e "${D}"/etc/lirc/lircd.conf ]]; then
180 + newdoc "${D}"/etc/lirc/lircd.conf lircd.conf.example
181 + fi
182 +
183 + if ! use static-libs; then
184 + rm "${D}/usr/$(get_libdir)/liblirc_client.la" || die
185 + fi
186 +
187 + # Avoid QA notice
188 + rm -d "${D}"/var/run/lirc || die
189 + rm -d "${D}"/var/run || die
190 +}
191 +
192 +pkg_preinst() {
193 + local dir="${EROOT}/etc/modprobe.d"
194 + if [[ -a "${dir}"/lirc && ! -a "${dir}"/lirc.conf ]]; then
195 + elog "Renaming ${dir}/lirc to lirc.conf"
196 + mv -f "${dir}/lirc" "${dir}/lirc.conf" || die
197 + fi
198 +
199 + # copy the first file that can be found
200 + if [[ -f "${EROOT}"/etc/lirc/lircd.conf ]]; then
201 + cp "${EROOT}"/etc/lirc/lircd.conf "${T}"/lircd.conf || die
202 + elif [[ -f "${EROOT}"/etc/lircd.conf ]]; then
203 + cp "${EROOT}"/etc/lircd.conf "${T}"/lircd.conf || die
204 + MOVE_OLD_LIRCD_CONF=1
205 + elif [[ -f "${D}"/etc/lirc/lircd.conf ]]; then
206 + cp "${D}"/etc/lirc/lircd.conf "${T}"/lircd.conf || die
207 + fi
208 +
209 + # stop portage from touching the config file
210 + if [[ -e "${D}"/etc/lirc/lircd.conf ]]; then
211 + rm -f "${D}"/etc/lirc/lircd.conf || die
212 + fi
213 +}
214 +
215 +pkg_postinst() {
216 + # copy config file to new location
217 + # without portage knowing about it
218 + # so it will not delete it on unmerge or ever touch it again
219 + if [[ -e "${T}"/lircd.conf ]]; then
220 + cp "${T}"/lircd.conf "${EROOT}"/etc/lirc/lircd.conf || die
221 + if [[ "$MOVE_OLD_LIRCD_CONF" = "1" ]]; then
222 + elog "Moved /etc/lircd.conf to /etc/lirc/lircd.conf"
223 + rm -f "${EROOT}"/etc/lircd.conf || die
224 + fi
225 + fi
226 +
227 + einfo "The new default location for lircd.conf is inside of"
228 + einfo "/etc/lirc/ directory"
229 +}