pantum-driver 1.1.166

Драйверы CUPS и SANE для принтеров и сканеров Pantum

Не проверено
 1sfe_249_new_extractor=1
 2
 3name=pantum-driver
 4version=1.1.166
 5release=1
 6summary="CUPS and SANE drivers for Pantum printers and scanners"
 7summary_ru="Драйверы CUPS и SANE для принтеров и сканеров Pantum"
 8group="System/Configuration/Printing"
 9desc="$summary."
10maintainer="Ajrat Makhmutov <rauty@altlinux.org>"
11architectures=("amd64")
12homepage="https://www.pantum.ru"
13license=("custom")
14
15nonfree=1
16nonfree_url="https://www.pantum.com/"
17nonfree_msgfile=license.txt
18
19provides=()
20conflicts=()
21
22# Pantum's primary CDN (drivers.pantum.com) blocks automated downloads with a
23# Tengine anti-bot ACL, so we use the pantum.ru mirror, which serves the ZIP
24# directly.
25sources=(
26	"https://www.pantum.ru/wp-content/uploads/2026/05/pantum-linux-driver-v${version}.zip"
27)
28
29checksums=(
30	sha256:06735f13f27b5aa3e2d423e3bf4036d4266ad37f4105feae05d2cac6012b4916
31)
32
33scripts=(
34	['postinstall']='postinstall.sh'
35)
36
37build_deps=(
38	bsdtar
39	binutils
40)
41
42deps=(
43	cups
44	sane
45)
46
47auto_reqprov_method=dirty
48auto_req=1
49auto_prov=1
50
51disable_network=1
52
53prepare() {
54	# The new extractor only unpacks the outer ZIP; the inner .deb has to be
55	# opened by hand. The driver directory name contains spaces and dots.
56	cd "$srcdir"/Pantum*Linux*Driver*/Resources
57	bsdtar -xf pantum_*_amd64.deb data.tar.xz
58	mkdir -p "$srcdir/data"
59	# --no-same-owner: the build runs in a user namespace (root inside), so
60	# restoring the archived root ownership would fail with a chown error.
61	tar --no-same-owner -xf data.tar.xz -C "$srcdir/data"
62}
63
64package() {
65	cd "$srcdir/data"
66
67	# /opt without the vendored ipp-usb (ALT ships its own ipp-usb).
68	install -d "$pkgdir/opt/pantum"
69	cp -a opt/pantum/bin opt/pantum/lib "$pkgdir/opt/pantum/"
70
71	# CUPS filters and PPD models: paths match ALT, copy as-is.
72	cp -a --parents usr/lib/cups/filter usr/share/cups/model "$pkgdir/"
73
74	# SANE backends: Debian multiarch -> /usr/lib64/sane (where ALT sane looks).
75	install -d "$pkgdir/usr/lib64/sane"
76	cp -a usr/lib/x86_64-linux-gnu/sane/* "$pkgdir/usr/lib64/sane/"
77
78	# SANE configs and udev rules (the /usr/local duplicates are dropped).
79	cp -a --parents etc/sane.d etc/udev/rules.d "$pkgdir/"
80}
81
82files() {
83	# ptqpdf lives in /opt/pantum/bin, not /usr/bin, so it is covered by the
84	# /opt/pantum glob below rather than files-find-binary.
85	files-find \
86		"/opt/pantum/**/*" \
87		"/usr/lib/cups/filter/*" \
88		"/usr/lib64/sane/**/*" \
89		"/usr/share/cups/model/**/*" \
90		"/etc/sane.d/**/*" \
91		"/etc/udev/rules.d/60-pantum_*.rules"
92}