archrelease: copy trunk to extra-x86_64
[arch-packages.git] / sane / repos / extra-x86_64 / PKGBUILD
blobefb06d10bbd480b40d24dfb6cdab2a7cb58cdb87
1 # Maintainer: Tobias Powalowski <tpowa@archlinux.org>
2 # Maintainer: David Runge <dvzrv@archlinux.org>
3 # Contributor: Sarah Hay <sarahhay@mb.sympatico.ca>
4 # Contributor: Simo L. <neotuli@yahoo.com>
5 # Contributor: eric <eric@archlinux.org>
7 _name=backends
8 pkgname=sane
9 pkgver=1.2.1
10 pkgrel=4
11 pkgdesc="Scanner Access Now Easy"
12 arch=(x86_64)
13 url="http://www.sane-project.org/"
14 license=(GPL2)
15 depends=(
16   bash
17   cairo
18   gcc-libs
19   glibc
20   libpng
21   libieee1284
22   net-snmp
23   v4l-utils
25 makedepends=(
26   autoconf-archive
27   avahi
28   curl
29   glib2
30   libgphoto2
31   libjpeg-turbo
32   libtiff
33   libusb
34   libxml2
35   poppler-glib
36   python
37   systemd
38   texlive-latexextra
40 provides=(libsane.so)
41 source=(
42   https://gitlab.com/sane-project/$_name/-/archive/$pkgver/$_name-$pkgver.tar.gz
43   66-${pkgname}d.rules
44   $pkgname.sysusers
45   ${pkgname}d.service
46   ${pkgname}d.socket
48 sha512sums=('b3b803162066b563d9bafaedb7a6c8c1e9be736bb787f2e412f3f71402a42721123bc32882ae9dc39cbf12bc2c423f8841ed06f525f325857f4273186b7f3a16'
49             'd0d1b6bd6fbb04d610e7186e26d04c2233a620cc7c731ca3acd7fb860dd033fbe99d8974ffa1dd59c8affcc4aa2664d76ab3dfd6f7b2a734b31d7e3832359c41'
50             'd8cd194b57eff2249df2b8d540a892e518aa3e3bba6387211ed21230dc235e98c49b71f262f0b1007e8c859c59776410840376244e0aec1f06363881b2c81fd8'
51             'baf2cf2fdff689f776973ac4f69ea02b131f2a1a754a8d52a8e8ad33b0e559ba286649a891723a7ad94b2bcb01ec88155d43c36eaeb35e47fbc8ea80c49c5d47'
52             'a23ceeeb02bd9e214702003a3165886858ecbdd93df89cd37ad5f00581745454548ccda0ab656f2dc0acbf2896a8781568c786797e64a07014be003d6140a093')
53 b2sums=('b12a629bab6e79d9027d9e90cfa5851ee172a7a1eb6303666c294e2a3d881e2afbef9a3cf3d3156063885a28ec64294216d0dec83c25d212af257f83bbc33721'
54         'c9c6ba224b9b27f4ecc6b1ded6621a8abb52b1ded2d9078e4cad31177290b788e286fad74545a5cb09e1f6726515adc22003988eb646dc986e87f1a8061a0e27'
55         '2a4ddc9849562e3a0adcaec1859391e3f37a63f25c27dbc140cabd697bd65b89a0fc812c4516cbdfb36d1f30844df34934b3c1c59650101f54fc1ac0acb3f5d9'
56         '272b4860dbd3f2b69eedfed4532cf8a388629c003c9a0e0ee98defbc2023e07edc26275a17f56ea9fd4d90e9b3b6532c5b10d1e2b91e6ab4df242ac44101d802'
57         '5e9f0350a1553fc75aea88ce355fb68b881e3b2194ac0e3c6f3cecdae79111fb1db1cfe3b4933eca15af5f985fc6b89e4d9af3844b6e9cfd542828b6b9e57ed9')
59 prepare() {
60   cd $_name-$pkgver
61   # copy translation files so they become reproducible: https://gitlab.com/sane-project/backends/-/issues/647
62   cp -v po/en{_GB,@quot}.po
63   cp -v po/en{_GB,@boldquot}.po
64   # create version files, so that autotools macros can use them:
65   # https://gitlab.com/sane-project/backends/-/issues/440
66   printf "%s\n" "$pkgver" > .tarball-version
67   printf "%s\n" "$pkgver" > .version
68   autoreconf -fiv
71 build() {
72   local configure_options=(
73     --prefix=/usr
74     --disable-locking
75     --disable-rpath
76     --docdir="/usr/share/doc/$pkgname"
77     --enable-pthread
78     --localstatedir=/var
79     --sbindir=/usr/bin
80     --sysconfdir=/etc
81     --with-avahi
82     --with-libcurl
83     --with-pic
84     --with-poppler-glib
85     --with-systemd
86     --with-usb
87   )
89   cd $_name-$pkgver
90   ./configure "${configure_options[@]}"
92   # circumvent overlinking in libraries
93   sed -e 's/ -shared / -Wl,-O1,--as-needed\0/g' -i libtool
94   make
97 package() {
98   depends+=(
99     avahi libavahi-client.so libavahi-common.so
100     curl libcurl.so
101     glib2 libgobject-2.0.so
102     libgphoto2 libgphoto2.so libgphoto2_port.so
103     libtiff libtiff.so
104     libusb libusb-1.0.so
105     libxml2 libxml2.so
106     poppler-glib libpoppler-glib.so
107     systemd-libs libsystemd.so
108   )
110   cd $_name-$pkgver
112   make DESTDIR="$pkgdir" install
114   # generate udev udev+hwdb
115   install -vdm 755 "$pkgdir/usr/lib/udev/rules.d/"
116   tools/sane-desc -m udev+hwdb -s doc/descriptions/ > "$pkgdir/usr/lib/udev/rules.d/65-$pkgname.rules"
117   tools/sane-desc -m udev+hwdb -s doc/descriptions-external/ >> "$pkgdir/usr/lib/udev/rules.d/65-$pkgname.rules"
118   # generate udev hwdb
119   install -vdm 755 "$pkgdir/usr/lib/udev/hwdb.d/"
120   tools/sane-desc -m hwdb -s doc/descriptions/ > "$pkgdir/usr/lib/udev/hwdb.d/20-$pkgname.hwdb"
121   # NOTE: an empty new line is required between the two .desc collections
122   printf "\n" >> "$pkgdir/usr/lib/udev/hwdb.d/20-$pkgname.hwdb"
123   tools/sane-desc -m hwdb -s doc/descriptions-external/ >> "$pkgdir/usr/lib/udev/hwdb.d/20-$pkgname.hwdb"
125   # systemd integration
126   install -vDm 644 ../${pkgname}d.socket -t "$pkgdir/usr/lib/systemd/system/"
127   install -vDm 644 ../${pkgname}d.service "$pkgdir/usr/lib/systemd/system/${pkgname}d@.service"
128   install -vDm 644 ../66-${pkgname}d.rules "$pkgdir/usr/lib/udev/rules.d/"
129   # sysusers.d
130   install -vDm 644 ../$pkgname.sysusers "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
132   # remove old ChangeLogs
133   rm -rvf "$pkgdir/usr/share/doc/$pkgname/ChangeLogs/"
135   # add files below /etc/sane.d to backup array
136   cd "$pkgdir"
137   # trick extract_function_variable() in makepkg into not detecting the
138   # backup array modification and adding remaining configuration files
139   [[ /usr/bin/true ]] && backup=( ${backup[@]} $(find "etc/${pkgname}.d/" -type f | sort) )