Magellan Linux

Contents of /trunk/extras/sane-backends/sane-backends-1.0.22-r4.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11502 - (show annotations) (download)
Sun Mar 11 00:15:20 2012 UTC (12 years, 3 months ago) by niro
File size: 2520 byte(s)
-multilib
1 # $Id$
2
3 PNAME="sane-backends"
4 PVER="1.0.22"
5 PBUILD="r4"
6
7 PCAT="media-gfx"
8
9 DESCRIPTION="SANE - Scanner Access Now Easy backends."
10 HOMEPAGE="http://www.sane-project.org/"
11
12 DEPEND=">= media-libs/libjpeg-8
13 >= media-libs/libtiff-4
14 >= media-libs/libv4l-0.8
15 >= sys-libs/libieee1284-0.2.11
16 >= dev-libs/libusb-1.0
17 >= net-dns/avahi-0.6.30
18 >= media-libs/libgphoto2-2.4
19 >= sys-libs/libssp-4.6"
20
21 SRCFILE="${PNAME}-${PVER}.tar.gz"
22 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
23
24 sminclude mtools multilib
25
26 SRC_URI=(
27 ftp://ftp.sane-project.org/pub/sane/${PNAME}-${PVER}/${SRCFILE}
28 ftp://ftp2.sane-project.org/pub/sane/${PNAME}-${PVER}/${SRCFILE}
29 mirror://${PNAME}/${SRCFILE}
30 mirror://${PNAME}/${PNAME}-${PVER}-xerox-mfp-usb.patch
31 mirror://${PNAME}/${PNAME}-${PVER}-libv4l084.patch
32 )
33
34 UP2DATE="updatecmd ${HOMEPAGE} | grep 'ackend.*released' | sed 's/.*s-\([^ ]*\) .*/\1/'"
35
36 src_prepare()
37 {
38 munpack ${SRCFILE} || die
39
40 # fix broken xerox mfp usb support
41 mpatch ${PNAME}-${PVER}-xerox-mfp-usb.patch || die
42
43 # fix build against libv4l-0.8.4
44 mpatch ${PNAME}-${PVER}-libv4l084.patch || die
45 }
46
47 src_compile()
48 {
49 mconfigure --enable-ipv6 --enable-libusb --enable-avahi --with-gphoto2 --disable-latex || die
50 mmake || die
51
52 all-abis grep -v '^$' tools/hotplug/libsane.usermap > tools/hotplug/libsane.usermap.new || die
53 all-abis mv tools/hotplug/libsane.usermap.new tools/hotplug/libsane.usermap || die
54 }
55
56 src_install()
57 {
58 cd ${SRCDIR}
59
60 # needed directories
61 minstalldir /etc/env.d || die
62 minstalldir /etc/hotplug/usb || die
63 minstalldir /etc/udev/rules.d || die
64
65 mmake DESTDIR=${BINDIR} \
66 docdir=${BINDIR}/usr/share/doc/${PNAME}-${PVER} \
67 install || die
68
69 # environment
70 echo "SANE_CONFIG_DIR=/etc/sane.d" > ${BINDIR}/etc/env.d/30sane || die
71
72 # usb related
73 all-abis minstallfile tools/hotplug/libsane.usermap /etc/hotplug/usb/libsane.usermap || die
74 all-abis minstallexec tools/hotplug/libusbscanner /etc/hotplug/usb/libusbscanner || die
75 echo "USB_DEVFS_PATH=/dev/bus/usb" >> ${BINDIR}/etc/env.d/30sane || die
76
77 # udev
78 minstalludevrule tools/udev/libsane.rules 70-libsane.rules || die
79
80 # docs
81 cd backends
82 minstalldocs GUIDE *.README *.BUGS *.CHANGES *.FAQ *.TODO || die
83
84 # remove broken /var/tmp and /var/lib dirs
85 if [[ -d ${BINDIR}/var ]]
86 then
87 rm -rf ${BINDIR}/var || die
88 fi
89 }
90
91 preinstall()
92 {
93 # adding the scanner group
94 ${MLIBDIR}/mgroupadd scanner
95 }
96
97 postinstall()
98 {
99 # remove old udev rules
100 if [[ -f ${MROOT}/etc/udev/rules.d/70-libsane.rules ]]
101 then
102 rm ${MROOT}/etc/udev/rules.d/70-libsane.rules
103 fi
104 }