From 137b1bd25baf6620d19a9cbec82da454de8021da Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Fri, 25 Oct 2024 19:15:30 +0300 Subject: [PATCH] import sane-airscan-0.99.27-13.el10 --- .gitignore | 1 + .sane-airscan.metadata | 1 + ...ixed-missed-include-stdlib.h-see-305.patch | 26 +++ ...-recent-versions-of-libxml2-fixes-30.patch | 33 +++ SPECS/sane-airscan.spec | 207 ++++++++++++++++++ 5 files changed, 268 insertions(+) create mode 100644 .gitignore create mode 100644 .sane-airscan.metadata create mode 100644 SOURCES/0001-Fixed-missed-include-stdlib.h-see-305.patch create mode 100644 SOURCES/0002-Fixed-build-with-recent-versions-of-libxml2-fixes-30.patch create mode 100644 SPECS/sane-airscan.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d56d646 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/sane-airscan-0.99.27.tar.gz diff --git a/.sane-airscan.metadata b/.sane-airscan.metadata new file mode 100644 index 0000000..ef1cb6b --- /dev/null +++ b/.sane-airscan.metadata @@ -0,0 +1 @@ +c04f59918bb88ace88a98818e33ea58520d9795f SOURCES/sane-airscan-0.99.27.tar.gz diff --git a/SOURCES/0001-Fixed-missed-include-stdlib.h-see-305.patch b/SOURCES/0001-Fixed-missed-include-stdlib.h-see-305.patch new file mode 100644 index 0000000..af82992 --- /dev/null +++ b/SOURCES/0001-Fixed-missed-include-stdlib.h-see-305.patch @@ -0,0 +1,26 @@ +From c042a6895fe6f663d4bcb8c27d1c7b34fbd68b48 Mon Sep 17 00:00:00 2001 +From: Alexander Pevzner +Date: Sat, 2 Dec 2023 21:49:40 +0300 +Subject: [PATCH 1/2] Fixed missed #include (see #305) + +This code used to compile on everywhere, but explicit #include +was actually missed. Seems that sometimes it can cause problems. +--- + airscan-xml.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/airscan-xml.c b/airscan-xml.c +index f376f31..5071ca9 100644 +--- a/airscan-xml.c ++++ b/airscan-xml.c +@@ -9,6 +9,7 @@ + #include "airscan.h" + + #include ++#include + + #include + #include +-- +2.43.0 + diff --git a/SOURCES/0002-Fixed-build-with-recent-versions-of-libxml2-fixes-30.patch b/SOURCES/0002-Fixed-build-with-recent-versions-of-libxml2-fixes-30.patch new file mode 100644 index 0000000..74681a7 --- /dev/null +++ b/SOURCES/0002-Fixed-build-with-recent-versions-of-libxml2-fixes-30.patch @@ -0,0 +1,33 @@ +From 144e7d4187c73566ffc2780ac91ab7e1826826e0 Mon Sep 17 00:00:00 2001 +From: Alexander Pevzner +Date: Sat, 2 Dec 2023 22:29:55 +0300 +Subject: [PATCH 2/2] Fixed build with recent versions of libxml2 (fixes #305) + +libxml2 recently changed a prototype of the xmlStructuredErrorFunc callback, +adding const modifier to the second parameter. + +Adding an explicit cast seems to fix the problem (but I will not be surprised, if +this fix will not work equally well on all distros). + +Found for a first time and fixed on Arch linux on about 2 Dec 2023 (Arch is rolling +release, so there is no explicit release number) +--- + airscan-xml.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/airscan-xml.c b/airscan-xml.c +index 5071ca9..10f290c 100644 +--- a/airscan-xml.c ++++ b/airscan-xml.c +@@ -124,7 +124,7 @@ xml_rd_parse (xmlDoc **doc, const char *xml_text, size_t xml_len) + goto DONE; + } + +- ctxt->sax->serror = xml_rd_error_callback; ++ ctxt->sax->serror = (xmlStructuredErrorFunc) xml_rd_error_callback; + + /* Parse the document */ + if (xmlCtxtResetPush(ctxt, xml_text, xml_len, NULL, NULL)) { +-- +2.43.0 + diff --git a/SPECS/sane-airscan.spec b/SPECS/sane-airscan.spec new file mode 100644 index 0000000..0dd022e --- /dev/null +++ b/SPECS/sane-airscan.spec @@ -0,0 +1,207 @@ +# the package gets input from scanner devices from network +# can be possibly dangerous if an attacker camouflages himself +# as a scanner +%global _hardened_build 1 + +Name: sane-airscan +Version: 0.99.27 +Release: 13%{?dist} +Summary: SANE backend for AirScan (eSCL) and WSD document scanners +# SANE related source and header files - GPL 2.0+ with SANE exception +# http_parser.c/.h - MIT +# the exception is defined in LICENSE, meant for SANE project in most cases +License: GPL-2.0-or-later WITH SANE-exception AND MIT +URL: https://github.com/alexpevzner/sane-airscan +Source: %{URL}/archive/%{version}/%{name}-%{version}.tar.gz + +# backported from upstream +# https://github.com/alexpevzner/sane-airscan/commit/c042a6895 - missing stdlib +Patch001: 0001-Fixed-missed-include-stdlib.h-see-305.patch +# https://github.com/alexpevzner/sane-airscan/commit/144e7d4187 - fix warning by conversion +Patch002: 0002-Fixed-build-with-recent-versions-of-libxml2-fixes-30.patch + + +# needed for querying and getting mDNS messages from local network +BuildRequires: avahi-devel +# project is written in C +BuildRequires: gcc +# fuzzer for testing is written in C++ +BuildRequires: gcc-c++ +# git is used during autosetup +BuildRequires: git-core +# creating credentials and SHA256 for UUID +BuildRequires: gnutls-devel +# needed for creating output image +BuildRequires: libjpeg-turbo-devel, libpng-devel +# XML data are carried on HTTP protocol, we need to create them and parse them +BuildRequires: libxml2-devel +# uses meson +BuildRequires: meson +# used in Makefile to get the correct compile and link flags +BuildRequires: pkgconf-pkg-config +# package is meant to be as one of SANE backends - it uses SANE API for handling +# devices, strings, words (bytes) and backend itself +BuildRequires: sane-backends-devel + +%if 0%{?fedora} >= 38 || 0%{?rhel} >= 9 +Recommends: ipp-usb +%endif + +# needs shared library implementing the backend +Requires: libsane-airscan%{?_isa} = %{version}-%{release} + +%description +This package contains a tool for discovering scanning devices in cases +when automatic discovery fails - airscan-discover. + +%package -n libsane-airscan +Summary: SANE backend for eSCL or WSD + +# USB scanners which support IPP-over-USB interface can communicate +# via sane-airscan once ipp-usb brings up an IPP interface for them +# remove for now until migration app is implemented +#Recommends: ipp-usb + +%description -n libsane-airscan +This package contain a SANE backend for MFP and document scanners that +implements either eSCL (AirScan/AirPrint scanning) or WSD "driverless" +scanning protocol. + + +%prep +%autosetup -S git + +%build +%meson +%meson_build + +%check +%meson_test + +%install +%meson_install + +rm -f %{buildroot}%{_libdir}/sane/libsane-airscan.so + +%files +%license COPYING LICENSE +%{_bindir}/airscan-discover +# I'm not fond of wildcards in %%files, but FPG demands it for manpages +%{_mandir}/man1/airscan-discover.1* + +%files -n libsane-airscan +%license COPYING LICENSE +%dir %{_sysconfdir}/sane.d +%config(noreplace) %{_sysconfdir}/sane.d/airscan.conf +%dir %{_sysconfdir}/sane.d/dll.d +%config(noreplace) %{_sysconfdir}/sane.d/dll.d/airscan +%dir %{_libdir}/sane +%{_libdir}/sane/libsane-airscan.so.1 +# I'm not fond of wildcards in %%files, but FPG demands it for manpages +%{_mandir}/man5/sane-airscan.5* + + +%changelog +* Mon Jun 24 2024 Troy Dawson - 0.99.27-13 +- Bump release for June 2024 mass rebuild + +* Sat Jan 27 2024 Fedora Release Engineering - 0.99.27-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Dec 08 2023 Zdenek Dohnal - 0.99.27-11 +- fix FTBFS + +* Wed Aug 30 2023 Zdenek Dohnal - 0.99.27-10 +- applied accepted license exception - SANE-exception + +* Sat Jul 22 2023 Fedora Release Engineering - 0.99.27-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Feb 23 2023 Zdenek Dohnal - 0.99.27-8 +- move to meson + +* Thu Feb 02 2023 Zdenek Dohnal - 0.99.27-7 +- 2165612 - IPP-USB as a weak dependency of CUPS and sane-airscan + +* Sat Jan 21 2023 Fedora Release Engineering - 0.99.27-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sat Jul 23 2022 Fedora Release Engineering - 0.99.27-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Thu Mar 31 2022 Zdenek Dohnal - 0.99.27-4 +- remove ipp-usb for now until there is a migration path + +* Wed Mar 23 2022 Zdenek Dohnal - 0.99.27-3 +- recommend ipp-usb in case of USB scanner capable of IPP-over-USB + +* Sat Jan 22 2022 Fedora Release Engineering - 0.99.27-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Mon Oct 11 2021 Zdenek Dohnal - 0.99.27-1 +- 2012253 - sane-airscan-0.99.27 is available + +* Fri Jul 23 2021 Fedora Release Engineering - 0.99.26-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Mon Apr 19 2021 Zdenek Dohnal - 0.99.26-1 +- 1949055 - sane-airscan-0.99.26 is available + +* Thu Feb 04 2021 Zdenek Dohnal - 0.99.24-1 +- 1922563 - sane-airscan-0.99.24 is available + +* Wed Jan 27 2021 Fedora Release Engineering - 0.99.23-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Mon Jan 11 2021 Zdenek Dohnal - 0.99.23-1 +- 1914565 - sane-airscan-0.99.23 is available + +* Tue Dec 15 2020 Zdenek Dohnal - 0.99.22-1 +- 1906510 - sane-airscan-0.99.22 is available + +* Tue Nov 24 2020 Zdenek Dohnal - 0.99.21-1 +- 0.99.21 + +* Mon Nov 23 2020 Zdenek Dohnal - 0.99.20-1 +- 1900160 - sane-airscan-0.99.20 is available +- 1897935 - Crash on libsane-airscan when trying to activate scanner + +* Wed Nov 18 2020 Zdenek Dohnal - 0.99.19-1 +- 1890866 - sane-airscan-0.99.19 is available + +* Thu Nov 05 2020 Zdenek Dohnal - 0.99.18-2 +- make is no longer in buildroot by default +- use smaller git-core instead of git + +* Tue Oct 20 2020 Zdenek Dohnal - 0.99.18-1 +- 1887870 - sane-airscan-0.99.18 is available + +* Fri Oct 09 2020 Zdenek Dohnal - 0.99.17-1 +- 1886593 - sane-airscan-0.99.17 is available + +* Mon Oct 05 2020 Zdenek Dohnal - 0.99.16-2 +- 1882520 - Crash on libsane-airscan when trying to activate scanner + +* Tue Sep 01 2020 Zdenek Dohnal - 0.99.16-1 +- 0.99.16 + +* Mon Aug 24 2020 Zdenek Dohnal - 0.99.15-1 +- 0.99.15 + +* Mon Aug 17 2020 Zdenek Dohnal - 0.99.14-1 +- 0.99.14 - fixing 1867126 + +* Thu Aug 13 2020 Zdenek Dohnal - 0.99.13-2 +- 1867692 - airscan driver crashes in mock during wsdd_cleanup() + +* Mon Aug 10 2020 Zdenek Dohnal - 0.99.13-1 +- 0.99.13 + +* Wed Aug 05 2020 Zdenek Dohnal - 0.99.12-1 +- 0.99.12 +- removed dependency to glib and libsoup - HTTP parser is implemented inside, + bringing gnutls dependency +- sort buildrequires alphabetically + +* Wed Jul 29 2020 Zdenek Dohnal - 0.99.11-1 +- Initial import (#1859207)