archrelease: copy trunk to extra-x86_64
[arch-packages.git] / sane / repos / extra-x86_64 / PKGBUILD
blobd4777e95c1f92c16eb0212a3543e3fe77403b496
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.1.1
10 pkgrel=1
11 pkgdesc="Scanner Access Now Easy"
12 arch=(x86_64)
13 url="http://www.sane-project.org/"
14 license=(GPL2)
15 # NOTE: libgphoto2 can be moved to makedepends once the package also provides
16 # libgphoto2_port.so
17 depends=(bash cairo gcc-libs glibc libgphoto2 libnl libpng libxml2 libieee1284
18 net-snmp openssl v4l-utils)
19 makedepends=(autoconf-archive avahi curl glib2 libjpeg-turbo libtiff libusb
20 poppler-glib python systemd texlive-latexextra)
21 provides=(libsane.so)
22 source=("https://gitlab.com/sane-project/${_name}/-/archive/${pkgver}/${_name}-${pkgver}.tar.gz"
23         "66-${pkgname}d.rules"
24         "${pkgname}.sysusers"
25         "${pkgname}d.service"
26         "${pkgname}d.socket"
28 sha512sums=('3713f452956fe94cc7f2d15fee764411c1e289d5ff94a095d4a4ee43fae0479e7dbd1b97d85cd9a70ad9cd5458e5c38bcdbd170bcd6ac244083c987094fb36bd'
29             'd0d1b6bd6fbb04d610e7186e26d04c2233a620cc7c731ca3acd7fb860dd033fbe99d8974ffa1dd59c8affcc4aa2664d76ab3dfd6f7b2a734b31d7e3832359c41'
30             'd8cd194b57eff2249df2b8d540a892e518aa3e3bba6387211ed21230dc235e98c49b71f262f0b1007e8c859c59776410840376244e0aec1f06363881b2c81fd8'
31             'baf2cf2fdff689f776973ac4f69ea02b131f2a1a754a8d52a8e8ad33b0e559ba286649a891723a7ad94b2bcb01ec88155d43c36eaeb35e47fbc8ea80c49c5d47'
32             'a23ceeeb02bd9e214702003a3165886858ecbdd93df89cd37ad5f00581745454548ccda0ab656f2dc0acbf2896a8781568c786797e64a07014be003d6140a093')
33 b2sums=('341f007ee36e660092dffb4c27ade08dd4fd23fb9986b9ddb0a84348f9ed50fd053ad0ced1a24eb670fe1adcdb9ebbde5178dc559d57ceb01f40d2d79d565ed4'
34         'c9c6ba224b9b27f4ecc6b1ded6621a8abb52b1ded2d9078e4cad31177290b788e286fad74545a5cb09e1f6726515adc22003988eb646dc986e87f1a8061a0e27'
35         '2a4ddc9849562e3a0adcaec1859391e3f37a63f25c27dbc140cabd697bd65b89a0fc812c4516cbdfb36d1f30844df34934b3c1c59650101f54fc1ac0acb3f5d9'
36         '272b4860dbd3f2b69eedfed4532cf8a388629c003c9a0e0ee98defbc2023e07edc26275a17f56ea9fd4d90e9b3b6532c5b10d1e2b91e6ab4df242ac44101d802'
37         '5e9f0350a1553fc75aea88ce355fb68b881e3b2194ac0e3c6f3cecdae79111fb1db1cfe3b4933eca15af5f985fc6b89e4d9af3844b6e9cfd542828b6b9e57ed9')
39 prepare() {
40   cd "${_name}-${pkgver}"
41   # create version files, so that autotools macros can use them:
42   # https://gitlab.com/sane-project/backends/-/issues/440
43   echo "${pkgver}" > .tarball-version
44   echo "${pkgver}" > .version
45   autoreconf -fiv
48 build() {
49   cd "${_name}-${pkgver}"
51   ./configure --prefix=/usr \
52     --disable-locking \
53     --disable-rpath \
54     --docdir="/usr/share/doc/${pkgname}" \
55     --enable-pthread \
56     --localstatedir=/var \
57     --sbindir=/usr/bin \
58     --sysconfdir=/etc \
59     --with-avahi \
60     --with-libcurl \
61     --with-pic \
62     --with-poppler-glib \
63     --with-systemd \
64     --with-usb
65   # circumvent overlinking in libraries
66   sed -e 's/ -shared / -Wl,-O1,--as-needed\0/g' -i libtool
67   make
70 package() {
71   depends+=(libavahi-client.so libavahi-common.so libcurl.so libgphoto2.so
72   libgobject-2.0.so libpoppler-glib.so libsystemd.so libtiff.so libusb-1.0.so)
74   cd "${_name}-${pkgver}"
76   make DESTDIR="${pkgdir}" install
78   # generate udev udev+hwdb
79   install -vdm 755 "${pkgdir}/usr/lib/udev/rules.d/"
80   tools/sane-desc -m udev+hwdb -s doc/descriptions/ > "${pkgdir}/usr/lib/udev/rules.d/65-${pkgname}.rules"
81   tools/sane-desc -m udev+hwdb -s doc/descriptions-external/ >> "${pkgdir}/usr/lib/udev/rules.d/65-${pkgname}.rules"
82   # generate udev hwdb
83   install -vdm 755 "${pkgdir}/usr/lib/udev/hwdb.d/"
84   tools/sane-desc -m hwdb -s doc/descriptions/ > "${pkgdir}/usr/lib/udev/hwdb.d/20-${pkgname}.hwdb"
85   # NOTE: an empty new line is required between the two .desc collections
86   printf "\n" >> "${pkgdir}/usr/lib/udev/hwdb.d/20-${pkgname}.hwdb"
87   tools/sane-desc -m hwdb -s doc/descriptions-external/ >> "${pkgdir}/usr/lib/udev/hwdb.d/20-${pkgname}.hwdb"
89   # systemd integration
90   install -vDm 644 "../${pkgname}d.socket" \
91       -t "${pkgdir}/usr/lib/systemd/system/"
92   install -vDm 644 "../${pkgname}d.service" \
93       "${pkgdir}/usr/lib/systemd/system/${pkgname}d@.service"
94   install -vDm 644 "../66-${pkgname}d.rules" "${pkgdir}/usr/lib/udev/rules.d/"
95   # sysusers.d
96   install -vDm 644 "../${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
98   # remove old ChangeLogs
99   rm -rvf "${pkgdir}/usr/share/doc/${pkgname}/ChangeLogs/"
101   # add files below /etc/sane.d to backup array
102   cd "${pkgdir}"
103   # trick extract_function_variable() in makepkg into not detecting the
104   # backup array modification and adding remaining configuration files
105   [[ /usr/bin/true ]] && backup=( ${backup[@]} $(find "etc/${pkgname}.d/" -type f) )