summaryrefslogtreecommitdiff
path: root/media-gfx/sane-backends
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /media-gfx/sane-backends
reinit the tree, so we can have metadata
Diffstat (limited to 'media-gfx/sane-backends')
-rw-r--r--media-gfx/sane-backends/Manifest15
-rw-r--r--media-gfx/sane-backends/files/sane-backends-1.0.24-saned_pidfile_location.patch11
-rw-r--r--media-gfx/sane-backends/files/sane-backends-1.0.25-disable-usb-tests.patch14
-rw-r--r--media-gfx/sane-backends/files/sane-backends-1.0.27-disable-usb-tests.patch11
-rw-r--r--media-gfx/sane-backends/files/saned10
-rw-r--r--media-gfx/sane-backends/files/saned.confd2
-rw-r--r--media-gfx/sane-backends/files/saned.initd11
-rw-r--r--media-gfx/sane-backends/files/saned.socket10
-rw-r--r--media-gfx/sane-backends/files/saned_at.service18
-rw-r--r--media-gfx/sane-backends/metadata.xml5
-rw-r--r--media-gfx/sane-backends/sane-backends-1.0.25-r1.ebuild346
-rw-r--r--media-gfx/sane-backends/sane-backends-1.0.27.ebuild349
12 files changed, 802 insertions, 0 deletions
diff --git a/media-gfx/sane-backends/Manifest b/media-gfx/sane-backends/Manifest
new file mode 100644
index 000000000000..dcedbbbc7819
--- /dev/null
+++ b/media-gfx/sane-backends/Manifest
@@ -0,0 +1,15 @@
+AUX sane-backends-1.0.24-saned_pidfile_location.patch 345 SHA256 c95f305d01fd0dfb63944788f450d798a8882412f1d3e6da5c7e49f33cceba51 SHA512 49519b8fea68292b8cbd7bdcaf5b4803a1b890800e17015ace1d662e4503cc0844f191793c8f42cd6aa7e9922ee9f961d4784e30f22abc497973be1978bf1b24 WHIRLPOOL d72b314c7e4898c83a4c79e6fa39af978bd60e2b78afa58c1f8e1709b5f597292e965d330a58cd4109780fb2051dcd7880008f65d2b204fe476cbf3ce898e22b
+AUX sane-backends-1.0.25-disable-usb-tests.patch 428 SHA256 c9af9deacbde51c4c6566dc3ceef449d32137d398fb2691c619194cb69659fa3 SHA512 05e3d33f127211c2dd12e174083fa307a057a207bd3112045f3d6b6a5948643e0f450ebb473dabba3536a48b42393a63e8309d8bb788b80d18c42c9531aeb6f6 WHIRLPOOL c998c896e5271c73a4cafd8f119fd4d50898dcf8ba751ecb53416f49b81515a01c0b24440535dc9d8b40ccc0bd16293ae158f4496fda730e04436aa569f82549
+AUX sane-backends-1.0.27-disable-usb-tests.patch 336 SHA256 7f910c13f05dade4f68100a3438be29bf09eb0cb5274a85bafb56cf332fa5346 SHA512 64cce489e87de31e1a865b86d5829ae4914a30f47e27b07fba68629261cefcd617b8eed272c94b7554545e4802283c5bd5b53f79f54403d875726b38378ae74d WHIRLPOOL 5c678166fc82bf18422f08c2f1ed7cfd89fb0d84f50758628d191d2525697da03e1fc81c6f7eeb8ae24ab7f9e87f211f4370b65005d3aafe66e26f936aa88376
+AUX saned 150 SHA256 d18856d6dd26fac11988fea5217c8616686ad3c0c024ad5437efbf0fd24984f5 SHA512 26f3d66c6b1e75d87d7d430518aa878c77d5ab8d76a45847cef3ff15566341938eedf46c50d0fa8cdeef828df9cddefdd6fdd767c5de30d3aa7d64ed1911d910 WHIRLPOOL 5bdd707daeba740b980ce6dd51096716eec2c2939681f6abd9e7f73b50d8d384a68a07dcc11e9295cd123cc5d2a53d02def52133a559c3e33d63612028d2aac5
+AUX saned.confd 76 SHA256 197e44ba1f438a18f5f7d9f5858feb19c1ece4286d82a5e63caf9be5b964aa76 SHA512 8f4a99ef24c19b3a7213b3d25ea16f5bca8623735cf25d21e3a706e9e0135ac8cce5d0b8fb8728845977f41dcefe6bd858076d755515fc91b00e05ee5817d751 WHIRLPOOL ede920bf5eb1ee59263296a2ccce1ab2da2b04669c2f8a58de1fc4fa76cc1eee501290eb4fdaece464bc184cc0cfb17d100e9309a33d79c06142a3f03c91b837
+AUX saned.initd 294 SHA256 80e12e65ec5abf2e57da9fdf58e681845029ccab65206cd56a4bc06e2abefb0a SHA512 655200141339f14bf7fc6f4fff3403cf9504809b7f023aa5425aad691c5baa65772100da0a6311669f83ed1dce73b7d65ca20aa31345b13c48dfdb1b30ce5dbd WHIRLPOOL 0fd72d11962640451b7dd68066a6d029af322a5662486f9be1626a159422bf862aa4c397a69b956019e64bcce2c4388ff5ed14ed70038fa7efcf0dea9c07227d
+AUX saned.socket 132 SHA256 67e988f3294f33abd34974367fb3b48cd6d71a5c507d3ad9b0f86c5d7eac2dd6 SHA512 a23ceeeb02bd9e214702003a3165886858ecbdd93df89cd37ad5f00581745454548ccda0ab656f2dc0acbf2896a8781568c786797e64a07014be003d6140a093 WHIRLPOOL ac2140e47bb7d0ec6736cf9b231337f0e17d910072246d223ce017b5f6c975ba0deed3a0c7350a761154b455780529262a7d3f60b429c8996d9cd34c279ec17c
+AUX saned_at.service 434 SHA256 4892a381f3bc05679c4b20307046cf37c22bc2a17b141cb7a2b1297cd94e15b0 SHA512 891c751261107676f8159f403e0f4d4254099b709b9ba0ac9f2af97a9ed30f677411ad6bc316c2e6e673c616ba988253479d5e30c9617e3ae279beb79f70e965 WHIRLPOOL 4b413df19bca4dc52a8eb6c1a91edfb3b52744cd92483b6b416ef577e3698f71d82c85d000a45140e7bcdfa4b0a95e871375d0745d15cd06e419694535fa606c
+DIST sane-backends-1.0.25.tar.gz 5955016 SHA256 a4d7ba8d62b2dea702ce76be85699940992daf3f44823ddc128812da33dc6e2c SHA512 b9548646fff13558a4da4a4e9e8bad730f05121bcc65b72d24ded3bfddc6fe574e08c39c8651544b8fbfeab036fffd76cc14d76ef5d5d47e7513a2ce3afcc9df WHIRLPOOL 557a3ac8785c0dd7f98aa55d5edaf76fb5b2b3c86a2431bb40b5b132ac05de3abcb250a8bcf8ed188868c4f124ce0a323a92a5a83c7b44a20908fe40ca323711
+DIST sane-backends-1.0.27.tar.gz 6430188 SHA256 293747bf37275c424ebb2c833f8588601a60b2f9653945d5a3194875355e36c9 SHA512 c6552768bfc10216730fc11011c82f74ca0952182019ded3916072147ec09be5c975ce1d37dc3ccea050c488dbdf983c2ca17dcd702644060ba796ae2591f9c5 WHIRLPOOL 62ac1f4d4601bb2189212f021c23a48067ebdb5d900c2259ae4acdb6f94292c20689d9889bb11861b78be5ea7c3f76e815154e032f4bda76efcf901a97895cdd
+EBUILD sane-backends-1.0.25-r1.ebuild 7883 SHA256 31a194a93efa46cbcfd597e3f4ec28298230b5bdfc69c6942698a4ab63ba3b78 SHA512 2f201d80d12b5138f979b23932101eee82b9379b3110265b02dc8cb2664b9ce803ea774f4278aa52f65a3cb8c3261dcae50183ddf1e2c64be5a79e5209d154f3 WHIRLPOOL ead801902f9f94b9717be3aa45e50727fa8a0823257fadae3fa8e54c586cb7d47689e26a380cba0f800cf7ff558e1c2f3972df7ab6965fe1d0cff9829e18231c
+EBUILD sane-backends-1.0.27.ebuild 7922 SHA256 01d5e5d3c6cb7a971885d76a7f8ac77446dbb9904fd15e01c6b32c257667a7f3 SHA512 8aa67a03e2e552a62bb5b3a7062079bad280c64e2cbebedb2f1dc5f9d3d54f2209246dbfb4842479717454423bd4c61f28fa5551567691e9c6852eab44e7e7e8 WHIRLPOOL f3f2ef3c80363f9471f7bce7b9164117c785fb2f4a7ca6188d9a0c3b847495ae189eaefdb6feafe6b9e4f28198c3899014e254579f30a1675fdf233d5783d3eb
+MISC ChangeLog 5821 SHA256 fa6f96e052c8dfd3e34b0a775e9a2604c9f4b45bb3b2200c40f151e65a467773 SHA512 c8085e7371914acdca025efe83cf25226c32dc58213362b5292cfb54a36a7a8a3e91b196dbffacb5f7d3e886ac006da977a44cd697174dc747abdc8a4b6893ea WHIRLPOOL ebbe0fe42598e339f80cff820d7480be897f0311a5724d8aa7851c1f2b3e24191f35b10faf94d072b57016cb0d558353527202db56629fba288a0deb364ce38d
+MISC ChangeLog-2015 47640 SHA256 c6257e3d197ffa048e4c1e7f01ba4a2516965237fb15dcee476cc914573d3114 SHA512 fbc5f5ca0c8e3c0ad1f2ec241c13dbd5a17d42bd8fd38541f1fccd2effa6e858a996fb4758dbe9a8afefb7586df42094d78de936f22986d5138fbf20241a9e37 WHIRLPOOL ad673ba6b449c6cf6f93cf536fb8fdc8230a24d61048430f9c65bfb1a0b61ecc09543f846b0a838734034a383fd3f190af580175a507802c3fac067f6c88ec20
+MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.24-saned_pidfile_location.patch b/media-gfx/sane-backends/files/sane-backends-1.0.24-saned_pidfile_location.patch
new file mode 100644
index 000000000000..c682961f7c3f
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.24-saned_pidfile_location.patch
@@ -0,0 +1,11 @@
+--- sane-backends-1.0.23/frontend/saned.c
++++ sane-backends-1.0.23/frontend/saned.c
+@@ -221,7 +221,7 @@
+ int numchildren;
+
+ #define SANED_CONFIG_FILE "saned.conf"
+-#define SANED_PID_FILE "/var/run/saned.pid"
++#define SANED_PID_FILE "/var/run/saned/saned.pid"
+
+ #define SANED_SERVICE_NAME "sane-port"
+ #define SANED_SERVICE_PORT 6566
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.25-disable-usb-tests.patch b/media-gfx/sane-backends/files/sane-backends-1.0.25-disable-usb-tests.patch
new file mode 100644
index 000000000000..217a4408e2ff
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.25-disable-usb-tests.patch
@@ -0,0 +1,14 @@
+do not let the tests try reading/locking usb hardware. we also disable
+this because the test will abort() if no usb support is found at all.
+
+--- a/testsuite/sanei/sanei_usb_test.c
++++ b/testsuite/sanei/sanei_usb_test.c
+@@ -832,6 +832,8 @@ main (int argc, char **argv)
+ int detected, opened, i;
+ SANE_Int dn[MAX_DEVICES];
+
++ return 77;
++
+ #ifdef HAVE_LIBUSB
+ printf ("\n%s built with old libusb\n\n", argv[0]);
+ #endif
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.27-disable-usb-tests.patch b/media-gfx/sane-backends/files/sane-backends-1.0.27-disable-usb-tests.patch
new file mode 100644
index 000000000000..6d208b9fbb83
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.27-disable-usb-tests.patch
@@ -0,0 +1,11 @@
+--- a/testsuite/sanei/sanei_usb_test.c~ 2017-05-15 03:19:11.000000000 +0200
++++ b/testsuite/sanei/sanei_usb_test.c 2017-09-27 12:13:57.402803737 +0200
+@@ -832,6 +832,8 @@
+ int detected, opened, i;
+ SANE_Int dn[MAX_DEVICES];
+
++ return 77;
++
+ #ifdef HAVE_LIBUSB_LEGACY
+ printf ("\n%s built with old libusb\n\n", argv[0]);
+ #endif
diff --git a/media-gfx/sane-backends/files/saned b/media-gfx/sane-backends/files/saned
new file mode 100644
index 000000000000..4b3e228eec99
--- /dev/null
+++ b/media-gfx/sane-backends/files/saned
@@ -0,0 +1,10 @@
+service sane-port
+{
+ socket_type = stream
+ server = /usr/sbin/saned
+ protocol = tcp
+ user = saned
+ group = scanner
+ wait = no
+ disable = yes
+}
diff --git a/media-gfx/sane-backends/files/saned.confd b/media-gfx/sane-backends/files/saned.confd
new file mode 100644
index 000000000000..adb1eab2c86b
--- /dev/null
+++ b/media-gfx/sane-backends/files/saned.confd
@@ -0,0 +1,2 @@
+# The user saned should drop its privileges to after startup
+#SANED_USER=""
diff --git a/media-gfx/sane-backends/files/saned.initd b/media-gfx/sane-backends/files/saned.initd
new file mode 100644
index 000000000000..e7f2ebda689b
--- /dev/null
+++ b/media-gfx/sane-backends/files/saned.initd
@@ -0,0 +1,11 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+pidfile="/var/run/saned/saned.pid"
+command="/usr/sbin/saned"
+command_args="-a ${SANED_USER:-root}"
+
+start_pre() {
+ checkpath -d -o ${SANED_USER:-root} ${pidfile%/*}
+}
diff --git a/media-gfx/sane-backends/files/saned.socket b/media-gfx/sane-backends/files/saned.socket
new file mode 100644
index 000000000000..1aa19e703c97
--- /dev/null
+++ b/media-gfx/sane-backends/files/saned.socket
@@ -0,0 +1,10 @@
+[Unit]
+Description=saned incoming socket
+
+[Socket]
+ListenStream=6566
+Accept=yes
+MaxConnections=1
+
+[Install]
+WantedBy=sockets.target
diff --git a/media-gfx/sane-backends/files/saned_at.service b/media-gfx/sane-backends/files/saned_at.service
new file mode 100644
index 000000000000..f3282e44da93
--- /dev/null
+++ b/media-gfx/sane-backends/files/saned_at.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=Scanner Service
+Requires=saned.socket
+
+[Service]
+ExecStart=/usr/sbin/saned
+User=scanner
+Group=scanner
+StandardInput=null
+StandardOutput=syslog
+StandardError=syslog
+Environment=SANE_CONFIG_DIR=@CONFIGDIR@
+# If you need to debug your configuration uncomment the next line and
+# change it as appropriate to set the desired debug options
+# Environment=SANE_DEBUG_DLL=255 SANE_DEBUG_NET=255
+
+[Install]
+Also=saned.socket
diff --git a/media-gfx/sane-backends/metadata.xml b/media-gfx/sane-backends/metadata.xml
new file mode 100644
index 000000000000..6f49eba8f496
--- /dev/null
+++ b/media-gfx/sane-backends/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<!-- maintainer-needed -->
+</pkgmetadata>
diff --git a/media-gfx/sane-backends/sane-backends-1.0.25-r1.ebuild b/media-gfx/sane-backends/sane-backends-1.0.25-r1.ebuild
new file mode 100644
index 000000000000..1a8f79ce3b07
--- /dev/null
+++ b/media-gfx/sane-backends/sane-backends-1.0.25-r1.ebuild
@@ -0,0 +1,346 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils flag-o-matic multilib multilib-minimal udev user toolchain-funcs
+
+# gphoto and v4l are handled by their usual USE flags.
+# The pint backend was disabled because I could not get it to compile.
+IUSE_SANE_BACKENDS="
+ abaton
+ agfafocus
+ apple
+ artec
+ artec_eplus48u
+ as6e
+ avision
+ bh
+ canon
+ canon630u
+ canon_dr
+ canon_pp
+ cardscan
+ coolscan
+ coolscan2
+ coolscan3
+ dc210
+ dc240
+ dc25
+ dell1600n_net
+ dmc
+ epjitsu
+ epson
+ epson2
+ fujitsu
+ genesys
+ gt68xx
+ hp
+ hp3500
+ hp3900
+ hp4200
+ hp5400
+ hp5590
+ hpljm1005
+ hpsj5s
+ hs2p
+ ibm
+ kodak
+ kodakaio
+ kvs1025
+ kvs20xx
+ kvs40xx
+ leo
+ lexmark
+ ma1509
+ magicolor
+ matsushita
+ microtek
+ microtek2
+ mustek
+ mustek_pp
+ mustek_usb
+ mustek_usb2
+ nec
+ net
+ niash
+ p5
+ pie
+ pixma
+ plustek
+ plustek_pp
+ pnm
+ qcam
+ ricoh
+ rts8891
+ s9036
+ sceptre
+ sharp
+ sm3600
+ sm3840
+ snapscan
+ sp15c
+ st400
+ stv680
+ tamarack
+ teco1
+ teco2
+ teco3
+ test
+ u12
+ umax
+ umax1220u
+ umax_pp
+ xerox_mfp"
+
+IUSE="doc gphoto2 ipv6 nls snmp systemd threads usb v4l xinetd zeroconf"
+
+for backend in ${IUSE_SANE_BACKENDS}; do
+ case ${backend} in
+ # Disable backends that require parallel ports as no one has those anymore.
+ canon_pp|hpsj5s|mustek_pp|\
+ pnm)
+ IUSE+=" -sane_backends_${backend}"
+ ;;
+ mustek_usb2|kvs40xx)
+ IUSE+=" sane_backends_${backend}"
+ ;;
+ *)
+ IUSE+=" +sane_backends_${backend}"
+ esac
+done
+
+REQUIRED_USE="
+ sane_backends_mustek_usb2? ( threads )
+ sane_backends_kvs40xx? ( threads )
+"
+
+DESCRIPTION="Scanner Access Now Easy - Backends"
+HOMEPAGE="http://www.sane-project.org/"
+case ${PV} in
+9999)
+ EGIT_REPO_URI="git://anonscm.debian.org/sane/sane-backends.git"
+ inherit git-r3 autotools
+ ;;
+*_pre*)
+ MY_P="${PN}-git${PV#*_pre}"
+ SRC_URI="http://www.sane-project.org/snapshots/${MY_P}.tar.gz
+ mirror://gentoo/${MY_P}.tar.gz"
+ S=${WORKDIR}/${MY_P}
+ ;;
+*)
+ MY_P=${P}
+ FRS_ID="4146"
+ SRC_URI="https://alioth.debian.org/frs/download.php/file/${FRS_ID}/${P}.tar.gz"
+ ;;
+esac
+
+LICENSE="GPL-2 public-domain"
+SLOT="0"
+if [[ ${PV} != "9999" ]] ; then
+ KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+fi
+
+RDEPEND="
+ sane_backends_dc210? ( >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] )
+ sane_backends_dc240? ( >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] )
+ sane_backends_dell1600n_net? (
+ >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}]
+ >=media-libs/tiff-3.9.7-r1:0=[${MULTILIB_USEDEP}]
+ )
+ sane_backends_canon_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
+ sane_backends_hpsj5s? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
+ sane_backends_mustek_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
+ usb? ( >=virtual/libusb-1-r1:1=[${MULTILIB_USEDEP}] )
+ gphoto2? (
+ >=media-libs/libgphoto2-2.5.3.1:=[${MULTILIB_USEDEP}]
+ >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}]
+ )
+ v4l? ( >=media-libs/libv4l-0.9.5[${MULTILIB_USEDEP}] )
+ xinetd? ( sys-apps/xinetd )
+ snmp? ( net-analyzer/net-snmp )
+ systemd? ( sys-apps/systemd:0= )
+ zeroconf? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] )
+"
+
+DEPEND="${RDEPEND}
+ v4l? ( sys-kernel/linux-headers )
+ doc? (
+ virtual/latex-base
+ dev-texlive/texlive-latexextra
+ )
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]"
+
+# We now use new syntax construct (SUBSYSTEMS!="usb|usb_device)
+RDEPEND="${RDEPEND}
+ !<sys-fs/udev-114"
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/sane-config
+)
+
+pkg_setup() {
+ enewgroup scanner
+ enewuser saned -1 -1 -1 scanner
+}
+
+src_prepare() {
+ cat >> backend/dll.conf.in <<-EOF
+ # Add support for the HP-specific backend. Needs net-print/hplip installed.
+ hpaio
+ # Add support for the Epson-specific backend. Needs media-gfx/iscan installed.
+ epkowa
+ EOF
+ epatch "${FILESDIR}"/${PN}-1.0.24-saned_pidfile_location.patch
+ epatch "${FILESDIR}"/${PN}-1.0.25-disable-usb-tests.patch
+ if [[ ${PV} == "9999" ]] ; then
+ mv configure.{in,ac} || die
+ AT_NOELIBTOOLIZE=yes eautoreconf
+ fi
+
+ # Fix for "make check". Upstream sometimes forgets to update this.
+ local ver=$(./configure --version | awk '{print $NF; exit 0}')
+ sed -i \
+ -e "/by sane-desc 3.5 from sane-backends/s:sane-backends .*:sane-backends ${ver}:" \
+ testsuite/tools/data/html* || die
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+
+ # if LINGUAS is set, just use the listed and supported localizations.
+ if [[ ${LINGUAS+set} == "set" ]]; then
+ mkdir -p po || die
+ strip-linguas -u po
+ printf '%s\n' ${LINGUAS} > po/LINGUAS
+ fi
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ # the blank is intended - an empty string would result in building ALL backends.
+ local BACKENDS=" "
+
+ use gphoto2 && BACKENDS="gphoto2"
+ use v4l && BACKENDS="${BACKENDS} v4l"
+ for backend in ${IUSE_SANE_BACKENDS}; do
+ if use "sane_backends_${backend}" && [ ${backend} != pnm ]; then
+ BACKENDS="${BACKENDS} ${backend}"
+ fi
+ done
+
+ local myconf=(
+ $(use_enable usb libusb_1_0)
+ $(multilib_native_use_with snmp)
+ )
+
+ # you can only enable this backend, not disable it...
+ if use sane_backends_pnm; then
+ myconf+=( --enable-pnm-backend )
+ fi
+ if ! use doc; then
+ myconf+=( --disable-latex )
+ fi
+ if use sane_backends_mustek_pp; then
+ myconf+=( --enable-parport-directio )
+ fi
+ if ! { use sane_backends_canon_pp || use sane_backends_hpsj5s || use sane_backends_mustek_pp; }; then
+ myconf+=( sane_cv_use_libieee1284=no )
+ fi
+
+ # relative path must be used for tests to work properly
+ ECONF_SOURCE=${S} \
+ SANEI_JPEG="sanei_jpeg.o" SANEI_JPEG_LO="sanei_jpeg.lo" \
+ BACKENDS="${BACKENDS}" \
+ econf \
+ $(use_with gphoto2) \
+ $(multilib_native_use_with systemd) \
+ $(use_with v4l) \
+ $(use_enable ipv6) \
+ $(use_enable nls translations) \
+ $(use_enable threads pthread) \
+ $(use_enable zeroconf avahi) \
+ "${myconf[@]}"
+}
+
+multilib_src_compile() {
+ emake VARTEXFONTS="${T}/fonts"
+
+ if tc-is-cross-compiler; then
+ pushd "${BUILD_DIR}"/tools >/dev/null || die
+
+ # The build system sucks and doesn't handle this properly.
+ # https://alioth.debian.org/tracker/index.php?func=detail&aid=314236&group_id=30186&atid=410366
+ tc-export_build_env BUILD_CC
+ ${BUILD_CC} ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \
+ -I. -I../include -I"${S}"/include \
+ "${S}"/sanei/sanei_config.c "${S}"/sanei/sanei_constrain_value.c \
+ "${S}"/sanei/sanei_init_debug.c "${S}"/tools/sane-desc.c -o sane-desc || die
+ local dirs=( hal hotplug hotplug-ng udev )
+ local targets=(
+ hal/libsane.fdi
+ hotplug/libsane.usermap
+ hotplug-ng/libsane.db
+ udev/libsane.rules
+ )
+ mkdir -p "${dirs[@]}" || die
+ emake "${targets[@]}"
+
+ popd >/dev/null
+ fi
+
+ if use usb; then
+ sed -i -e '/^$/d' \
+ tools/hotplug/libsane.usermap || die
+ fi
+}
+
+multilib_src_install() {
+ emake INSTALL_LOCKPATH="" DESTDIR="${D}" install \
+ docdir="${EPREFIX}"/usr/share/doc/${PF}
+
+ if multilib_is_native_abi; then
+ if use usb; then
+ insinto /etc/hotplug/usb
+ doins tools/hotplug/libsane.usermap
+ fi
+
+ udev_newrules tools/udev/libsane.rules 41-libsane.rules
+ insinto "/usr/share/pkgconfig"
+ doins tools/sane-backends.pc
+ fi
+}
+
+multilib_src_install_all() {
+ keepdir /var/lib/lock/sane
+ fowners root:scanner /var/lib/lock/sane
+ fperms g+w /var/lib/lock/sane
+ dodir /etc/env.d
+
+ if use usb; then
+ exeinto /etc/hotplug/usb
+ doexe tools/hotplug/libusbscanner
+ newdoc tools/hotplug/README README.hotplug
+ fi
+
+ dodoc NEWS AUTHORS ChangeLog* PROBLEMS README README.linux
+ prune_libtool_files --all
+ if use xinetd; then
+ insinto /etc/xinetd.d
+ doins "${FILESDIR}"/saned
+ fi
+
+ newinitd "${FILESDIR}"/saned.initd saned
+ newconfd "${FILESDIR}"/saned.confd saned
+}
+
+pkg_postinst() {
+ if use xinetd; then
+ elog "If you want remote clients to connect, edit"
+ elog "/etc/sane.d/saned.conf and /etc/hosts.allow"
+ fi
+
+ elog "If you are using a USB scanner, add all users who want"
+ elog "to access your scanner to the \"scanner\" group."
+}
diff --git a/media-gfx/sane-backends/sane-backends-1.0.27.ebuild b/media-gfx/sane-backends/sane-backends-1.0.27.ebuild
new file mode 100644
index 000000000000..b74b5565a8e7
--- /dev/null
+++ b/media-gfx/sane-backends/sane-backends-1.0.27.ebuild
@@ -0,0 +1,349 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit flag-o-matic ltprune multilib-minimal systemd toolchain-funcs udev user
+
+# gphoto and v4l are handled by their usual USE flags.
+# The pint backend was disabled because I could not get it to compile.
+IUSE_SANE_BACKENDS="
+ abaton
+ agfafocus
+ apple
+ artec
+ artec_eplus48u
+ as6e
+ avision
+ bh
+ canon
+ canon630u
+ canon_dr
+ canon_pp
+ cardscan
+ coolscan
+ coolscan2
+ coolscan3
+ dc210
+ dc240
+ dc25
+ dell1600n_net
+ dmc
+ epjitsu
+ epson
+ epson2
+ fujitsu
+ genesys
+ gt68xx
+ hp
+ hp3500
+ hp3900
+ hp4200
+ hp5400
+ hp5590
+ hpljm1005
+ hpsj5s
+ hs2p
+ ibm
+ kodak
+ kodakaio
+ kvs1025
+ kvs20xx
+ kvs40xx
+ leo
+ lexmark
+ ma1509
+ magicolor
+ matsushita
+ microtek
+ microtek2
+ mustek
+ mustek_pp
+ mustek_usb
+ mustek_usb2
+ nec
+ net
+ niash
+ p5
+ pie
+ pixma
+ plustek
+ plustek_pp
+ pnm
+ qcam
+ ricoh
+ rts8891
+ s9036
+ sceptre
+ sharp
+ sm3600
+ sm3840
+ snapscan
+ sp15c
+ st400
+ stv680
+ tamarack
+ teco1
+ teco2
+ teco3
+ test
+ u12
+ umax
+ umax1220u
+ umax_pp
+ xerox_mfp"
+
+IUSE="gphoto2 ipv6 snmp systemd threads usb v4l xinetd zeroconf"
+
+for backend in ${IUSE_SANE_BACKENDS}; do
+ case ${backend} in
+ # Disable backends that require parallel ports as no one has those anymore.
+ canon_pp|hpsj5s|mustek_pp|\
+ pnm)
+ IUSE+=" -sane_backends_${backend}"
+ ;;
+ mustek_usb2|kvs40xx)
+ IUSE+=" sane_backends_${backend}"
+ ;;
+ *)
+ IUSE+=" +sane_backends_${backend}"
+ esac
+done
+
+REQUIRED_USE="
+ sane_backends_mustek_usb2? ( threads )
+ sane_backends_kvs40xx? ( threads )
+"
+
+DESCRIPTION="Scanner Access Now Easy - Backends"
+HOMEPAGE="http://www.sane-project.org/"
+case ${PV} in
+9999)
+ EGIT_REPO_URI="git://anonscm.debian.org/sane/sane-backends.git"
+ inherit git-r3 autotools
+ ;;
+*_pre*)
+ MY_P="${PN}-git${PV#*_pre}"
+ SRC_URI="http://www.sane-project.org/snapshots/${MY_P}.tar.gz
+ mirror://gentoo/${MY_P}.tar.gz"
+ S=${WORKDIR}/${MY_P}
+ ;;
+*)
+ MY_P=${P}
+ FRS_ID="4224"
+ SRC_URI="https://alioth.debian.org/frs/download.php/file/${FRS_ID}/${P}.tar.gz"
+ ;;
+esac
+
+LICENSE="GPL-2 public-domain"
+SLOT="0"
+if [[ ${PV} != "9999" ]] ; then
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+fi
+
+RDEPEND="
+ sane_backends_dc210? ( >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] )
+ sane_backends_dc240? ( >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}] )
+ sane_backends_dell1600n_net? (
+ >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}]
+ >=media-libs/tiff-3.9.7-r1:0=[${MULTILIB_USEDEP}]
+ )
+ sane_backends_canon_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
+ sane_backends_hpsj5s? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
+ sane_backends_mustek_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
+ usb? ( >=virtual/libusb-1-r1:1=[${MULTILIB_USEDEP}] )
+ gphoto2? (
+ >=media-libs/libgphoto2-2.5.3.1:=[${MULTILIB_USEDEP}]
+ >=virtual/jpeg-0-r2:0=[${MULTILIB_USEDEP}]
+ )
+ v4l? ( >=media-libs/libv4l-0.9.5[${MULTILIB_USEDEP}] )
+ xinetd? ( sys-apps/xinetd )
+ snmp? ( net-analyzer/net-snmp )
+ systemd? ( sys-apps/systemd:0= )
+ zeroconf? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] )
+"
+
+DEPEND="${RDEPEND}
+ v4l? ( sys-kernel/linux-headers )
+ >=sys-devel/gettext-0.18.1
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
+"
+
+# We now use new syntax construct (SUBSYSTEMS!="usb|usb_device)
+RDEPEND="${RDEPEND}
+ !<sys-fs/udev-114
+"
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/sane-config
+)
+
+pkg_setup() {
+ enewgroup scanner
+ enewuser saned -1 -1 -1 scanner
+}
+
+src_prepare() {
+ default
+
+ cat >> backend/dll.conf.in <<-EOF
+ # Add support for the HP-specific backend. Needs net-print/hplip installed.
+ hpaio
+ # Add support for the Epson-specific backend. Needs media-gfx/iscan installed.
+ epkowa
+ EOF
+
+ eapply "${FILESDIR}"/${PN}-1.0.24-saned_pidfile_location.patch
+ eapply "${FILESDIR}"/${PN}-1.0.27-disable-usb-tests.patch
+
+ if [[ ${PV} == "9999" ]] ; then
+ mv configure.{in,ac} || die
+ AT_NOELIBTOOLIZE=yes eautoreconf
+ fi
+
+ # Fix for "make check". Upstream sometimes forgets to update this.
+ local ver=$(./configure --version | awk '{print $NF; exit 0}')
+ sed -i \
+ -e "/by sane-desc 3.5 from sane-backends/s:sane-backends .*:sane-backends ${ver}:" \
+ testsuite/tools/data/html* || die
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing # bug?????
+
+ # if LINGUAS is set, just use the listed and supported localizations.
+ if [[ ${LINGUAS+set} == "set" ]]; then
+ mkdir -p po || die
+ strip-linguas -u po
+ printf '%s\n' ${LINGUAS} > po/LINGUAS
+ fi
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ # the blank is intended - an empty string would result in building ALL backends.
+ local BACKENDS=" "
+
+ use gphoto2 && BACKENDS="gphoto2"
+ use v4l && BACKENDS="${BACKENDS} v4l"
+ for backend in ${IUSE_SANE_BACKENDS}; do
+ if use "sane_backends_${backend}" && [ ${backend} != pnm ]; then
+ BACKENDS="${BACKENDS} ${backend}"
+ fi
+ done
+
+ local myconf=(
+ $(use_with usb)
+ $(multilib_native_use_with snmp)
+ )
+
+ # you can only enable this backend, not disable it...
+ if use sane_backends_pnm; then
+ myconf+=( --enable-pnm-backend )
+ fi
+ if use sane_backends_mustek_pp; then
+ myconf+=( --enable-parport-directio )
+ fi
+ if ! { use sane_backends_canon_pp || use sane_backends_hpsj5s || use sane_backends_mustek_pp; }; then
+ myconf+=( sane_cv_use_libieee1284=no )
+ fi
+
+ # relative path must be used for tests to work properly
+ ECONF_SOURCE=${S} \
+ SANEI_JPEG="sanei_jpeg.o" SANEI_JPEG_LO="sanei_jpeg.lo" \
+ BACKENDS="${BACKENDS}" \
+ econf \
+ $(use_with gphoto2) \
+ $(multilib_native_use_with systemd) \
+ $(use_with v4l) \
+ $(use_enable ipv6) \
+ $(use_enable threads pthread) \
+ $(use_enable zeroconf avahi) \
+ "${myconf[@]}"
+}
+
+multilib_src_compile() {
+ emake VARTEXFONTS="${T}/fonts"
+
+ if tc-is-cross-compiler; then
+ pushd "${BUILD_DIR}"/tools >/dev/null || die
+
+ # The build system sucks and doesn't handle this properly.
+ # https://alioth.debian.org/tracker/index.php?func=detail&aid=314236&group_id=30186&atid=410366
+ tc-export_build_env BUILD_CC
+ ${BUILD_CC} ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \
+ -I. -I../include -I"${S}"/include \
+ "${S}"/sanei/sanei_config.c "${S}"/sanei/sanei_constrain_value.c \
+ "${S}"/sanei/sanei_init_debug.c "${S}"/tools/sane-desc.c -o sane-desc || die
+ local dirs=( hal hotplug hotplug-ng udev )
+ local targets=(
+ hal/libsane.fdi
+ hotplug/libsane.usermap
+ hotplug-ng/libsane.db
+ udev/libsane.rules
+ )
+ mkdir -p "${dirs[@]}" || die
+ emake "${targets[@]}"
+
+ popd >/dev/null
+ fi
+
+ if use usb; then
+ sed -i -e '/^$/d' \
+ tools/hotplug/libsane.usermap || die
+ fi
+}
+
+multilib_src_install() {
+ emake INSTALL_LOCKPATH="" DESTDIR="${D}" install \
+ docdir="${EPREFIX}"/usr/share/doc/${PF}
+
+ if multilib_is_native_abi; then
+ if use usb; then
+ insinto /etc/hotplug/usb
+ doins tools/hotplug/libsane.usermap
+ fi
+
+ udev_newrules tools/udev/libsane.rules 41-libsane.rules
+ insinto "/usr/share/pkgconfig"
+ doins tools/sane-backends.pc
+ fi
+}
+
+multilib_src_install_all() {
+ keepdir /var/lib/lock/sane
+ fowners root:scanner /var/lib/lock/sane
+ fperms g+w /var/lib/lock/sane
+ dodir /etc/env.d
+
+ if use systemd; then
+ systemd_newunit "${FILESDIR}"/saned_at.service "saned@.service"
+ systemd_newunit "${FILESDIR}"/saned.socket saned.socket
+ fi
+
+ if use usb; then
+ exeinto /etc/hotplug/usb
+ doexe tools/hotplug/libusbscanner
+ newdoc tools/hotplug/README README.hotplug
+ fi
+
+ dodoc NEWS AUTHORS ChangeLog* PROBLEMS README README.linux
+ prune_libtool_files --modules
+ if use xinetd; then
+ insinto /etc/xinetd.d
+ doins "${FILESDIR}"/saned
+ fi
+
+ newinitd "${FILESDIR}"/saned.initd saned
+ newconfd "${FILESDIR}"/saned.confd saned
+}
+
+pkg_postinst() {
+ if use xinetd; then
+ elog "If you want remote clients to connect, edit"
+ elog "/etc/sane.d/saned.conf and /etc/hosts.allow"
+ fi
+
+ elog "If you are using a USB scanner, add all users who want"
+ elog "to access your scanner to the \"scanner\" group."
+}