Gentoo Archives: gentoo-commits

From: Austin English <wizardedit@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/lirc/, app-misc/lirc/files/
Date: Tue, 26 Apr 2016 17:54:01
Message-Id: 1461693226.76f926d224d71fd07d0678f6187d6f3d7d4445d7.wizardedit@gentoo
1 commit: 76f926d224d71fd07d0678f6187d6f3d7d4445d7
2 Author: Austin English <wizardedit <AT> gentoo <DOT> org>
3 AuthorDate: Tue Apr 26 17:52:12 2016 +0000
4 Commit: Austin English <wizardedit <AT> gentoo <DOT> org>
5 CommitDate: Tue Apr 26 17:53:46 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76f926d2
7
8 app-misc/lirc: use #!/sbin/openrc-run instead of #!/sbin/runscript
9
10 Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=573846
11
12 Package-Manager: portage-2.2.26
13
14 app-misc/lirc/files/irexec-initd-0.8.6-r2 | 2 +-
15 app-misc/lirc/files/lircd-0.8.6-r2 | 4 +-
16 app-misc/lirc/files/lircmd | 4 +-
17 app-misc/lirc/lirc-0.9.0-r6.ebuild | 429 ++++++++++++++++++++++++++++++
18 4 files changed, 434 insertions(+), 5 deletions(-)
19
20 diff --git a/app-misc/lirc/files/irexec-initd-0.8.6-r2 b/app-misc/lirc/files/irexec-initd-0.8.6-r2
21 index 8c940d7..95b1c07 100644
22 --- a/app-misc/lirc/files/irexec-initd-0.8.6-r2
23 +++ b/app-misc/lirc/files/irexec-initd-0.8.6-r2
24 @@ -1,4 +1,4 @@
25 -#!/sbin/runscript
26 +#!/sbin/openrc-run
27 # Copyright 2003 Martin Hierling <mad@×××××××××××.de>
28 # Distributed under the terms of the GNU General Public License v2
29 # $Id$
30
31 diff --git a/app-misc/lirc/files/lircd-0.8.6-r2 b/app-misc/lirc/files/lircd-0.8.6-r2
32 index ed47795..17e45ea 100644
33 --- a/app-misc/lirc/files/lircd-0.8.6-r2
34 +++ b/app-misc/lirc/files/lircd-0.8.6-r2
35 @@ -1,5 +1,5 @@
36 -#!/sbin/runscript
37 -# Copyright 1999-2014 Gentoo Foundation
38 +#!/sbin/openrc-run
39 +# Copyright 1999-2016 Gentoo Foundation
40 # Distributed under the terms of the GNU General Public License v2
41 # $Id$
42
43
44 diff --git a/app-misc/lirc/files/lircmd b/app-misc/lirc/files/lircmd
45 index b9903b7..ffd73a6 100644
46 --- a/app-misc/lirc/files/lircmd
47 +++ b/app-misc/lirc/files/lircmd
48 @@ -1,5 +1,5 @@
49 -#!/sbin/runscript
50 -# Copyright 1999-2004 Gentoo Foundation
51 +#!/sbin/openrc-run
52 +# Copyright 1999-2016 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 # $Id$
55
56
57 diff --git a/app-misc/lirc/lirc-0.9.0-r6.ebuild b/app-misc/lirc/lirc-0.9.0-r6.ebuild
58 new file mode 100644
59 index 0000000..4cbefa6
60 --- /dev/null
61 +++ b/app-misc/lirc/lirc-0.9.0-r6.ebuild
62 @@ -0,0 +1,429 @@
63 +# Copyright 1999-2016 Gentoo Foundation
64 +# Distributed under the terms of the GNU General Public License v2
65 +# $Id$
66 +
67 +EAPI=4
68 +
69 +inherit eutils linux-mod linux-info systemd toolchain-funcs flag-o-matic autotools
70 +
71 +DESCRIPTION="decode and send infra-red signals of many commonly used remote controls"
72 +HOMEPAGE="http://www.lirc.org/"
73 +
74 +MY_P=${PN}-${PV/_/}
75 +
76 +if [[ "${PV/_pre/}" = "${PV}" ]]; then
77 + SRC_URI="mirror://sourceforge/lirc/${MY_P}.tar.bz2"
78 +else
79 + SRC_URI="http://www.lirc.org/software/snapshots/${MY_P}.tar.bz2"
80 +fi
81 +
82 +LICENSE="GPL-2"
83 +SLOT="0"
84 +KEYWORDS="amd64 ppc ppc64 x86"
85 +IUSE="debug doc hardware-carrier transmitter static-libs X"
86 +
87 +S="${WORKDIR}/${MY_P}"
88 +
89 +RDEPEND="
90 + X? (
91 + x11-libs/libX11
92 + x11-libs/libSM
93 + x11-libs/libICE
94 + )
95 + lirc_devices_alsa_usb? ( media-libs/alsa-lib )
96 + lirc_devices_audio? ( >media-libs/portaudio-18 )
97 + lirc_devices_irman? ( media-libs/libirman )"
98 +
99 +# 2012-07-17, Ian Stakenvicius
100 +# A helper script that scrapes out values for nearly all of the variables below
101 +# from lirc's configure.ac is available at
102 +# https://dev.gentoo.org/~axs/helper-for-lirc-iuse.sh
103 +
104 +# This are drivers with names matching the
105 +# parameter --with-driver=NAME
106 +IUSE_LIRC_DEVICES_DIRECT="
107 + all userspace accent act200l act220l
108 + adaptec alsa_usb animax asusdh atilibusb
109 + atiusb audio audio_alsa avermedia avermedia_vdomate
110 + avermedia98 awlibusb bestbuy bestbuy2 breakoutbox
111 + bte bw6130 caraca chronos commandir
112 + cph06x creative creative_infracd
113 + devinput digimatrix dsp dvico ea65 ene0100
114 + exaudio flyvideo ftdi gvbctv5pci hauppauge
115 + hauppauge_dvb hercules_smarttv_stereo i2cuser
116 + igorplugusb iguanaIR imon imon_24g imon_knob
117 + imon_lcd imon_pad imon_rsc irdeo irdeo_remote
118 + irlink irman irreal it87 ite8709
119 + knc_one kworld leadtek_0007 leadtek_0010
120 + leadtek_pvr2000 livedrive_midi
121 + livedrive_seq logitech macmini
122 + mediafocusI mouseremote
123 + mouseremote_ps2 mp3anywhere mplay nslu2
124 + packard_bell parallel pcmak pcmak_usb
125 + pctv pixelview_bt878 pixelview_pak
126 + pixelview_pro provideo realmagic
127 + remotemaster sa1100 samsung sasem sb0540 serial
128 + silitek sir slinke streamzap tekram
129 + tekram_bt829 tira ttusbir tuxbox tvbox udp uirt2
130 + uirt2_raw usb_uirt_raw usbx wpc8769l zotac"
131 +
132 +# drivers that need special handling and
133 +# must have another name specified for
134 +# parameter --with-driver=NAME
135 +IUSE_LIRC_DEVICES_SPECIAL="
136 + serial_igor_cesko
137 + remote_wonder_plus xboxusb inputlirc"
138 +
139 +IUSE_LIRC_DEVICES="${IUSE_LIRC_DEVICES_DIRECT} ${IUSE_LIRC_DEVICES_SPECIAL}"
140 +
141 +# The following are lists which are used to provide ewarns on incompatibilities
142 +# with the kernel:
143 +
144 +#drivers that do not build kernel modules
145 +NO_KMOD_BUILT_FOR_DEV="
146 + accent bte creative creative_infracd devinput dsp ea65 exaudio
147 + ftdi i2cuser irlink irreal livedrive_midi livedrive_seq logitech
148 + mediafocusI mouseremote mouseremote_ps2 mp3anywhere mplay mplay2
149 + pcmak pcmak_usb pctv realmagic remotemaster silitek tira tira_raw
150 + tuxbox udp uirt2 uirt2_raw usb_uirt_raw usbx"
151 +
152 +#drivers that build lirc_dev and so will conflict with kernel lirc_dev
153 +LIRCDEV_BUILT_FOR_DEV="all
154 + act200l act220l adaptec animax atiusb breakoutbox hauppauge
155 + hauppauge_dvb hercules_smarttv_stereo igorplugusb imon imon_24g
156 + imon_knob imon_lcd imon_pad imon_rsc irdeo irdeo_remote knc_one
157 + leadtek_pvr2000 nslu2 packard_bell parallel pixelview_bt878
158 + provideo sa1100 sasem serial sir tekram tekram_bt829 ttusbir
159 + tvbox wpc8769l zotac"
160 +
161 +#lirc_gpio drivers, which cannot be supported on kernel >= 2.6.22
162 +LIRC_GPIO_DEV="
163 + avermedia avermedia98 avermedia_vdomate bestbuy bestbuy2 chronos
164 + cph03x cph06x flyvideo gvbctv5pci kworld leadtek_0007 leadtek_0010
165 + pixelview_pak pixelview_pro"
166 +
167 +#device-driver which use libusb
168 +LIBUSB_USED_BY_DEV="
169 + all atilibusb awlibusb sasem igorplugusb imon imon_lcd imon_pad
170 + imon_rsc streamzap xboxusb irlink commandir"
171 +
172 +for dev in ${LIBUSB_USED_BY_DEV}; do
173 + DEPEND="${DEPEND} lirc_devices_${dev}? ( virtual/libusb:0 )"
174 +done
175 +
176 +# adding only compile-time depends
177 +DEPEND="${RDEPEND} ${DEPEND}
178 + virtual/linux-sources
179 + lirc_devices_ftdi? ( dev-embedded/libftdi:0 )
180 + lirc_devices_all? ( dev-embedded/libftdi:0 )"
181 +
182 +# adding only run-time depends
183 +RDEPEND="${RDEPEND}
184 + lirc_devices_inputlirc? ( app-misc/inputlircd )
185 + lirc_devices_iguanaIR? ( app-misc/iguanaIR )"
186 +
187 +# add all devices to IUSE
188 +# and ensure lirc_devices_all is not set alongside lirc_devices_*
189 +REQUIRED_USE="lirc_devices_all? ("
190 +for dev in ${IUSE_LIRC_DEVICES}; do
191 + IUSE="${IUSE} lirc_devices_${dev}"
192 + if [[ "${dev}" != "all" ]]; then
193 + REQUIRED_USE="${REQUIRED_USE} !lirc_devices_${dev}"
194 + fi
195 +done
196 +REQUIRED_USE="${REQUIRED_USE} )"
197 +
198 +add_device() {
199 + local dev="${1}"
200 + local desc="device ${dev}"
201 + if [[ -n "${2}" ]]; then
202 + desc="${2}"
203 + fi
204 +
205 + # Bug #187418
206 + if kernel_is ge 2 6 22 && [[ " ${LIRC_GPIO_DEV} " == *" ${dev} "* ]]; then
207 + eerror "${desc} uses lirc_gpio which fails with kernel 2.6.22 or above. Not building."
208 + eerror "Use 'devinput' instead, or use 'userspace' along with in-kernel drivers"
209 + return 0
210 + fi
211 + : ${lirc_device_count:=0}
212 + ((lirc_device_count++))
213 +
214 + elog "Compiling support for ${desc}"
215 +
216 + if [[ " ${LIRCDEV_BUILT_FOR_DEV} " == *" ${dev} "* ]] ; then
217 + if linux_chkconfig_present LIRC ; then
218 + ewarn "${desc} builds lirc_dev and CONFIG_LIRC is set in the kernel -- this may conflict."
219 + fi
220 + if ! linux_chkconfig_present MODULE_UNLOAD ; then
221 + ewarn "${desc} builds modules and CONFIG_MODULE_UNLOAD is unset in kernel."
222 + ewarn "You will need MODULE_UNLOAD support in your kernel."
223 + fi
224 + fi
225 + if [[ " ${NO_KMOD_BUILT_FOR_DEV} " == *" ${dev} "* ]] && ! linux_chkconfig_present IR_LIRC_CODEC ; then
226 + ewarn "${desc} builds no kernel module and CONFIG_IR_LIRC_CODEC is unset in kernel."
227 + fi
228 +
229 + if [[ ${lirc_device_count} -eq 2 ]] ; then
230 + ewarn
231 + ewarn "LIRC_DEVICES has more than one entry."
232 + ewarn "When selecting multiple devices for lirc to be supported,"
233 + ewarn "it can not be guaranteed that the drivers play nice together."
234 + ewarn "If this is not intended, then please adjust LIRC_DEVICES"
235 + ewarn "and re-emerge."
236 + ewarn
237 + fi
238 +
239 + MY_OPTS="${MY_OPTS} --with-driver=${dev}"
240 +}
241 +
242 +pkg_pretend() {
243 + if [[ -n "${LIRC_OPTS}" ]] ; then
244 + ewarn
245 + ewarn "LIRC_OPTS is deprecated from lirc-0.8.0-r1 on."
246 + ewarn
247 + ewarn "Please use LIRC_DEVICES from now on."
248 + ewarn "e.g. LIRC_DEVICES=\"serial sir\""
249 + ewarn
250 + ewarn "Flags are now set per use-flags."
251 + ewarn "e.g. transmitter, hardware-carrier"
252 +
253 + local opt
254 + local unsupported_opts=""
255 +
256 + # test for allowed options for LIRC_OPTS
257 + for opt in ${LIRC_OPTS}; do
258 + case ${opt} in
259 + --with-port=*|--with-irq=*|--with-timer=*|--with-tty=*)
260 + MY_OPTS="${MY_OPTS} ${opt}"
261 + ;;
262 + *)
263 + unsupported_opts="${unsupported_opts} ${opt}"
264 + ;;
265 + esac
266 + done
267 + if [[ -n ${unsupported_opts} ]]; then
268 + eerror "These options are no longer allowed to be set"
269 + eerror "with LIRC_OPTS: ${unsupported_opts}"
270 + die "LIRC_OPTS is no longer supported, use LIRC_DEVICES."
271 + fi
272 + fi
273 +}
274 +
275 +pkg_setup() {
276 + linux-mod_pkg_setup
277 +
278 + # set default configure options
279 + MY_OPTS=""
280 + LIRC_DRIVER_DEVICE="/dev/lirc0"
281 +
282 + if use lirc_devices_all; then
283 + # compile in drivers for a lot of devices
284 + add_device all "a lot of devices"
285 + else
286 + # compile in only requested drivers
287 + local dev
288 + for dev in ${IUSE_LIRC_DEVICES_DIRECT}; do
289 + if use lirc_devices_${dev}; then
290 + add_device ${dev}
291 + fi
292 + done
293 +
294 + if use lirc_devices_remote_wonder_plus; then
295 + add_device atiusb "device Remote Wonder Plus (atiusb-based)"
296 + fi
297 +
298 + if use lirc_devices_serial_igor_cesko; then
299 + add_device serial "serial with Igor Cesko design"
300 + MY_OPTS="${MY_OPTS} --with-igor"
301 + fi
302 +
303 + if use lirc_devices_imon_pad; then
304 + ewarn "The imon_pad driver has incorporated the previous pad2keys patch"
305 + ewarn "and removed the pad2keys_active option for the lirc_imon module"
306 + ewarn "because it is always active."
307 + ewarn "If you have an older imon VFD device, you may need to add the module"
308 + ewarn "option display_type=1 to override autodetection and force VFD mode."
309 + fi
310 +
311 + if use lirc_devices_xboxusb; then
312 + add_device atiusb "device xboxusb"
313 + fi
314 +
315 + if [[ "${MY_OPTS}" == "" ]]; then
316 + if [[ "${PROFILE_ARCH}" == "xbox" ]]; then
317 + # on xbox: use special driver
318 + add_device atiusb "device xboxusb"
319 + else
320 + # no driver requested
321 + elog
322 + elog "Compiling only the lirc-applications, but no drivers."
323 + elog "Enable drivers with LIRC_DEVICES if you need them."
324 + MY_OPTS="--with-driver=none"
325 + fi
326 + fi
327 + fi
328 +
329 + use hardware-carrier && MY_OPTS="${MY_OPTS} --without-soft-carrier"
330 + use transmitter && MY_OPTS="${MY_OPTS} --with-transmitter"
331 +
332 + einfo
333 + einfo "lirc-configure-opts: ${MY_OPTS}"
334 + elog "Setting default lirc-device to ${LIRC_DRIVER_DEVICE}"
335 +
336 + filter-flags -Wl,-O1
337 +}
338 +
339 +src_prepare() {
340 + # Rip out dos CRLF
341 + edos2unix contrib/lirc.rules
342 +
343 + # Apply patches needed for some special device-types
344 + use lirc_devices_audio || epatch "${FILESDIR}"/lirc-0.8.4-portaudio_check.patch
345 + use lirc_devices_remote_wonder_plus && epatch "${FILESDIR}"/lirc-0.8.3_pre1-remotewonderplus.patch
346 +
347 + # Apply fixes for kernel-2.6.39 and above
348 + epatch "${FILESDIR}"/${P}-kernel-2.6.39-fixes.patch
349 + # Slightly massaged upstream patch to fix kfifo issues >=2.6.38
350 + # for bug 377033
351 + epatch "${FILESDIR}"/${P}-atiusb_kfifo.patch
352 + # Apply fixes for kernel-3.3 and above (bug 439538)
353 + epatch "${FILESDIR}"/${P}-kernel-3.3.0-fixes.patch
354 + # Apply fix for missing err() in usb.h for kernel 3.5+ (bug 444736)
355 + epatch "${FILESDIR}"/${P}-kernel-3.5-err-fix.patch
356 + # Apply fix for missing __devinit __devexit defines in kernel 3.8+ (bug 461532)
357 + epatch "${FILESDIR}"/${P}-kernel-3.8-fixes.patch
358 + # Add support for zotac remote, bug 342848
359 + epatch "${FILESDIR}"/${P}-add-zotac-support.patch
360 + # Use fixed font
361 + epatch "${FILESDIR}"/${P}-fixed-font.patch
362 +
363 + # Do not build drivers from the top-level Makefile
364 + sed -i -e 's:\(SUBDIRS =\) drivers\(.*\):\1\2:' Makefile.am
365 +
366 + # remove parallel driver on SMP systems
367 + if linux_chkconfig_present SMP ; then
368 + sed -i -e "s:lirc_parallel\.o::" drivers/lirc_parallel/Makefile.am
369 + fi
370 +
371 + # Bug #187418 - only need this part for lirc_devices_all as others die in pkg_setup
372 + if use lirc_devices_all && kernel_is ge 2 6 22 ; then
373 + ewarn "Disabling lirc_gpio driver as it does no longer work Kernel 2.6.22+"
374 + sed -i -e "s:lirc_gpio\.o::" drivers/lirc_gpio/Makefile.am
375 + fi
376 +
377 + # respect CFLAGS
378 + sed -i -e 's:CFLAGS="-O2:CFLAGS=""\n#CFLAGS="-O2:' configure.ac
379 +
380 + # setting default device-node
381 + local f
382 + for f in configure.ac acconfig.h; do
383 + [[ -f "$f" ]] && sed -i -e '/#define LIRC_DRIVER_DEVICE/d' "$f"
384 + done
385 + echo "#define LIRC_DRIVER_DEVICE \"${LIRC_DRIVER_DEVICE}\"" >> acconfig.h
386 +
387 + sed -e "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" -i configure.ac || die # automake 1.13
388 + eautoreconf
389 +}
390 +
391 +src_configure() {
392 + econf \
393 + --localstatedir=/var \
394 + --with-syslog=LOG_DAEMON \
395 + --enable-sandboxed \
396 + --with-kerneldir="${KV_DIR}" \
397 + --with-moduledir="/lib/modules/${KV_FULL}/misc" \
398 + $(use_enable debug) \
399 + $(use_enable static-libs static) \
400 + $(use_with X x) \
401 + ${MY_OPTS} \
402 + ABI="${KERNEL_ABI}" \
403 + ARCH="$(tc-arch-kernel)"
404 +}
405 +
406 +src_compile() {
407 + # force non-parallel make, Bug 196134 (confirmed valid for 0.9.0-r2)
408 + emake -j1
409 +
410 + MODULE_NAMES="lirc(misc:${S}/drivers)"
411 + BUILD_TARGETS="all"
412 + linux-mod_src_compile
413 +}
414 +
415 +src_install() {
416 + emake DESTDIR="${D}" install
417 + emake -C drivers DESTDIR="${D}" install
418 +
419 + newinitd "${FILESDIR}"/lircd-0.8.6-r2 lircd
420 + newinitd "${FILESDIR}"/lircmd lircmd
421 + newconfd "${FILESDIR}"/lircd.conf.4 lircd
422 +
423 + insinto /etc/modprobe.d/
424 + newins "${FILESDIR}"/modprobed.lirc lirc.conf
425 +
426 + newinitd "${FILESDIR}"/irexec-initd-0.8.6-r2 irexec
427 + newconfd "${FILESDIR}"/irexec-confd irexec
428 +
429 + systemd_dounit "${FILESDIR}"/irexec.service
430 + systemd_dounit "${FILESDIR}"/lirc.service
431 + systemd_dounit "${FILESDIR}"/lircm.service
432 +
433 + if use doc ; then
434 + dohtml doc/html/*.html
435 + insinto /usr/share/doc/${PF}/images
436 + doins doc/images/*
437 + fi
438 +
439 + insinto /usr/share/lirc/remotes
440 + doins -r remotes/*
441 +
442 + keepdir /etc/lirc
443 + if [[ -e "${D}"/etc/lirc/lircd.conf ]]; then
444 + newdoc "${D}"/etc/lirc/lircd.conf lircd.conf.example
445 + fi
446 +
447 + use static-libs || rm "${D}/usr/$(get_libdir)/liblirc_client.la"
448 +}
449 +
450 +pkg_preinst() {
451 + linux-mod_pkg_preinst
452 +
453 + local dir="${EROOT}/etc/modprobe.d"
454 + if [[ -a "${dir}"/lirc && ! -a "${dir}"/lirc.conf ]]; then
455 + elog "Renaming ${dir}/lirc to lirc.conf"
456 + mv -f "${dir}/lirc" "${dir}/lirc.conf"
457 + fi
458 +
459 + # copy the first file that can be found
460 + if [[ -f "${EROOT}"/etc/lirc/lircd.conf ]]; then
461 + cp "${EROOT}"/etc/lirc/lircd.conf "${T}"/lircd.conf
462 + elif [[ -f "${EROOT}"/etc/lircd.conf ]]; then
463 + cp "${EROOT}"/etc/lircd.conf "${T}"/lircd.conf
464 + MOVE_OLD_LIRCD_CONF=1
465 + elif [[ -f "${D}"/etc/lirc/lircd.conf ]]; then
466 + cp "${D}"/etc/lirc/lircd.conf "${T}"/lircd.conf
467 + fi
468 +
469 + # stop portage from touching the config file
470 + if [[ -e "${D}"/etc/lirc/lircd.conf ]]; then
471 + rm -f "${D}"/etc/lirc/lircd.conf
472 + fi
473 +}
474 +
475 +pkg_postinst() {
476 + linux-mod_pkg_postinst
477 +
478 + # copy config file to new location
479 + # without portage knowing about it
480 + # so it will not delete it on unmerge or ever touch it again
481 + if [[ -e "${T}"/lircd.conf ]]; then
482 + cp "${T}"/lircd.conf "${EROOT}"/etc/lirc/lircd.conf
483 + if [[ "$MOVE_OLD_LIRCD_CONF" = "1" ]]; then
484 + elog "Moved /etc/lircd.conf to /etc/lirc/lircd.conf"
485 + rm -f "${EROOT}"/etc/lircd.conf
486 + fi
487 + fi
488 +
489 + einfo "The new default location for lircd.conf is inside of"
490 + einfo "/etc/lirc/ directory"
491 +}