use udev uwdb instead of huge rulesets
This commit is contained in:
parent
7c059f77f0
commit
668e684fa9
@ -10,10 +10,12 @@
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if !0%{?fedora}%{?rhel} || 0%{?fedora} >= 17 || 0%{?rhel} >= 7
|
%if !0%{?fedora}%{?rhel} || 0%{?fedora} >= 17 || 0%{?rhel} >= 7
|
||||||
%global udevrulesdir %{_prefix}/lib/udev/rules.d
|
%global udevdir %{_prefix}/lib/udev
|
||||||
%else
|
%else
|
||||||
%global udevrulesdir /lib/udev/rules.d
|
%global udevdir /lib/udev
|
||||||
%endif
|
%endif
|
||||||
|
%global udevrulesdir %{udevdir}/rules.d
|
||||||
|
%global udevhwdbdir %{udevdir}/hwdb.d
|
||||||
|
|
||||||
%if !0%{?fedora}%{?rhel} || 0%{?fedora} >= 18 || 0%{?rhel} >= 7
|
%if !0%{?fedora}%{?rhel} || 0%{?fedora} >= 18 || 0%{?rhel} >= 7
|
||||||
%global libusb1 1
|
%global libusb1 1
|
||||||
@ -69,12 +71,7 @@ BuildRequires: libtiff-devel
|
|||||||
BuildRequires: libv4l-devel
|
BuildRequires: libv4l-devel
|
||||||
BuildRequires: gettext
|
BuildRequires: gettext
|
||||||
BuildRequires: gphoto2-devel
|
BuildRequires: gphoto2-devel
|
||||||
# from Fedora 18 on, udev is merged with systemd
|
Requires: systemd >= 196
|
||||||
%if !0%{?fedora}%{?rhel} || 0%{?fedora} >= 18 || 0%{?rhel} >= 7
|
|
||||||
Requires: systemd >= 183
|
|
||||||
%else
|
|
||||||
Requires: udev >= 143
|
|
||||||
%endif
|
|
||||||
Requires: sane-backends-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
Requires: sane-backends-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||||
# Don't drag around obsoletes forever
|
# Don't drag around obsoletes forever
|
||||||
%if 0%{?fedora}%{?rhel} && (0%{?fedora} < 25 || 0%{?rhel} < 8)
|
%if 0%{?fedora}%{?rhel} && (0%{?fedora} < 25 || 0%{?rhel} < 8)
|
||||||
@ -190,10 +187,12 @@ LDFLAGS="-pie"
|
|||||||
--enable-pthread
|
--enable-pthread
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
# Ensure ACL style udev rules
|
# Write udev/hwdb files
|
||||||
_topdir="$PWD"
|
_topdir="$PWD"
|
||||||
pushd tools
|
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
|
popd
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@ -207,7 +206,9 @@ rm -f %{buildroot}%{_libdir}/sane/*.a %{buildroot}%{_libdir}/*.a
|
|||||||
rm -f %{buildroot}%{_libdir}/libsane*.la %{buildroot}%{_libdir}/sane/*.la
|
rm -f %{buildroot}%{_libdir}/libsane*.la %{buildroot}%{_libdir}/sane/*.la
|
||||||
|
|
||||||
mkdir -p %{buildroot}%{udevrulesdir}
|
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
|
mkdir -p %{buildroot}%{_libdir}/pkgconfig
|
||||||
install -m 0644 tools/sane-backends.pc %{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
|
||||||
%dir /etc/sane.d/dll.d
|
%dir /etc/sane.d/dll.d
|
||||||
%config(noreplace) /etc/sane.d/*.conf
|
%config(noreplace) /etc/sane.d/*.conf
|
||||||
%{udevrulesdir}/65-libsane.rules
|
%{udevrulesdir}/65-sane-backends.rules
|
||||||
|
%{udevhwdbdir}/20-sane-backends.hwdb
|
||||||
%{_datadir}/pixmaps/sane.png
|
%{_datadir}/pixmaps/sane.png
|
||||||
|
|
||||||
%{_bindir}/sane-find-scanner
|
%{_bindir}/sane-find-scanner
|
||||||
@ -285,6 +287,7 @@ popd
|
|||||||
- version 1.0.24
|
- version 1.0.24
|
||||||
- use (hopefully stable) Alioth download URL
|
- use (hopefully stable) Alioth download URL
|
||||||
- update udev patch, remove obsolete patches
|
- update udev patch, remove obsolete patches
|
||||||
|
- use udev uwdb instead of huge rulesets
|
||||||
|
|
||||||
* Mon Sep 09 2013 Nils Philippsen <nils@redhat.com> - 1.0.23-18
|
* Mon Sep 09 2013 Nils Philippsen <nils@redhat.com> - 1.0.23-18
|
||||||
- build against libusb-1.0 on Fedora >= 18 (#1003193)
|
- build against libusb-1.0 on Fedora >= 18 (#1003193)
|
||||||
|
Loading…
Reference in New Issue
Block a user