Magellan Linux

Contents of /trunk/extras/sane-backends/sane-backends-1.0.28-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 33067 - (show annotations) (download)
Thu Oct 17 15:05:38 2019 UTC (4 years, 6 months ago) by niro
File size: 2674 byte(s)
-reworked SRC_URI and co because autoreconf does not work
1 # $Id$
2
3 PNAME="sane-backends"
4 PVER="1.0.28"
5 PBUILD="r1"
6
7 PCAT="media-gfx"
8
9 DESCRIPTION="SANE - Scanner Access Now Easy backends."
10 HOMEPAGE="http://www.sane-project.org/"
11
12 DEPEND=">= virtual/libjpeg
13 >= media-libs/libtiff-4
14 >= media-libs/libv4l-1.18
15 >= sys-libs/libieee1284-0.2.11
16 >= dev-libs/libusb-1.0
17 >= net-dns/avahi-0.7
18 >= media-libs/libgphoto2-2.5
19 >= sys-libs/libsystemd-242"
20
21 # git src not working, configure cannot created just by autoreconf
22 #SRCFILE="${PNAME/sane-/}-${PVER}.tar.gz"
23 #SRCDIR="${BUILDDIR}/${PNAME/sane-/}-${PVER}"
24 SRCFILE="${PNAME}-${PVER}.tar.gz"
25 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
26
27 sminclude mtools multilib mbuild udev
28 msetfeature "!check" # fixme: sanei_config_test failes atm, because of a relative path
29
30 # git src not working, configure cannot created just by autoreconf
31 #https://gitlab.com/sane-project/${PNAME/sane-/}/-/archive/${PVER}/${SRCFILE}
32 UPLOAD_ID="9e718daff347826f4cfe21126c8d5091"
33 SRC_URI=(
34 https://gitlab.com/sane-project/${PNAME/sane-/}/uploads/${UPLOAD_ID}/${SRCFILE}
35 mirror://${PNAME}/${SRCFILE}
36 )
37
38 UP2DATE="updatecmd ${HOMEPAGE} | grep 'ackend.*released' | sed 's/.*s-\([^ ]*\) .*/\1/'"
39
40 src_prepare()
41 {
42 munpack ${SRCFILE} || die
43
44 # generate configure
45 mautoreconf || die
46 }
47
48 src_compile()
49 {
50 mconfigure --enable-ipv6 --enable-libusb --enable-avahi --with-gphoto2 --disable-latex || die
51 mmake || die
52
53 local abi
54 for abi in ${MULTILIB_ABIS}
55 do
56 cd ${SRCDIR}-${abi}
57 grep -v '^$' tools/hotplug/libsane.usermap > tools/hotplug/libsane.usermap.new || die
58 mv tools/hotplug/libsane.usermap.new tools/hotplug/libsane.usermap || die
59 done
60 }
61
62 src_install()
63 {
64 cd ${SRCDIR}
65
66 mmake DESTDIR=${BINDIR} \
67 docdir=${BINDIR}/usr/share/doc/${PNAME}-${PVER} \
68 install || die
69
70 # environment
71 minstalldir /etc/env.d || die
72 local MCONFIG="/etc/env.d/30sane"
73 mclearconfig || die
74 maddconfig 'SANE_CONFIG_DIR=/etc/sane.d' || die
75
76 # usb related
77 minstalldir /etc/hotplug/usb || die
78 all-abis minstallfile tools/hotplug/libsane.usermap /etc/hotplug/usb/libsane.usermap || die
79 all-abis minstallexec tools/hotplug/libusbscanner /etc/hotplug/usb/libusbscanner || die
80 maddconfig 'USB_DEVFS_PATH=/dev/bus/usb' || die
81
82 # udev
83 minstalludevrule tools/udev/libsane.rules 70-libsane.rules || die
84
85 # docs
86 cd backends
87 minstalldocs GUIDE *.README *.BUGS *.CHANGES *.FAQ *.TODO || die
88
89 # remove broken /var/tmp and /var/lib dirs
90 if [[ -d ${BINDIR}/var ]]
91 then
92 mdelete -r /var || die
93 fi
94 }
95
96 preinstall()
97 {
98 # adding the scanner group
99 ${MLIBDIR}/mgroupadd scanner
100 }
101
102 postinstall()
103 {
104 # remove old udev rules
105 if [[ -f ${MROOT}/etc/udev/rules.d/70-libsane.rules ]]
106 then
107 rm ${MROOT}/etc/udev/rules.d/70-libsane.rules
108 fi
109 }