# Maintainer (Arch): Tobias Powalowski <tpowa@archlinux.org>
# Contributor (Arch): Sarah Hay <sarahhay@mb.sympatico.ca>
# Contributor (Arch): Simo L. <neotuli@yahoo.com>
# Contributor (Arch): eric <eric@archlinux.org>
# Contributor (Artix): artoo <artoo@cromnix.org>
# Maintainer: André Silva <emulatorman@hyperbola.info>
pkgname=sane
pkgver=1.0.25
_debver=1.0.25
_debrel=4.1
pkgrel=2.hyperbola3
pkgdesc="Scanner Access Now Easy, with OpenRC support"
url="http://www.sane-project.org/"
arch=('i686' 'x86_64')
license=('GPL-2')
depends=('libtiff>=4.0.0' 'libgphoto2' 'libjpeg>=8' 'libusbx' 'libcups' 'libieee1284' 'v4l-utils' 'bash' 'net-snmp')
makedepends=('texlive-latexextra' 'quilt')
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,epsonds.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,pieusb.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 etc/conf.d/saned)
source=(https://debian.simnet.is/debian/pool/main/s/sane-backends/sane-backends_$pkgver.orig.tar.gz
https://debian.simnet.is/debian/pool/main/s/sane-backends/sane-backends_$_debver-$_debrel.debian.tar.xz
'sane.xinetd'
'network.patch'
'saned.confd'
'saned.initd')
prepare() {
cd "${srcdir}/${pkgname}-backends-${pkgver}"
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
# Debian patches
export QUILT_PATCHES=debian/patches
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
export QUILT_DIFF_ARGS='--no-timestamps'
mv "$srcdir"/debian .
# Doesn't apply and seems unimportant
rm -v debian/patches/0005-libsane_deps.patch || true
rm -v debian/patches/0010-unneeded_doc.patch || true
rm -v debian/patches/0015-frontend_libs.patch || true
rm -v debian/patches/0025-multiarch_manpages_libdir.patch || true
rm -v debian/patches/0035-trim-libraries-in-sane-backends.pc.in.patch || true
rm -v debian/patches/0110-dll_backend_conf.patch || true
rm -v debian/patches/0125-multiarch_dll_search_path.patch || true
rm -v debian/patches/0700-mk_reproducible_results.patch || true
rm -v debian/patches/0710-sane-desc.c_debian_mods.patch || true
quilt push -av
fi
# fix http://vasks.debian.org/tracker/?func=detail&atid=410366&aid=313760&group_id=30186
patch -Np1 -i ${srcdir}/network.patch
}
build() {
cd "${srcdir}/${pkgname}-backends-${pkgver}"
./configure --prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--with-docdir=/usr/share/doc/sane \
--disable-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}/lib/udev/rules.d/49-sane.rules"
# fix udev rules
sed -i 's|NAME="%k", ||g' "${pkgdir}/lib/udev/rules.d/49-sane.rules"
# install xinetd file
install -D -m644 "${srcdir}/sane.xinetd" "${pkgdir}/etc/xinetd.d/sane"
# install pkg-config file
install -D -m644 tools/sane-backends.pc \
"${pkgdir}/usr/lib/pkgconfig/sane-backends.pc"
# install OpenRC files
install -D -m644 ${srcdir}/saned.confd \
"${pkgdir}/etc/conf.d/saned"
install -D -m755 ${srcdir}/saned.initd \
"${pkgdir}/etc/init.d/saned"
# install license file
install -D -m644 COPYING \
"${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
}
sha512sums=('b9548646fff13558a4da4a4e9e8bad730f05121bcc65b72d24ded3bfddc6fe574e08c39c8651544b8fbfeab036fffd76cc14d76ef5d5d47e7513a2ce3afcc9df'
'48c37f62302ece1bf548ac1c62c11d25dfa42f08ed76f81ea7e42ca1f860474c92c90ac8301581fa2744d2ed45f11a98e5f3ddb8e601c444416a93bd0e872ae6'
'8f9f18d432087e5445aa533be375a811daf320512069c108d41a79121868937e1a7ffa21ee7d33adcf9fbb670bca460ff06423ce39602f35151eccc243d9d4ec'
'04b65a06d2c76dde6fce501ba823e999eb89ea41573f887f9e7d5347f3aa5e35310fad69313e99f873640e29a9849372d2ff995678593a0781fba73b464bec0d'
'8f4a99ef24c19b3a7213b3d25ea16f5bca8623735cf25d21e3a706e9e0135ac8cce5d0b8fb8728845977f41dcefe6bd858076d755515fc91b00e05ee5817d751'
'3dca312125ecaf9da33165a978f877a43b4040638b98d029dfb59909363966e04b85effb613fc92c0e830d8d94d03898da7290303d32d5c4b2d2bfed4665b498')