updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / lirc-bede / PKGBUILD
blobadb0697015e5abe7362aab89f7a5d3ab191cb734
1 # Maintainer: BlackEagle < ike DOT devolder AT gmail DOT com >
2 # Contributor: Paul Mattal <paul@archlinux.org>
4 pkgbase='lirc-bede'
5 pkgname='lirc-bede'
6 true && pkgname=('lirc-bede' 'lirc-bede-utils')
7 pkgver=0.9.0
8 pkgrel=17
9 arch=('i686' 'x86_64')
10 url="http://www.lirc.org/"
11 license=('GPL')
12 _extramodules=3.2-BEDE-external
13 makedepends=('linux-bede>=3.2' 'linux-bede<3.3' 'linux-bede-headers>=3.2' 'linux-bede-headers<3.3'
14         'help2man' 'alsa-lib' 'libx11' 'libsm' 'python2' 'libftdi' 'libirman')
15 options=('!strip' '!makeflags')
16 source=(
17         "http://downloads.sourceforge.net/lirc/lirc-${pkgver}.tar.bz2"
18         'lircd'
19         'lircmd'
20         'lirc.logrotate'
21         'lircd.conf'
22         'irexec.conf'
23         'irexecd'
24         'lirc_wpc8769l.patch'
25         'lircd-handle-large-config.patch'
26         'lirc_atiusb-kfifo.patch'
27         'kernel-2.6.39.patch'
29 sha256sums=('6323afae6ad498d4369675f77ec3dbb680fe661bea586aa296e67f2e2daba4ff'
30             '16e1285eb473a8e15796bc828dc11eb88a1007f30d2eb35727239a50859a7b34'
31             '111f8bd4b69e7caa6d2b9da87938f949a5fcba01319c1611decbd51caf0ff497'
32             'bd13ca00e30d85ff9166c03b8f7a20195ef89794e66d7e54f04ba1d014a73e7d'
33             'a64962f310805db250e574464fce93cb4566a6f5bac1d9aad462435090bf3cb2'
34             '398b9867c22537e71ac80e2e20a6915c52d90a8e542c1efaef6b8608a54e10ed'
35             '175b4ce902688885b40423f2a55b3f55ccf54b55582f1fbd51a4cfcdc7a0cfb9'
36             '137b1169810d1b66c5fe058aaffc2043ecbb4ef6cfce62050f9b418fa924b9ba'
37             '474b5709e6604ef2815e6e1a611d77665e3d33be05cd09110330a81a846bc69f'
38             'f2a83e2a32c8eb963453214d0337589a293b2327291290ec047f4d78782fb310'
39             '3dddd4e9f093ee6fe75b3408da269744a4ffcd5255ea2382f077fb32079a2352')
41 build() {
42         _kernver="$(cat /lib/modules/${_extramodules}/version)"
44         cd lirc-${pkgver}
45         patch -Np1 -i "${srcdir}/lirc_wpc8769l.patch"
46         patch -Np1 -i "${srcdir}/lircd-handle-large-config.patch"
47         patch -Np1 -i "${srcdir}/lirc_atiusb-kfifo.patch"
48         patch -Np1 -i "${srcdir}/kernel-2.6.39.patch"
50         sed -i '/AC_PATH_XTRA/d' configure.ac
51         sed -e 's/@X_CFLAGS@//g' \
52                 -e 's/@X_LIBS@//g' \
53                 -e 's/@X_PRE_LIBS@//g' \
54                 -e 's/@X_EXTRA_LIBS@//g' -i Makefile.am tools/Makefile.am
56         libtoolize
57         autoreconf
59         PYTHON=python2 ./configure --enable-sandboxed \
60                 --prefix=/usr \
61                 --with-driver=all \
62                 --with-kerneldir=/usr/src/linux-${_kernver} \
63                 --with-moduledir=/lib/modules/${_kernver}/kernel/drivers/misc \
64                 --with-transmitter
66         # Remove drivers already in kernel
67         sed -e "s:lirc_dev::" -e "s:lirc_bt829::" -e "s:lirc_igorplugusb::" \
68                 -e "s:lirc_imon::" -e "s:lirc_parallel::" -e "s:lirc_sasem::" \
69                 -e "s:lirc_serial::" -e "s:lirc_sir::" -e "s:lirc_ttusbir::" \
70                 -i Makefile drivers/Makefile drivers/*/Makefile tools/Makefile 
72         make
75 package_lirc-bede() {
76         pkgdesc="Linux Infrared Remote Control kernel modules for BEDE kernel"
77         depends=("lirc-bede-utils>=${pkgver}" 'linux-bede>=3.2' 'linux-bede<3.3')
78         install=lirc.install
79         provides=('lirc')
80         replaces=('lirc+pctv' 'lirc-bemm')
82         cd lirc-${pkgver}
83         cd drivers
84         make DESTDIR=${pkgdir} moduledir="/lib/modules/${_extramodules}/lirc" install
86         # gzip all modules
87         find ${pkgdir} -name '*.ko' -exec gzip -9 {} \;
89         # set the kernel version in install script
90         sed -i -e "s/EXTRAMODULES=.*/EXTRAMODULES=${_extramodules}/g" \
91                 ${startdir}/lirc.install
94 package_lirc-bede-utils() {
95         pkgdesc="Linux Infrared Remote Control utils for BEDE kernel"
96         depends=('alsa-lib' 'libx11' 'libftdi' 'libirman')
97         optdepends=('python2: pronto2lirc util')
98         options=('strip' '!libtool')
99         backup=('etc/conf.d/lircd.conf'
100                 'etc/conf.d/irexec.conf')
101         provides=('lirc-utils')
102         replaces=('lirc-bemm-utils')
104         cd lirc-${pkgver}
105         make DESTDIR="${pkgdir}" install
106         install -d "${pkgdir}/usr/share/lirc" "${pkgdir}/etc/rc.d"
107         cp "${srcdir}"/{lircd,lircmd,irexecd} "${pkgdir}/etc/rc.d"
108         cp -rp remotes "${pkgdir}/usr/share/lirc"
109         chmod -R go-w "${pkgdir}/usr/share/lirc/"
111         # install the logrotate config
112         install -Dm644 "${srcdir}/lirc.logrotate" "${pkgdir}/etc/logrotate.d/lirc"
114         # install conf.d file
115         install -Dm644 "${srcdir}/lircd.conf" "${pkgdir}/etc/conf.d/lircd.conf"
117         # install conf.d file
118         install -Dm644 "${srcdir}/irexec.conf" "${pkgdir}/etc/conf.d/irexec.conf"
120         install -d "${pkgdir}/etc/lirc"
122         # remove built modules
123         rm -r "${pkgdir}/lib/"
125 pkgdesc="Linux Infrared Remote Control kernel modules and utils for BEDE kernel"