From 668e684fa9924761f7b768aafb709175f64dd62e Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Wed, 9 Oct 2013 14:17:59 +0200 Subject: [PATCH] use udev uwdb instead of huge rulesets --- sane-backends.spec | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/sane-backends.spec b/sane-backends.spec index 728e8ac..78845a6 100644 --- a/sane-backends.spec +++ b/sane-backends.spec @@ -10,10 +10,12 @@ %endif %if !0%{?fedora}%{?rhel} || 0%{?fedora} >= 17 || 0%{?rhel} >= 7 -%global udevrulesdir %{_prefix}/lib/udev/rules.d +%global udevdir %{_prefix}/lib/udev %else -%global udevrulesdir /lib/udev/rules.d +%global udevdir /lib/udev %endif +%global udevrulesdir %{udevdir}/rules.d +%global udevhwdbdir %{udevdir}/hwdb.d %if !0%{?fedora}%{?rhel} || 0%{?fedora} >= 18 || 0%{?rhel} >= 7 %global libusb1 1 @@ -69,12 +71,7 @@ BuildRequires: libtiff-devel BuildRequires: libv4l-devel BuildRequires: gettext BuildRequires: gphoto2-devel -# from Fedora 18 on, udev is merged with systemd -%if !0%{?fedora}%{?rhel} || 0%{?fedora} >= 18 || 0%{?rhel} >= 7 -Requires: systemd >= 183 -%else -Requires: udev >= 143 -%endif +Requires: systemd >= 196 Requires: sane-backends-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} # Don't drag around obsoletes forever %if 0%{?fedora}%{?rhel} && (0%{?fedora} < 25 || 0%{?rhel} < 8) @@ -190,10 +187,12 @@ LDFLAGS="-pie" --enable-pthread make %{?_smp_mflags} -# Ensure ACL style udev rules +# Write udev/hwdb files _topdir="$PWD" pushd tools -./sane-desc -m udev+acl -s "${_topdir}/doc/descriptions:${_topdir}/doc/descriptions-external" -d0 > udev/libsane.rules +./sane-desc -m udev+hwdb -s "${_topdir}/doc/descriptions:${_topdir}/doc/descriptions-external" -d0 > udev/sane-backends.rules +./sane-desc -m hwdb -s "${_topdir}/doc/descriptions:${_topdir}/doc/descriptions-external" -d0 > udev/sane-backends.hwdb + popd %install @@ -207,7 +206,9 @@ rm -f %{buildroot}%{_libdir}/sane/*.a %{buildroot}%{_libdir}/*.a rm -f %{buildroot}%{_libdir}/libsane*.la %{buildroot}%{_libdir}/sane/*.la mkdir -p %{buildroot}%{udevrulesdir} -install -m 0644 tools/udev/libsane.rules %{buildroot}%{udevrulesdir}/65-libsane.rules +mkdir -p %{buildroot}%{udevhwdbdir} +install -m 0644 tools/udev/sane-backends.rules %{buildroot}%{udevrulesdir}/65-sane-backends.rules +install -m 0644 tools/udev/sane-backends.hwdb %{buildroot}%{udevhwdbdir}/20-sane-backends.hwdb mkdir -p %{buildroot}%{_libdir}/pkgconfig install -m 0644 tools/sane-backends.pc %{buildroot}%{_libdir}/pkgconfig/ @@ -243,7 +244,8 @@ popd %dir /etc/sane.d %dir /etc/sane.d/dll.d %config(noreplace) /etc/sane.d/*.conf -%{udevrulesdir}/65-libsane.rules +%{udevrulesdir}/65-sane-backends.rules +%{udevhwdbdir}/20-sane-backends.hwdb %{_datadir}/pixmaps/sane.png %{_bindir}/sane-find-scanner @@ -285,6 +287,7 @@ popd - version 1.0.24 - use (hopefully stable) Alioth download URL - update udev patch, remove obsolete patches +- use udev uwdb instead of huge rulesets * Mon Sep 09 2013 Nils Philippsen - 1.0.23-18 - build against libusb-1.0 on Fedora >= 18 (#1003193)