4b97cd2fb4
```sh git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" | while read template; do for p in ${template%/template}/patches/*; do sed -i ' \,^[+-][+-][+-] /dev/null,b /^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b s,^[*][*][*] ,&a/, /^--- /{ s,\(^--- \)\(./\)*,\1a/, s,[.-][Oo][Rr][Ii][Gg]\([ /]\),\1, s/[.-][Oo][Rr][Ii][Gg]$// s/[.]patched[.]\([^.]\)/.\1/ h } /^+++ -/{ g s/^--- a/+++ b/ b } s,\(^+++ \)\(./\)*,\1b/, ' "$p" done sed -i '/^patch_args=/d' $template done ```
62 lines
1.8 KiB
Bash
62 lines
1.8 KiB
Bash
# Template file for 'sane'
|
|
pkgname=sane
|
|
_gitlab_release_hash=8bf1cae2e1803aefab9e5331550e5d5d
|
|
version=1.0.31
|
|
revision=3
|
|
wrksrc="sane-backends-${version}"
|
|
build_style=gnu-configure
|
|
configure_args="--disable-locking --enable-ipv6 --enable-pthread
|
|
--with-usb --docdir=/usr/share/doc/sane ac_cv_func_mmap_fixed_mapped=yes
|
|
$(vopt_with snmp)"
|
|
hostmakedepends="pkg-config"
|
|
makedepends="avahi-libs-devel libjpeg-turbo-devel tiff-devel libgphoto2-devel
|
|
v4l-utils-devel libusb-devel openssl-devel libxml2-devel
|
|
$(vopt_if snmp net-snmp-devel)"
|
|
depends="$(vopt_if snmp net-snmp)"
|
|
conf_files="/etc/sane.d/*.conf"
|
|
short_desc="Scanner Access Now Easy"
|
|
maintainer="Piraty <piraty1@inbox.ru>"
|
|
license="GPL-2.0-or-later, SANE-exception"
|
|
homepage="http://www.sane-project.org/"
|
|
distfiles="https://gitlab.com/sane-project/backends/uploads/${_gitlab_release_hash}/sane-backends-${version}.tar.gz"
|
|
checksum=4a3b10fcb398ed854777d979498645edfe66fcac2f2fd2b9117a79ff45e2a5aa
|
|
noshlibprovides="avoid false detection of device drivers"
|
|
|
|
build_options="snmp"
|
|
|
|
post_build() {
|
|
# generate udev file
|
|
cd tools
|
|
mkdir -p udev
|
|
make udev/libsane.rules
|
|
}
|
|
|
|
post_install() {
|
|
vinstall ${FILESDIR}/saned.xinetd 644 etc/xinetd.d saned.conf
|
|
vinstall ${wrksrc}/tools/sane-backends.pc 644 usr/lib/pkgconfig
|
|
|
|
vinstall tools/udev/libsane.rules 644 usr/lib/udev/rules.d 49-sane.rules
|
|
|
|
vlicense LICENSE # License clarification
|
|
vlicense COPYING # GPL-2.0
|
|
sed -n "1,43 p" "${wrksrc}/backend/dll.c" > "${DESTDIR}/usr/share/licenses/sane/SANE-EXCEPTION"
|
|
}
|
|
|
|
libsane_package() {
|
|
short_desc+=" - runtime shared library"
|
|
pkg_install() {
|
|
vmove "usr/lib/libsane.so.*"
|
|
}
|
|
}
|
|
|
|
sane-devel_package() {
|
|
depends="libsane>=${version}_${revision}"
|
|
short_desc+=" - development files"
|
|
pkg_install() {
|
|
vmove usr/include
|
|
vmove usr/bin/sane-config
|
|
vmove usr/share/man/man1/sane-config.1
|
|
vmove usr/lib/pkgconfig
|
|
vmove "usr/lib/*.so"
|
|
}
|
|
}
|