1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit eutils flag-o-matic systemd
9 DESCRIPTION="decode and send infra-red signals of many commonly used remote controls"
10 HOMEPAGE="http://www.lirc.org/"
12 LIRC_DRIVER_DEVICE="/dev/lirc0"
16 if [[ "${PV/_pre/}" = "${PV}" ]]; then
17 SRC_URI="mirror://sourceforge/lirc/${MY_P}.tar.bz2"
19 SRC_URI="http://www.lirc.org/software/snapshots/${MY_P}.tar.bz2"
24 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
25 IUSE="doc static-libs X audio irman ftdi inputlirc iguanair systemd usb"
27 S="${WORKDIR}/${MY_P}"
33 doc? ( app-doc/doxygen )
42 systemd? ( sys-apps/systemd )
44 >media-libs/portaudio-18
47 irman? ( media-libs/libirman )
48 iguanair? ( app-misc/iguanaIR )
49 ftdi? ( dev-embedded/libftdi:0 )
50 inputlirc? ( app-misc/inputlircd )
51 usb? ( virtual/libusb:0 )
55 "${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/
61 --localstatedir=/var \
62 $(use_enable static-libs static) \
66 # Defined src_compile as a workaround for a parallel make issue
67 # See https://bugs.gentoo.org/show_bug.cgi?id=588864
68 # and https://sourceforge.net/p/lirc/tickets/210/
77 newinitd "${FILESDIR}"/lircd-0.8.6-r2 lircd
78 newinitd "${FILESDIR}"/lircmd-0.9.4a-r2 lircmd
79 newconfd "${FILESDIR}"/lircd.conf.4 lircd
80 newconfd "${FILESDIR}"/lircmd.conf lircmd
82 insinto /etc/modprobe.d/
83 newins "${FILESDIR}"/modprobed.lirc lirc.conf
85 newinitd "${FILESDIR}"/irexec-initd-0.9.4a-r2 irexec
86 newconfd "${FILESDIR}"/irexec-confd irexec
89 if [[ -e "${D}"/etc/lirc/lircd.conf ]]; then
90 newdoc "${D}"/etc/lirc/lircd.conf lircd.conf.example
93 find "${D}" -name '*.la' -delete || die
96 rm -d "${D}"/var/run/lirc || die
97 rm -d "${D}"/var/run || die
101 local dir="${EROOT}/etc/modprobe.d"
102 if [[ -a "${dir}"/lirc && ! -a "${dir}"/lirc.conf ]]; then
103 elog "Renaming ${dir}/lirc to lirc.conf"
104 mv -f "${dir}/lirc" "${dir}/lirc.conf" || die
107 # copy the first file that can be found
108 if [[ -f "${EROOT}"/etc/lirc/lircd.conf ]]; then
109 cp "${EROOT}"/etc/lirc/lircd.conf "${T}"/lircd.conf || die
110 elif [[ -f "${EROOT}"/etc/lircd.conf ]]; then
111 cp "${EROOT}"/etc/lircd.conf "${T}"/lircd.conf || die
112 MOVE_OLD_LIRCD_CONF=1
113 elif [[ -f "${D}"/etc/lirc/lircd.conf ]]; then
114 cp "${D}"/etc/lirc/lircd.conf "${T}"/lircd.conf || die
117 # stop portage from touching the config file
118 if [[ -e "${D}"/etc/lirc/lircd.conf ]]; then
119 rm -f "${D}"/etc/lirc/lircd.conf || die
124 # copy config file to new location
125 # without portage knowing about it
126 # so it will not delete it on unmerge or ever touch it again
127 if [[ -e "${T}"/lircd.conf ]]; then
128 cp "${T}"/lircd.conf "${EROOT}"/etc/lirc/lircd.conf || die
129 if [[ "$MOVE_OLD_LIRCD_CONF" = "1" ]]; then
130 elog "Moved /etc/lircd.conf to /etc/lirc/lircd.conf"
131 rm -f "${EROOT}"/etc/lircd.conf || die
135 einfo "The new default location for lircd.conf is inside of"
136 einfo "/etc/lirc/ directory"