lirc-0.8.6-r3

Published: 24.02.2010

Software for decoding and sending infra-red signals of many commonly used remote controls.

Project homepage: Lirc

This is ebuild for lirc package. This version was not available in main portage at moment I was committing this ebuild to my svn.

This ebuild was taken from this bug report.

I'm using this ebuild, because I was experiencing problems with the one from the main portage tree. The lirc service had problems with unloading during system shutdown. The other problem was with accessing the lirc device. Sometimes after system boot up the lirc device wasn't properly recognized by KDE. This was very weird behavior. After upgrading to this version both problems are for me.

To use this ebuild run following commands in terminal:

echo "=app-misc/lirc-0.8.6-r3" >> /etc/portage/package.keywords 
emerge -av =app-misc/lirc-0.8.6-r3

View the source of the ebuild
  1. # Copyright 1999-2009 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/lirc-0.8.6-r2.ebuild,v 1.1 2009/11/15 10:04:21 zzam Exp $
  4.  
  5. inherit eutils linux-mod flag-o-matic autotools
  6.  
  7. DESCRIPTION="decode and send infra-red signals of many commonly used remote controls"
  8. HOMEPAGE="http://www.lirc.org/"
  9.  
  10. MY_P=${PN}-${PV/_/}
  11.  
  12. if [[ "${PV/_pre/}" = "${PV}" ]]; then
  13. SRC_URI="mirror://sourceforge/lirc/${MY_P}.tar.bz2"
  14. else
  15. SRC_URI="http://www.lirc.org/software/snapshots/${MY_P}.tar.bz2"
  16. fi
  17.  
  18. LICENSE="GPL-2"
  19. SLOT="0"
  20. KEYWORDS="~amd64 ~x86"
  21. IUSE="debug doc X hardware-carrier transmitter"
  22.  
  23. S="${WORKDIR}/${MY_P}"
  24.  
  25. RDEPEND="
  26. X? (
  27. x11-libs/libX11
  28. x11-libs/libSM
  29. x11-libs/libICE
  30. )
  31. lirc_devices_alsa_usb? ( media-libs/alsa-lib )
  32. lirc_devices_audio? ( >media-libs/portaudio-18 )
  33. lirc_devices_irman? ( media-libs/libirman )"
  34.  
  35. # This are drivers with names matching the
  36. # parameter --with-driver=NAME
  37. IUSE_LIRC_DEVICES_DIRECT="
  38. all userspace accent act200l act220l
  39. adaptec alsa_usb animax asusdh atilibusb
  40. atiusb audio audio_alsa avermedia avermedia_vdomate
  41. avermedia98 awlibusb bestbuy bestbuy2 breakoutbox
  42. bte bw6130 caraca chronos commandir
  43. cph06x creative creative_infracd
  44. devinput digimatrix dsp dvico ea65 ene0100
  45. exaudio flyvideo ftdi gvbctv5pci hauppauge
  46. hauppauge_dvb hercules_smarttv_stereo i2cuser
  47. igorplugusb iguanaIR imon imon_24g imon_knob
  48. imon_lcd imon_pad imon_rsc irdeo irdeo_remote
  49. irlink irman irreal it87 ite8709
  50. knc_one kworld leadtek_0007 leadtek_0010
  51. leadtek_pvr2000 livedrive_midi
  52. livedrive_seq logitech macmini mceusb
  53. mediafocusI mouseremote
  54. mouseremote_ps2 mp3anywhere mplay nslu2
  55. packard_bell parallel pcmak pcmak_usb
  56. pctv pixelview_bt878 pixelview_pak
  57. pixelview_pro provideo realmagic
  58. remotemaster sa1100 samsung sasem sb0540 serial
  59. silitek sir slinke streamzap tekram
  60. tekram_bt829 tira ttusbir tuxbox tvbox udp uirt2
  61. uirt2_raw usb_uirt_raw usbx wpc8769l"
  62.  
  63. # drivers that need special handling and
  64. # must have another name specified for
  65. # parameter --with-driver=NAME
  66. IUSE_LIRC_DEVICES_SPECIAL="
  67. serial_igor_cesko
  68. remote_wonder_plus xboxusb usbirboy inputlirc"
  69.  
  70. IUSE_LIRC_DEVICES="${IUSE_LIRC_DEVICES_DIRECT} ${IUSE_LIRC_DEVICES_SPECIAL}"
  71.  
  72. #device-driver which use libusb
  73. LIBUSB_USED_BY_DEV="
  74. all atilibusb awlibusb sasem igorplugusb imon imon_lcd imon_pad
  75. imon_rsc streamzap mceusb xboxusb irlink commandir"
  76.  
  77. for dev in ${LIBUSB_USED_BY_DEV}; do
  78. DEPEND="${DEPEND} lirc_devices_${dev}? ( dev-libs/libusb )"
  79. done
  80.  
  81. # adding only compile-time depends
  82. DEPEND="${RDEPEND} ${DEPEND}
  83. virtual/linux-sources
  84. lirc_devices_ftdi? ( dev-embedded/libftdi )
  85. lirc_devices_all? ( dev-embedded/libftdi )"
  86.  
  87. # adding only run-time depends
  88. RDEPEND="${RDEPEND}
  89. lirc_devices_usbirboy? ( app-misc/usbirboy )
  90. lirc_devices_inputlirc? ( app-misc/inputlircd )
  91. lirc_devices_iguanaIR? ( app-misc/iguanaIR )"
  92.  
  93. # add all devices to IUSE
  94. for dev in ${IUSE_LIRC_DEVICES}; do
  95. IUSE="${IUSE} lirc_devices_${dev}"
  96. done
  97.  
  98. add_device() {
  99. : ${lirc_device_count:=0}
  100. ((lirc_device_count++))
  101.  
  102. if [[ ${lirc_device_count} -eq 2 ]]; then
  103. ewarn
  104. ewarn "When selecting multiple devices for lirc to be supported,"
  105. ewarn "it can not be guaranteed that the drivers play nice together."
  106. ewarn
  107. ewarn "If this is not intended, then abort emerge now with Ctrl-C,"
  108. ewarn "Set LIRC_DEVICES and restart emerge."
  109. ewarn
  110. epause
  111. fi
  112.  
  113. local dev="${1}"
  114. local desc="device ${dev}"
  115. if [[ -n "${2}" ]]; then
  116. desc="${2}"
  117. fi
  118.  
  119. elog "Compiling support for ${desc}"
  120. MY_OPTS="${MY_OPTS} --with-driver=${dev}"
  121. }
  122.  
  123. pkg_setup() {
  124.  
  125. if use lirc_devices_mceusb2
  126. then
  127. ewarn "The mceusb2 driver has been merged into the mceusb."
  128. ewarn "Please only use the latter now."
  129. fi
  130.  
  131. ewarn "If your LIRC device requires modules, you'll need MODULE_UNLOAD"
  132. ewarn "support in your kernel."
  133.  
  134. linux-mod_pkg_setup
  135.  
  136. # set default configure options
  137. MY_OPTS=""
  138. LIRC_DRIVER_DEVICE="/dev/lirc0"
  139.  
  140. if use lirc_devices_all; then
  141. # compile in drivers for a lot of devices
  142. add_device all "a lot of devices"
  143. else
  144. # compile in only requested drivers
  145. local dev
  146. for dev in ${IUSE_LIRC_DEVICES_DIRECT}; do
  147. if use lirc_devices_${dev}; then
  148. add_device ${dev}
  149. fi
  150. done
  151.  
  152. if use lirc_devices_remote_wonder_plus; then
  153. add_device atiusb "device Remote Wonder Plus (atiusb-based)"
  154. fi
  155.  
  156. if use lirc_devices_serial_igor_cesko; then
  157. add_device serial "serial with Igor Cesko design"
  158. MY_OPTS="${MY_OPTS} --with-igor"
  159. fi
  160.  
  161. if use lirc_devices_imon_pad; then
  162. ewarn "The imon_pad driver has incorporated the previous pad2keys patch"
  163. ewarn "and removed the pad2keys_active option for the lirc_imon module"
  164. ewarn "because it is always active."
  165. ewarn "If you have an older imon VFD device, you may need to add the module"
  166. ewarn "option display_type=1 to override autodetection and force VFD mode."
  167. fi
  168.  
  169. if use lirc_devices_xboxusb; then
  170. add_device atiusb "device xboxusb"
  171. fi
  172.  
  173. if use lirc_devices_usbirboy; then
  174. add_device userspace "device usbirboy"
  175. LIRC_DRIVER_DEVICE="/dev/usbirboy"
  176. fi
  177.  
  178. if [[ "${MY_OPTS}" == "" ]]; then
  179. if [[ "${PROFILE_ARCH}" == "xbox" ]]; then
  180. # on xbox: use special driver
  181. add_device atiusb "device xboxusb"
  182. else
  183. # no driver requested
  184. elog
  185. elog "Compiling only the lirc-applications, but no drivers."
  186. elog "Enable drivers with LIRC_DEVICES if you need them."
  187. MY_OPTS="--with-driver=none"
  188. fi
  189. fi
  190. fi
  191.  
  192. use hardware-carrier && MY_OPTS="${MY_OPTS} --without-soft-carrier"
  193. use transmitter && MY_OPTS="${MY_OPTS} --with-transmitter"
  194.  
  195. if [[ -n "${LIRC_OPTS}" ]] ; then
  196. ewarn
  197. ewarn "LIRC_OPTS is deprecated from lirc-0.8.0-r1 on."
  198. ewarn
  199. ewarn "Please use LIRC_DEVICES from now on."
  200. ewarn "e.g. LIRC_DEVICES=\"serial sir\""
  201. ewarn
  202. ewarn "Flags are now set per use-flags."
  203. ewarn "e.g. transmitter, hardware-carrier"
  204.  
  205. local opt
  206. local unsupported_opts=""
  207.  
  208. # test for allowed options for LIRC_OPTS
  209. for opt in ${LIRC_OPTS}; do
  210. case ${opt} in
  211. --with-port=*|--with-irq=*|--with-timer=*|--with-tty=*)
  212. MY_OPTS="${MY_OPTS} ${opt}"
  213. ;;
  214. *)
  215. unsupported_opts="${unsupported_opts} ${opt}"
  216. ;;
  217. esac
  218. done
  219. if [[ -n ${unsupported_opts} ]]; then
  220. ewarn "These options are no longer allowed to be set"
  221. ewarn "with LIRC_OPTS: ${unsupported_opts}"
  222. die "LIRC_OPTS is no longer recommended."
  223. fi
  224. fi
  225.  
  226. # Setup parameter for linux-mod.eclass
  227. MODULE_NAMES="lirc(misc:${S})"
  228. BUILD_TARGETS="all"
  229.  
  230. ECONF_PARAMS=" --localstatedir=/var
  231. --with-syslog=LOG_DAEMON
  232. --enable-sandboxed
  233. --with-kerneldir=${KV_DIR}
  234. --with-moduledir=/lib/modules/${KV_FULL}/misc
  235. $(use_enable debug)
  236. $(use_with X x)
  237. ${MY_OPTS}"
  238.  
  239. einfo
  240. einfo "lirc-configure-opts: ${MY_OPTS}"
  241. elog "Setting default lirc-device to ${LIRC_DRIVER_DEVICE}"
  242.  
  243. filter-flags -Wl,-O1
  244.  
  245. # force non-parallel make, Bug 196134
  246. MAKEOPTS="${MAKEOPTS} -j1"
  247. }
  248.  
  249. src_unpack() {
  250. unpack ${A}
  251. cd "${S}"
  252.  
  253. # Rip out dos CRLF
  254. edos2unix contrib/lirc.rules
  255.  
  256. # Apply patches needed for some special device-types
  257. use lirc_devices_audio || epatch "${FILESDIR}"/lirc-0.8.4-portaudio_check.patch
  258. use lirc_devices_remote_wonder_plus && epatch "${FILESDIR}"/lirc-0.8.3_pre1-remotewonderplus.patch
  259.  
  260. # remove parallel driver on SMP systems
  261. if linux_chkconfig_present SMP ; then
  262. sed -i -e "s:lirc_parallel\.o::" drivers/lirc_parallel/Makefile.am
  263. fi
  264.  
  265. # Bug #187418
  266. if kernel_is ge 2 6 22 ; then
  267. ewarn "Disabling lirc_gpio driver as it does no longer work Kernel 2.6.22+"
  268. sed -i -e "s:lirc_gpio\.o::" drivers/lirc_gpio/Makefile.am
  269. fi
  270.  
  271. # Apply patch from upsrtream version 1.70 to 1.71
  272. epatch "${FILESDIR}"/lirc_i2c_r1.70_to_r1.72.patch
  273.  
  274. # respect CFLAGS
  275. sed -i -e 's:CFLAGS="-O2:CFLAGS=""\n#CFLAGS="-O2:' configure.ac
  276.  
  277. # setting default device-node
  278. local f
  279. for f in configure.ac acconfig.h; do
  280. [[ -f "$f" ]] && sed -i -e '/#define LIRC_DRIVER_DEVICE/d' "$f"
  281. done
  282. echo "#define LIRC_DRIVER_DEVICE \"${LIRC_DRIVER_DEVICE}\"" >> acconfig.h
  283.  
  284. eautoreconf
  285. }
  286.  
  287. src_install() {
  288. emake DESTDIR="${D}" install || die "emake install failed"
  289.  
  290. newinitd "${FILESDIR}"/lircd-0.8.6 lircd
  291. newinitd "${FILESDIR}"/lircmd lircmd
  292. newconfd "${FILESDIR}"/lircd.conf.2 lircd
  293.  
  294. insinto /etc/modprobe.d/
  295. newins "${FILESDIR}"/modprobed.lirc lirc.conf
  296.  
  297. newinitd "${FILESDIR}"/irexec-initd-0.8.6-r2 irexec
  298. newconfd "${FILESDIR}"/irexec-confd irexec
  299.  
  300. if use doc ; then
  301. dohtml doc/html/*.html
  302. insinto /usr/share/doc/${PF}/images
  303. doins doc/images/*
  304. fi
  305.  
  306. insinto /usr/share/lirc/remotes
  307. doins -r remotes/*
  308.  
  309. keepdir /var/run/lirc /etc/lirc
  310. if [[ -e "${D}"/etc/lirc/lircd.conf ]]; then
  311. newdoc "${D}"/etc/lirc/lircd.conf lircd.conf.example
  312. fi
  313. }
  314.  
  315. pkg_preinst() {
  316. linux-mod_pkg_preinst
  317.  
  318. local dir="${ROOT}/etc/modprobe.d"
  319. if [[ -a "${dir}"/lirc && ! -a "${dir}"/lirc.conf ]]; then
  320. elog "Renaming ${dir}/lirc to lirc.conf"
  321. mv -f "${dir}/lirc" "${dir}/lirc.conf"
  322. fi
  323.  
  324. # copy the first file that can be found
  325. if [[ -f "${ROOT}"/etc/lirc/lircd.conf ]]; then
  326. cp "${ROOT}"/etc/lirc/lircd.conf "${T}"/lircd.conf
  327. elif [[ -f "${ROOT}"/etc/lircd.conf ]]; then
  328. cp "${ROOT}"/etc/lircd.conf "${T}"/lircd.conf
  329. MOVE_OLD_LIRCD_CONF=1
  330. elif [[ -f "${D}"/etc/lirc/lircd.conf ]]; then
  331. cp "${D}"/etc/lirc/lircd.conf "${T}"/lircd.conf
  332. fi
  333.  
  334. # stop portage from touching the config file
  335. if [[ -e "${D}"/etc/lirc/lircd.conf ]]; then
  336. rm -f "${D}"/etc/lirc/lircd.conf
  337. fi
  338. }
  339.  
  340. pkg_postinst() {
  341. linux-mod_pkg_postinst
  342.  
  343. # copy config file to new location
  344. # without portage knowing about it
  345. # so it will not delete it on unmerge or ever touch it again
  346. if [[ -e "${T}"/lircd.conf ]]; then
  347. cp "${T}"/lircd.conf "${ROOT}"/etc/lirc/lircd.conf
  348. if [[ "$MOVE_OLD_LIRCD_CONF" = "1" ]]; then
  349. elog "Moved /etc/lircd.conf to /etc/lirc/lircd.conf"
  350. rm -f "${ROOT}"/etc/lircd.conf
  351. fi
  352. fi
  353.  
  354. ewarn
  355. ewarn "The lirc_gpio driver will not work with Kernels 2.6.22+"
  356. ewarn "You need to switch over to /dev/input/event? if you need gpio"
  357. ewarn "This device can than then be used via lirc's dev/input driver."
  358. ewarn
  359. ewarn "The new default location for lircd.conf is inside of"
  360. ewarn "/etc/lirc/ directory"
  361.  
  362. }

Here is the list of all the lirc ebuild versions that are available in my overlay:



Comments

If you have found something wrong with the information provided above or maybe you just want to speak your mind about it, feel free to leave a comment.
All comments will show up on page after being approved. Sorry for such policy but I want to make sure that my site will be free of abusive or vulgar content. I don't mind being criticized just do it using right words.

Leave a comment