I2C patch to build against gentoo-sources-2.6.32, bug 296739; Add localmount, modules...
authorSteve Dibb <beandog@gentoo.org>
Fri, 21 May 2010 02:32:36 +0000 (02:32 +0000)
committerSteve Dibb <beandog@gentoo.org>
Fri, 21 May 2010 02:32:36 +0000 (02:32 +0000)
Package-Manager: portage-2.1.8.3/cvs/Linux x86_64

app-misc/lirc/ChangeLog
app-misc/lirc/Manifest
app-misc/lirc/files/lirc-0.8.6-i2c.patch [new file with mode: 0644]
app-misc/lirc/files/lirc-0.8.6-send-evsyn.diff [new file with mode: 0644]
app-misc/lirc/files/lircd-0.8.6
app-misc/lirc/lirc-0.8.6-r3.ebuild [new file with mode: 0644]

index 89bb91bf3b0ea4f075c6c983705df09849c97b94..c373fedb5b85f1cce35aaa291625f3b3a257d10f 100644 (file)
@@ -1,6 +1,15 @@
 # ChangeLog for app-misc/lirc
 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/ChangeLog,v 1.214 2010/05/21 02:02:25 beandog Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/ChangeLog,v 1.215 2010/05/21 02:32:35 beandog Exp $
+
+*lirc-0.8.6-r3 (21 May 2010)
+
+  21 May 2010; Steve Dibb <beandog@gentoo.org> files/lircd-0.8.6,
+  +lirc-0.8.6-r3.ebuild, +files/lirc-0.8.6-i2c.patch,
+  +files/lirc-0.8.6-send-evsyn.diff:
+  I2C patch to build against gentoo-sources-2.6.32, bug 296739; Add
+  localmount, modules to startup init, bug 314545; evdev input patch, bug
+  299030
 
   21 May 2010; Steve Dibb <beandog@gentoo.org> files/lircd.conf.2:
   Typo in conf.d sample, bug 301346
index 1b9b773ef9451ae553170718f04442347f19499d..4b8f346820453352bbd3d4f545380ef0983400ff 100644 (file)
@@ -10,9 +10,11 @@ AUX lirc-0.8.3_pre1-kernel-2.6.24.diff 3140 RMD160 ad09e63973827b180530c63a6c49c
 AUX lirc-0.8.3_pre1-remotewonderplus.patch 943 RMD160 05a0696d51ff01c7d9644ad3ff4d56fef20be439 SHA1 971ad8b27d57c31439a1f7fb87dac2dc39d6c1e8 SHA256 547efbfa30f282ba9100495044e3b720c8f74c44f9a4e34db934d2ac7976fe29
 AUX lirc-0.8.3_pre3-imon-pad2keys.patch 11556 RMD160 96137f08691e341844d7ebc860337e1b6e4baf25 SHA1 885ac9bbcc73e0f815c9e3eb867b36e335eeb52f SHA256 7ce01a1fe0dd2021b9dcf1d3c764d5a4704aab33cd616d92f1ff401f31d17d3f
 AUX lirc-0.8.4-portaudio_check.patch 769 RMD160 d83b1a167da5b0c4e09ef716a4fc80f7261f7665 SHA1 81537dc12f897756d24fcf2cf4d178dc8169e360 SHA256 01e2034aaa6a7eb039e5c0e6c3b4a6ed38860614d3d0b0005d99a4aac2b3827e
+AUX lirc-0.8.6-i2c.patch 2296 RMD160 a16bd7c5b264788ead8531413e6dcba5fd38ceae SHA1 bac5e7a36457830ad4ed4bf547bb7f54cc94d86d SHA256 af5cb16859a5057e35a1c3bad4c5a9a0c81365b545548f93d0e4872d6bf708bd
+AUX lirc-0.8.6-send-evsyn.diff 563 RMD160 9f0e43f296c103f43445fbd6bbbc61492ab1f346 SHA1 7c704c46eb80eececfbb15a0a23f88773f6225a0 SHA256 26c442281253732b0fda80168893f2bef90c4684edeb902bf52faca680bde0c7
 AUX lircd 450 RMD160 73cf3057f420632e90e80eeb30e79cdbb3390b5d SHA1 e43d500a672bf89b7dc5e6bdedc9ed8e90dac3b3 SHA256 a9d6d2cc0abd0efe3267c1477fac012378e63e26aa021cfce7a0e25b27f196df
 AUX lircd-0.8.3 581 RMD160 162a54bb19df7b97aa982355a6d009ddc82580eb SHA1 c0f7a0a65169d02bdc7003d574d8610694241a5d SHA256 9ba3c5a8c0ca5966729dc5e2c7a5960bbf12b443d91e9e319a0277f153df1b1f
-AUX lircd-0.8.6 941 RMD160 e26898ef4660b2a23cad190e224270181900181a SHA1 ee2f5422f259b4ee486baa1ae88019948fed5a40 SHA256 753957bc06a851388c71b6c98ec3463e61a26308c8643ed8c0257cb1757efdae
+AUX lircd-0.8.6 973 RMD160 4e8a04b8d052558a91e8278589cc04d70f164a0d SHA1 e333b816a396e4005bdafce2b77501098fbcec5a SHA256 473cf04b2f6addf7c86d23103b1eff68bf3758fda2bf25401ff0631c568c7805
 AUX lircd.conf.2 317 RMD160 dbd600cb97ce10ba06e29e32fe5d3eac6cf19a7d SHA1 054bde131b965e2fea8599accbf69fc489cb66e8 SHA256 694d96ffc0c5b8d258592d89c0221aa9b10d69ce024a69a0cc935d899e0b855e
 AUX lircmd 466 RMD160 32f2b2411afc60522944f5c3dff9f53aac242a9c SHA1 79939de790d20704009643bd810e3186090d0e36 SHA256 d47f22a33a83c14a4a0c333d6a445c40e550c491899fb0c6d323e23fe1eac7b7
 AUX modprobed.lirc 549 RMD160 89edfd587932959df9e521d146cef7c67cf97b18 SHA1 f59d8f031859eb6b6dccd1faf15d7ed2251288b1 SHA256 b4951252321ea326d3ec401e5ff1112716c5aaf5b2ca94d9f5e187e22ad35c44
@@ -31,5 +33,6 @@ EBUILD lirc-0.8.4a.ebuild 9136 RMD160 cbf9c0b69fadb9fd113d4be6fe766a1a52810939 S
 EBUILD lirc-0.8.5.ebuild 9412 RMD160 f783b4d3e53f7f68b63627d2bbec709e40f11334 SHA1 5074ad15f3f746a64e0ec47c3ec0e164ed50a4fa SHA256 281e7e312963e88d00330abb375fb154fac18172ab5ea66a159d46c099341a6b
 EBUILD lirc-0.8.6-r1.ebuild 10083 RMD160 9cacd5df5e4ee5659da7b0f2c4826780b4b4f9df SHA1 fd4df404550e0c2d75404c67d1cdb58a5484cf36 SHA256 c1629136d1f937c9c233d9009ff26cf0370bf32eaf71097dd61e481f584cebd0
 EBUILD lirc-0.8.6-r2.ebuild 10101 RMD160 b4c9cf29b93b3cdf28dbaf86fd9aa4e45636d9f2 SHA1 8640054c3821180e2339c017adb7323298c80ad3 SHA256 146c3c6b3bedb8c5fbe7dcfa9b2e1007a866e836775fb0edb8eb3fb3299c9ae8
-MISC ChangeLog 34902 RMD160 20fdd49c4795fdac41218efb6f2b1bdafd896a25 SHA1 5a44f63c1a1f20a25d3ae3f1230bb7a263c277a5 SHA256 d53fd57482f14e16d88d54fbca1b0377e7e1fb006ba6890dd8043fd096e1aa62
+EBUILD lirc-0.8.6-r3.ebuild 10244 RMD160 9683e1da67e687a74d063d68b6f1326052d510d8 SHA1 dbf05ce225e7ddad9c71aa16d46ebebd52c091f0 SHA256 d1b9b4307edee1749736edc42e47dea4cb3d89829c996ef11cf26aa9687dd3d0
+MISC ChangeLog 35241 RMD160 f60b5519b1f02e9d751fe9b87560d859b981954a SHA1 a4b3c503a46a167fd98e809697c022580b2f44dd SHA256 72404def6131ca71fdd5dec321247a592d56c5384db5b20562e424c0caf3e219
 MISC metadata.xml 376 RMD160 7b854dad1999c38592eabe928aab80615ba1f1e5 SHA1 17dc9c9591c77aa4ec2d98b9bc1f34ff68da31ad SHA256 e3b4637a67a93eb4b9457fa5941e8a6a891adca11a1ebc80c21a59650eac93aa
diff --git a/app-misc/lirc/files/lirc-0.8.6-i2c.patch b/app-misc/lirc/files/lirc-0.8.6-i2c.patch
new file mode 100644 (file)
index 0000000..933fabc
--- /dev/null
@@ -0,0 +1,77 @@
+--- drivers/lirc_i2c/lirc_i2c.c        2009/08/30 16:59:53     1.70
++++ drivers/lirc_i2c/lirc_i2c.c        2009/12/28 15:29:03     1.72
+@@ -1,4 +1,4 @@
+-/*      $Id: lirc-0.8.6-i2c.patch,v 1.1 2010/05/21 02:32:36 beandog Exp $      */
++/*      $Id: lirc-0.8.6-i2c.patch,v 1.1 2010/05/21 02:32:36 beandog Exp $      */
+ 
+ /*
+  * lirc_i2c.c
+@@ -399,8 +399,8 @@
+               .name   = "i2c ir driver",
+       },
+ #endif
+-      .id             = I2C_DRIVERID_EXP3, /* FIXME */
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
++      .id             = I2C_DRIVERID_EXP3, /* FIXME */
+       .attach_adapter = ir_probe,
+       .detach_client  = ir_remove,
+ #else
+@@ -492,20 +492,23 @@
+               ir->l.add_to_buf = add_to_buf_pv951;
+               break;
+       case 0x71:
+-#ifdef I2C_HW_B_CX2341X
+-              if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848) ||
+-                  adap->id == (I2C_ALGO_BIT | I2C_HW_B_CX2341X)) {
+-#else
+-              if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848)) {
++
++
++
++#ifdef I2C_HW_B_CX2388x
++              /* Leadtek Winfast PVR2000 or Hauppauge HVR-1300 */
++              if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_CX2388x))
++                      strlcpy(ir->c.name, "Hauppauge HVR1300", I2C_NAME_SIZE);
++              else
+ #endif
++              {
+                       /*
+                        * The PVR150 IR receiver uses the same protocol as
+                        * other Hauppauge cards, but the data flow is
+                        * different, so we need to deal with it by its own.
+                        */
+                       strlcpy(ir->c.name, "Hauppauge PVR150", I2C_NAME_SIZE);
+-              } else /* I2C_HW_B_CX2388x */
+-                      strlcpy(ir->c.name, "Hauppauge HVR1300", I2C_NAME_SIZE);
++              }
+               ir->l.code_length = 13;
+               ir->l.add_to_buf = add_to_buf_haup_pvr150;
+               break;
+@@ -516,19 +519,18 @@
+               break;
+       case 0x18:
+       case 0x1a:
+-#ifdef I2C_HW_B_CX2341X
+-              if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848) ||
+-                  adap->id == (I2C_ALGO_BIT | I2C_HW_B_CX2341X)) {
++#ifdef I2C_HW_B_CX2388x
++              if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_CX2388x)) {
++                      strlcpy(ir->c.name, "Leadtek IR", I2C_NAME_SIZE);
++                      ir->l.code_length = 8;
++                      ir->l.add_to_buf = add_to_buf_pvr2000;
++              } else {
+ #else
+-              if (adap->id == (I2C_ALGO_BIT | I2C_HW_B_BT848)) {
++              {
+ #endif
+                       strlcpy(ir->c.name, "Hauppauge IR", I2C_NAME_SIZE);
+                       ir->l.code_length = 13;
+                       ir->l.add_to_buf = add_to_buf_haup;
+-              } else { /* I2C_HW_B_CX2388x */
+-                      strlcpy(ir->c.name, "Leadtek IR", I2C_NAME_SIZE);
+-                      ir->l.code_length = 8;
+-                      ir->l.add_to_buf = add_to_buf_pvr2000;
+               }
+               break;
+       case 0x30:
+
diff --git a/app-misc/lirc/files/lirc-0.8.6-send-evsyn.diff b/app-misc/lirc/files/lirc-0.8.6-send-evsyn.diff
new file mode 100644 (file)
index 0000000..a7583ac
--- /dev/null
@@ -0,0 +1,20 @@
+--- daemons/lircd.c.old        2009-12-30 14:37:13.000000000 -0600
++++ daemons/lircd.c    2009-12-30 14:39:42.000000000 -0600
+@@ -1909,6 +1909,17 @@
+                               logprintf(LOG_ERR, "writing to uinput failed");
+                               logperror(LOG_ERR, NULL);
+                       }
++
++                      /* Need to write sync event */
++                      memset(&event, 0, sizeof(event));
++                      event.type = EV_SYN;
++                      event.code = SYN_REPORT;
++                      event.value = 0;
++                      if(write(uinputfd, &event, sizeof(event)) != sizeof(event))
++                      {
++                              logprintf(LOG_ERR, "writing EV_SYN to uinput failed");
++                              logperror(LOG_ERR, NULL);
++                      }
+               }
+       }
+ #endif
index 0a775a5e4b2e03d1869ec80f07e6a9a403ee88d1..dbf7a4797955f25c1c3989ac5eb3d37288f35d24 100644 (file)
@@ -1,13 +1,15 @@
 #!/sbin/runscript
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/files/lircd-0.8.6,v 1.1 2009/10/04 18:48:29 fauli Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/files/lircd-0.8.6,v 1.2 2010/05/21 02:32:36 beandog Exp $
 
 PIDFILE=/var/run/lirc/${SVCNAME}.pid
 LIRCD_SYMLINKFILE=/dev/lircd
 LIRCD_SOCKET=/var/run/lirc/lircd
 
 depend() {
+       need localmount
+       use modules
        provide lirc
 }
 
diff --git a/app-misc/lirc/lirc-0.8.6-r3.ebuild b/app-misc/lirc/lirc-0.8.6-r3.ebuild
new file mode 100644 (file)
index 0000000..961cee8
--- /dev/null
@@ -0,0 +1,365 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-misc/lirc/lirc-0.8.6-r3.ebuild,v 1.1 2010/05/21 02:32:35 beandog Exp $
+
+inherit eutils linux-mod flag-o-matic autotools
+
+DESCRIPTION="decode and send infra-red signals of many commonly used remote controls"
+HOMEPAGE="http://www.lirc.org/"
+
+MY_P=${PN}-${PV/_/}
+
+if [[ "${PV/_pre/}" = "${PV}" ]]; then
+       SRC_URI="mirror://sourceforge/lirc/${MY_P}.tar.bz2"
+else
+       SRC_URI="http://www.lirc.org/software/snapshots/${MY_P}.tar.bz2"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+IUSE="debug doc X hardware-carrier transmitter"
+
+S="${WORKDIR}/${MY_P}"
+
+RDEPEND="
+       X? (
+               x11-libs/libX11
+               x11-libs/libSM
+               x11-libs/libICE
+       )
+       lirc_devices_alsa_usb? ( media-libs/alsa-lib )
+       lirc_devices_audio? ( >media-libs/portaudio-18 )
+       lirc_devices_irman? ( media-libs/libirman )"
+
+# This are drivers with names matching the
+# parameter --with-driver=NAME
+IUSE_LIRC_DEVICES_DIRECT="
+       all userspace accent act200l act220l
+       adaptec alsa_usb animax asusdh atilibusb
+       atiusb audio audio_alsa avermedia avermedia_vdomate
+       avermedia98 awlibusb bestbuy bestbuy2 breakoutbox
+       bte bw6130 caraca chronos commandir
+       cph06x creative creative_infracd
+       devinput digimatrix dsp dvico ea65 ene0100
+       exaudio flyvideo ftdi gvbctv5pci hauppauge
+       hauppauge_dvb hercules_smarttv_stereo i2cuser
+       igorplugusb iguanaIR imon imon_24g imon_knob
+       imon_lcd imon_pad imon_rsc irdeo irdeo_remote
+       irlink irman irreal it87 ite8709
+       knc_one kworld leadtek_0007 leadtek_0010
+       leadtek_pvr2000 livedrive_midi
+       livedrive_seq logitech macmini mceusb
+       mediafocusI mouseremote
+       mouseremote_ps2 mp3anywhere mplay nslu2
+       packard_bell parallel pcmak pcmak_usb
+       pctv pixelview_bt878 pixelview_pak
+       pixelview_pro provideo realmagic
+       remotemaster sa1100 samsung sasem sb0540 serial
+       silitek sir slinke streamzap tekram
+       tekram_bt829 tira ttusbir tuxbox tvbox udp uirt2
+       uirt2_raw usb_uirt_raw usbx wpc8769l"
+
+# drivers that need special handling and
+# must have another name specified for
+# parameter --with-driver=NAME
+IUSE_LIRC_DEVICES_SPECIAL="
+       serial_igor_cesko
+       remote_wonder_plus xboxusb usbirboy inputlirc"
+
+IUSE_LIRC_DEVICES="${IUSE_LIRC_DEVICES_DIRECT} ${IUSE_LIRC_DEVICES_SPECIAL}"
+
+#device-driver which use libusb
+LIBUSB_USED_BY_DEV="
+       all atilibusb awlibusb sasem igorplugusb imon imon_lcd imon_pad
+       imon_rsc streamzap mceusb xboxusb irlink commandir"
+
+for dev in ${LIBUSB_USED_BY_DEV}; do
+       DEPEND="${DEPEND} lirc_devices_${dev}? ( dev-libs/libusb )"
+done
+
+# adding only compile-time depends
+DEPEND="${RDEPEND} ${DEPEND}
+       virtual/linux-sources
+       lirc_devices_ftdi? ( dev-embedded/libftdi )
+       lirc_devices_all? ( dev-embedded/libftdi )"
+
+# adding only run-time depends
+RDEPEND="${RDEPEND}
+       lirc_devices_usbirboy? ( app-misc/usbirboy )
+       lirc_devices_inputlirc? ( app-misc/inputlircd )
+       lirc_devices_iguanaIR? ( app-misc/iguanaIR )"
+
+# add all devices to IUSE
+for dev in ${IUSE_LIRC_DEVICES}; do
+       IUSE="${IUSE} lirc_devices_${dev}"
+done
+
+add_device() {
+       : ${lirc_device_count:=0}
+       ((lirc_device_count++))
+
+       if [[ ${lirc_device_count} -eq 2 ]]; then
+               ewarn
+               ewarn "When selecting multiple devices for lirc to be supported,"
+               ewarn "it can not be guaranteed that the drivers play nice together."
+               ewarn
+               ewarn "If this is not intended, then abort emerge now with Ctrl-C,"
+               ewarn "Set LIRC_DEVICES and restart emerge."
+               ewarn
+               epause
+       fi
+
+       local dev="${1}"
+       local desc="device ${dev}"
+       if [[ -n "${2}" ]]; then
+               desc="${2}"
+       fi
+
+       elog "Compiling support for ${desc}"
+       MY_OPTS="${MY_OPTS} --with-driver=${dev}"
+}
+
+pkg_setup() {
+
+       if use lirc_devices_mceusb2
+       then
+               ewarn "The mceusb2 driver has been merged into the mceusb."
+               ewarn "Please only use the latter now."
+       fi
+
+       ewarn "If your LIRC device requires modules, you'll need MODULE_UNLOAD"
+       ewarn "support in your kernel."
+
+       linux-mod_pkg_setup
+
+       # set default configure options
+       MY_OPTS=""
+       LIRC_DRIVER_DEVICE="/dev/lirc0"
+
+       if use lirc_devices_all; then
+               # compile in drivers for a lot of devices
+               add_device all "a lot of devices"
+       else
+               # compile in only requested drivers
+               local dev
+               for dev in ${IUSE_LIRC_DEVICES_DIRECT}; do
+                       if use lirc_devices_${dev}; then
+                               add_device ${dev}
+                       fi
+               done
+
+               if use lirc_devices_remote_wonder_plus; then
+                       add_device atiusb "device Remote Wonder Plus (atiusb-based)"
+               fi
+
+               if use lirc_devices_serial_igor_cesko; then
+                       add_device serial "serial with Igor Cesko design"
+                       MY_OPTS="${MY_OPTS} --with-igor"
+               fi
+
+               if use lirc_devices_imon_pad; then
+                       ewarn "The imon_pad driver has incorporated the previous pad2keys patch"
+                       ewarn "and removed the pad2keys_active option for the lirc_imon module"
+                       ewarn "because it is always active."
+                       ewarn "If you have an older imon VFD device, you may need to add the module"
+                       ewarn "option display_type=1 to override autodetection and force VFD mode."
+               fi
+
+               if use lirc_devices_xboxusb; then
+                       add_device atiusb "device xboxusb"
+               fi
+
+               if use lirc_devices_usbirboy; then
+                       add_device userspace "device usbirboy"
+                       LIRC_DRIVER_DEVICE="/dev/usbirboy"
+               fi
+
+               if [[ "${MY_OPTS}" == "" ]]; then
+                       if [[ "${PROFILE_ARCH}" == "xbox" ]]; then
+                               # on xbox: use special driver
+                               add_device atiusb "device xboxusb"
+                       else
+                               # no driver requested
+                               elog
+                               elog "Compiling only the lirc-applications, but no drivers."
+                               elog "Enable drivers with LIRC_DEVICES if you need them."
+                               MY_OPTS="--with-driver=none"
+                       fi
+               fi
+       fi
+
+       use hardware-carrier && MY_OPTS="${MY_OPTS} --without-soft-carrier"
+       use transmitter && MY_OPTS="${MY_OPTS} --with-transmitter"
+
+       if [[ -n "${LIRC_OPTS}" ]] ; then
+               ewarn
+               ewarn "LIRC_OPTS is deprecated from lirc-0.8.0-r1 on."
+               ewarn
+               ewarn "Please use LIRC_DEVICES from now on."
+               ewarn "e.g. LIRC_DEVICES=\"serial sir\""
+               ewarn
+               ewarn "Flags are now set per use-flags."
+               ewarn "e.g. transmitter, hardware-carrier"
+
+               local opt
+               local unsupported_opts=""
+
+               # test for allowed options for LIRC_OPTS
+               for opt in ${LIRC_OPTS}; do
+                       case ${opt} in
+                               --with-port=*|--with-irq=*|--with-timer=*|--with-tty=*)
+                                       MY_OPTS="${MY_OPTS} ${opt}"
+                                       ;;
+                               *)
+                                       unsupported_opts="${unsupported_opts} ${opt}"
+                                       ;;
+                       esac
+               done
+               if [[ -n ${unsupported_opts} ]]; then
+                       ewarn "These options are no longer allowed to be set"
+                       ewarn "with LIRC_OPTS: ${unsupported_opts}"
+                       die "LIRC_OPTS is no longer recommended."
+               fi
+       fi
+
+       # Setup parameter for linux-mod.eclass
+       MODULE_NAMES="lirc(misc:${S})"
+       BUILD_TARGETS="all"
+
+       ECONF_PARAMS="  --localstatedir=/var
+                                       --with-syslog=LOG_DAEMON
+                                       --enable-sandboxed
+                                       --with-kerneldir=${KV_DIR}
+                                       --with-moduledir=/lib/modules/${KV_FULL}/misc
+                                       $(use_enable debug)
+                                       $(use_with X x)
+                                       ${MY_OPTS}"
+
+       einfo
+       einfo "lirc-configure-opts: ${MY_OPTS}"
+       elog  "Setting default lirc-device to ${LIRC_DRIVER_DEVICE}"
+
+       filter-flags -Wl,-O1
+
+       # force non-parallel make, Bug 196134
+       MAKEOPTS="${MAKEOPTS} -j1"
+}
+
+src_unpack() {
+       unpack ${A}
+       cd "${S}"
+
+       # Rip out dos CRLF
+       edos2unix contrib/lirc.rules
+
+       # Apply patches needed for some special device-types
+       use lirc_devices_audio || epatch "${FILESDIR}"/lirc-0.8.4-portaudio_check.patch
+       use lirc_devices_remote_wonder_plus && epatch "${FILESDIR}"/lirc-0.8.3_pre1-remotewonderplus.patch
+
+       # Don't wig out with evdev input, bug 299030
+       epatch "${FILESDIR}"/${P}-send-evsyn.diff
+
+       # bug 296739
+       epatch "${FILESDIR}"/${P}-i2c.patch
+
+       # remove parallel driver on SMP systems
+       if linux_chkconfig_present SMP ; then
+               sed -i -e "s:lirc_parallel\.o::" drivers/lirc_parallel/Makefile.am
+       fi
+
+       # Bug #187418
+       if kernel_is ge 2 6 22 ; then
+               ewarn "Disabling lirc_gpio driver as it does no longer work Kernel 2.6.22+"
+               sed -i -e "s:lirc_gpio\.o::" drivers/lirc_gpio/Makefile.am
+       fi
+
+       # respect CFLAGS
+       sed -i -e 's:CFLAGS="-O2:CFLAGS=""\n#CFLAGS="-O2:' configure.ac
+
+       # setting default device-node
+       local f
+       for f in configure.ac acconfig.h; do
+               [[ -f "$f" ]] && sed -i -e '/#define LIRC_DRIVER_DEVICE/d' "$f"
+       done
+       echo "#define LIRC_DRIVER_DEVICE \"${LIRC_DRIVER_DEVICE}\"" >> acconfig.h
+
+       eautoreconf
+}
+
+src_install() {
+       emake DESTDIR="${D}" install || die "emake install failed"
+
+       newinitd "${FILESDIR}"/lircd-0.8.6 lircd
+       newinitd "${FILESDIR}"/lircmd lircmd
+       newconfd "${FILESDIR}"/lircd.conf.2 lircd
+
+       insinto /etc/modprobe.d/
+       newins "${FILESDIR}"/modprobed.lirc lirc.conf
+
+       newinitd "${FILESDIR}"/irexec-initd-0.8.6-r2 irexec
+       newconfd "${FILESDIR}"/irexec-confd irexec
+
+       if use doc ; then
+               dohtml doc/html/*.html
+               insinto /usr/share/doc/${PF}/images
+               doins doc/images/*
+       fi
+
+       insinto /usr/share/lirc/remotes
+       doins -r remotes/*
+
+       keepdir /var/run/lirc /etc/lirc
+       if [[ -e "${D}"/etc/lirc/lircd.conf ]]; then
+               newdoc "${D}"/etc/lirc/lircd.conf lircd.conf.example
+       fi
+}
+
+pkg_preinst() {
+       linux-mod_pkg_preinst
+
+       local dir="${ROOT}/etc/modprobe.d"
+       if [[ -a "${dir}"/lirc && ! -a "${dir}"/lirc.conf ]]; then
+               elog "Renaming ${dir}/lirc to lirc.conf"
+               mv -f "${dir}/lirc" "${dir}/lirc.conf"
+       fi
+
+       # copy the first file that can be found
+       if [[ -f "${ROOT}"/etc/lirc/lircd.conf ]]; then
+               cp "${ROOT}"/etc/lirc/lircd.conf "${T}"/lircd.conf
+       elif [[ -f "${ROOT}"/etc/lircd.conf ]]; then
+               cp "${ROOT}"/etc/lircd.conf "${T}"/lircd.conf
+               MOVE_OLD_LIRCD_CONF=1
+       elif [[ -f "${D}"/etc/lirc/lircd.conf ]]; then
+               cp "${D}"/etc/lirc/lircd.conf "${T}"/lircd.conf
+       fi
+
+       # stop portage from touching the config file
+       if [[ -e "${D}"/etc/lirc/lircd.conf ]]; then
+               rm -f "${D}"/etc/lirc/lircd.conf
+       fi
+}
+
+pkg_postinst() {
+       linux-mod_pkg_postinst
+
+       # copy config file to new location
+       # without portage knowing about it
+       # so it will not delete it on unmerge or ever touch it again
+       if [[ -e "${T}"/lircd.conf ]]; then
+               cp "${T}"/lircd.conf "${ROOT}"/etc/lirc/lircd.conf
+               if [[ "$MOVE_OLD_LIRCD_CONF" = "1" ]]; then
+                       elog "Moved /etc/lircd.conf to /etc/lirc/lircd.conf"
+                       rm -f "${ROOT}"/etc/lircd.conf
+               fi
+       fi
+
+       ewarn
+       ewarn "The lirc_gpio driver will not work with Kernels 2.6.22+"
+       ewarn "You need to switch over to /dev/input/event? if you need gpio"
+       ewarn "This device can than then be used via lirc's dev/input driver."
+       ewarn
+       ewarn "The new default location for lircd.conf is inside of"
+       ewarn "/etc/lirc/ directory"
+
+}