summaryrefslogtreecommitdiff
path: root/extra/sane/PKGBUILD
blob: f33ec148e1801c0cc9411ab7609c1d2f0691b745 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# $Id: PKGBUILD 198401 2013-10-30 14:38:47Z allan $
# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Sarah Hay <sarahhay@mb.sympatico.ca>
# Contributor: Simo L. <neotuli@yahoo.com>
# Contributor: eric <eric@archlinux.org>

pkgname=sane
pkgver=1.0.24
pkgrel=3
pkgdesc="Scanner Access Now Easy"
url="http://www.sane-project.org/"
arch=('i686' 'x86_64')
license=('GPL')
depends=('libtiff>=4.0.0' 'libgphoto2' 'libjpeg>=8' 'libusbx' 'libcups' 'libieee1284' 'v4l-utils' 'avahi' 'bash' 'net-snmp')
makedepends=('texlive-latexextra')
backup=(etc/sane.d/{abaton.conf,agfafocus.conf,apple.conf,artec.conf,artec_eplus48u.conf,avision.conf,bh.conf,canon.conf,canon630u.conf,canon_dr.conf,canon_pp.conf,cardscan.conf,coolscan2.conf,coolscan3.conf,coolscan.conf,dc25.conf,dc210.conf,dc240.conf,dell1600n_net.conf,dll.conf,dmc.conf,epjitsu.conf,epson.conf,epson2.conf,fujitsu.conf,genesys.conf,gphoto2.conf,gt68xx.conf,hp.conf,hp3900.conf,hp4200.conf,hp5400.conf,hpsj5s.conf,hs2p.conf,ibm.conf,kodak.conf,kodakaio.conf,leo.conf,lexmark.conf,ma1509.conf,magicolor.conf,matsushita.conf,microtek.conf,microtek2.conf,mustek.conf,mustek_pp.conf,mustek_usb.conf,nec.conf,net.conf,p5.conf,pie.conf,pixma.conf,plustek.conf,plustek_pp.conf,qcam.conf,ricoh.conf,rts8891.conf,s9036.conf,saned.conf,sceptre.conf,sharp.conf,sm3840.conf,snapscan.conf,sp15c.conf,st400.conf,stv680.conf,tamarack.conf,teco1.conf,teco2.conf,teco3.conf,test.conf,u12.conf,umax.conf,umax1220u.conf,umax_pp.conf,xerox_mfp.conf,v4l.conf} etc/xinetd.d/sane)
source=(ftp://ftp.archlinux.org/other/sane/$pkgname-backends-$pkgver.tar.gz
        'sane.xinetd'
        'saned.socket'
        'saned.service'
        'network.patch'
        'segfault-avahi-fix-kodakio.patch')

prepare() {
  cd "${srcdir}/${pkgname}-backends-${pkgver}"
   # fix http://vasks.debian.org/tracker/?func=detail&atid=410366&aid=313760&group_id=30186
   patch -Np1 -i ${srcdir}/network.patch
   # fix http://anonscm.debian.org/gitweb/?p=sane/sane-backends.git;a=commit;h=37523b867d411c2f82d08128246be7e38bc9812c
   # #37525
   # https://alioth.debian.org/tracker/?group_id=30186&atid=410366&func=detail&aid=314301
   patch -Np1 -i ${srcdir}/segfault-avahi-fix-kodakio.patch
}

build() {
  cd "${srcdir}/${pkgname}-backends-${pkgver}"

  ./configure --prefix=/usr --sbindir=/usr/bin \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --with-docdir=/usr/share/doc/sane \
    --enable-avahi \
    --enable-pthread \
    --disable-rpath \
    --enable-libusb_1_0 \
    --disable-locking
  make
}

package () {
  cd "${srcdir}/${pkgname}-backends-${pkgver}"
  make DESTDIR="${pkgdir}" install
  # fix hp officejets
  echo "#hpaio" >> "${pkgdir}/etc/sane.d/dll.conf"
  # install udev files
  install -D -m0644 tools/udev/libsane.rules \
    "${pkgdir}/usr/lib/udev/rules.d/49-sane.rules"
  # fix udev rules
  sed -i 's|NAME="%k", ||g' "${pkgdir}/usr/lib/udev/rules.d/49-sane.rules"
  
  # install xinetd file
  install -D -m644 "${srcdir}/sane.xinetd" "${pkgdir}/etc/xinetd.d/sane"
  
  # Install the pkg-config file
  install -D -m644 tools/sane-backends.pc \
     "${pkgdir}/usr/lib/pkgconfig/sane-backends.pc"
  # install systemd files
  install -D -m644 ${srcdir}/saned.socket \
      "${pkgdir}/usr/lib/systemd/system/saned.socket"
  install -D -m644 ${srcdir}/saned.service \
      "${pkgdir}/usr/lib/systemd/system/saned@.service"
}
md5sums=('1ca68e536cd7c1852322822f5f6ac3a4'
         'bc2c8b4f7b3012c8936c7da21f60e2ac'
         'e57e9e15528f47f5f1b3f1411135ed5d'
         '3f9fe36b0c4ff0b01b53b1cffa5d9700'
         '44e77692c52db15b0f530a1d9a8e1296'
         '039524a38af8721f2e97d45e889295ca')