Gentoo Archives: gentoo-commits

From: Craig Andrews <candrews@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/lirc/, app-misc/lirc/files/
Date: Sun, 15 Sep 2019 01:32:38
Message-Id: 1568511144.31b7716e13228a7a36e9cbc53b7124d26137e137.candrews@gentoo
1 commit: 31b7716e13228a7a36e9cbc53b7124d26137e137
2 Author: Craig Andrews <candrews <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 15 01:15:26 2019 +0000
4 Commit: Craig Andrews <candrews <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 15 01:32:24 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31b7716e
7
8 app-misc/lirc: Create the /run/lirc directory
9
10 Bug: https://sourceforge.net/p/lirc/git/merge-requests/42/
11 Closes: https://bugs.gentoo.org/694310
12 Package-Manager: Portage-2.3.76, Repoman-2.3.17
13 Signed-off-by: Craig Andrews <candrews <AT> gentoo.org>
14
15 .../lirc/files/lirc-0.10.1-runtimedirectory.patch | 18 +++
16 app-misc/lirc/lirc-0.10.1-r2.ebuild | 161 +++++++++++++++++++++
17 2 files changed, 179 insertions(+)
18
19 diff --git a/app-misc/lirc/files/lirc-0.10.1-runtimedirectory.patch b/app-misc/lirc/files/lirc-0.10.1-runtimedirectory.patch
20 new file mode 100644
21 index 00000000000..256ac9eda20
22 --- /dev/null
23 +++ b/app-misc/lirc/files/lirc-0.10.1-runtimedirectory.patch
24 @@ -0,0 +1,18 @@
25 +https://sourceforge.net/p/lirc/git/merge-requests/42/
26 +
27 +Author: Craig Andrews <candrews@××××××××××××.com>
28 +Date: Sat Sep 14 21:03:49 2019 -0400
29 +
30 + systemd: ensure lirc runtime directory exists
31 +
32 +diff --git a/systemd/lircd.service b/systemd/lircd.service
33 +--- a/systemd/lircd.service
34 ++++ b/systemd/lircd.service
35 +@@ -8,6 +8,7 @@
36 + [Service]
37 + Type=simple
38 + ExecStart=/usr/sbin/lircd --nodaemon
39 ++RuntimeDirectory=lirc
40 + ; User=lirc
41 + ; Group=lirc
42 +
43
44 diff --git a/app-misc/lirc/lirc-0.10.1-r2.ebuild b/app-misc/lirc/lirc-0.10.1-r2.ebuild
45 new file mode 100644
46 index 00000000000..1395b4dc65e
47 --- /dev/null
48 +++ b/app-misc/lirc/lirc-0.10.1-r2.ebuild
49 @@ -0,0 +1,161 @@
50 +# Copyright 1999-2019 Gentoo Authors
51 +# Distributed under the terms of the GNU General Public License v2
52 +
53 +EAPI=7
54 +
55 +PYTHON_COMPAT=( python3_{5,6,7} )
56 +
57 +inherit eutils flag-o-matic linux-info python-single-r1 systemd xdg-utils
58 +
59 +DESCRIPTION="decode and send infra-red signals of many commonly used remote controls"
60 +HOMEPAGE="http://www.lirc.org/"
61 +
62 +LIRC_DRIVER_DEVICE="/dev/lirc0"
63 +
64 +MY_P=${PN}-${PV/_/-}
65 +
66 +if [[ "${PV/_pre/}" = "${PV}" ]]; then
67 + SRC_URI="mirror://sourceforge/lirc/${MY_P}.tar.bz2"
68 +else
69 + SRC_URI="http://www.lirc.org/software/snapshots/${MY_P}.tar.bz2"
70 +fi
71 +
72 +LICENSE="GPL-2+"
73 +SLOT="0"
74 +KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86"
75 +IUSE="audio +devinput doc ftdi gtk inputlirc static-libs systemd +uinput usb X"
76 +
77 +REQUIRED_USE="
78 + ${PYTHON_REQUIRED_USE}
79 + gtk? ( X )
80 +"
81 +
82 +S="${WORKDIR}/${MY_P}"
83 +
84 +COMMON_DEPEND="
85 + ${PYTHON_DEPS}
86 + audio? (
87 + >media-libs/portaudio-18
88 + media-libs/alsa-lib
89 + )
90 + dev-python/pyyaml[${PYTHON_USEDEP}]
91 + ftdi? ( dev-embedded/libftdi:0 )
92 + systemd? ( sys-apps/systemd )
93 + usb? ( virtual/libusb:0 )
94 + X? (
95 + x11-libs/libICE
96 + x11-libs/libSM
97 + x11-libs/libX11
98 + )
99 +"
100 +
101 +DEPEND="
102 + ${COMMON_DEPEND}
103 + dev-libs/libxslt
104 + dev-python/setuptools[${PYTHON_USEDEP}]
105 + doc? ( app-doc/doxygen )
106 + sys-apps/kmod
107 + sys-kernel/linux-headers
108 +"
109 +
110 +RDEPEND="
111 + ${COMMON_DEPEND}
112 + gtk? (
113 + x11-libs/vte[introspection]
114 + dev-python/pygobject[${PYTHON_USEDEP}]
115 + )
116 + inputlirc? ( app-misc/inputlircd )
117 +"
118 +
119 +PATCHES=(
120 + "${FILESDIR}/${P}-unsafe-load.patch"
121 + "${FILESDIR}/${P}-runtimedirectory.patch"
122 +)
123 +
124 +MAKEOPTS+=" -j1"
125 +
126 +pkg_setup() {
127 + use uinput && CONFIG_CHECK="~INPUT_UINPUT"
128 + python-single-r1_pkg_setup
129 + linux-info_pkg_setup
130 +}
131 +
132 +src_configure() {
133 + xdg_environment_reset
134 + econf \
135 + --localstatedir="${EPREFIX}/var" \
136 + $(use_enable static-libs static) \
137 + $(use_enable devinput) \
138 + $(use_enable uinput) \
139 + $(use_with X x)
140 +}
141 +
142 +src_install() {
143 + default
144 +
145 + if use !gtk ; then
146 + # lirc-setup requires gtk
147 + rm "${ED}"/usr/bin/lirc-setup || die
148 + fi
149 +
150 + newinitd "${FILESDIR}"/lircd-0.8.6-r2 lircd
151 + newinitd "${FILESDIR}"/lircmd-0.9.4a-r2 lircmd
152 + newconfd "${FILESDIR}"/lircd.conf.4 lircd
153 + newconfd "${FILESDIR}"/lircmd-0.10.0.conf lircmd
154 +
155 + insinto /etc/modprobe.d/
156 + newins "${FILESDIR}"/modprobed.lirc lirc.conf
157 +
158 + newinitd "${FILESDIR}"/irexec-initd-0.9.4a-r2 irexec
159 + newconfd "${FILESDIR}"/irexec-confd irexec
160 +
161 + keepdir /etc/lirc
162 + if [[ -e "${ED}"/etc/lirc/lircd.conf ]]; then
163 + newdoc "${ED}"/etc/lirc/lircd.conf lircd.conf.example
164 + fi
165 +
166 + find "${ED}" -name '*.la' -delete || die
167 +
168 + # Avoid QA notice
169 + rm -d "${ED}"/var/run/lirc || die
170 + rm -d "${ED}"/var/run || die
171 +}
172 +
173 +pkg_preinst() {
174 + local dir="${EROOT}/etc/modprobe.d"
175 + if [[ -a "${dir}"/lirc && ! -a "${dir}"/lirc.conf ]]; then
176 + elog "Renaming ${dir}/lirc to lirc.conf"
177 + mv -f "${dir}/lirc" "${dir}/lirc.conf" || die
178 + fi
179 +
180 + # copy the first file that can be found
181 + if [[ -f "${EROOT}"/etc/lirc/lircd.conf ]]; then
182 + cp "${EROOT}"/etc/lirc/lircd.conf "${T}"/lircd.conf || die
183 + elif [[ -f "${EROOT}"/etc/lircd.conf ]]; then
184 + cp "${EROOT}"/etc/lircd.conf "${T}"/lircd.conf || die
185 + MOVE_OLD_LIRCD_CONF=1
186 + elif [[ -f "${ED}"/etc/lirc/lircd.conf ]]; then
187 + cp "${ED}"/etc/lirc/lircd.conf "${T}"/lircd.conf || die
188 + fi
189 +
190 + # stop portage from touching the config file
191 + if [[ -e "${ED}"/etc/lirc/lircd.conf ]]; then
192 + rm -f "${ED}"/etc/lirc/lircd.conf || die
193 + fi
194 +}
195 +
196 +pkg_postinst() {
197 + # copy config file to new location
198 + # without portage knowing about it
199 + # so it will not delete it on unmerge or ever touch it again
200 + if [[ -e "${T}"/lircd.conf ]]; then
201 + cp "${T}"/lircd.conf "${EROOT}"/etc/lirc/lircd.conf || die
202 + if [[ "$MOVE_OLD_LIRCD_CONF" = "1" ]]; then
203 + elog "Moved /etc/lircd.conf to /etc/lirc/lircd.conf"
204 + rm -f "${EROOT}"/etc/lircd.conf || die
205 + fi
206 + fi
207 +
208 + einfo "The new default location for lircd.conf is inside of"
209 + einfo "${EROOT}/etc/lirc/ directory"
210 +}