SHA256
1
0
forked from pool/libgphoto2

Accepting request 201554 from graphics

- Replace udev rules with udev hwdb for openSUSE 13.1 or later
  (more efficient).
- Fix udev hwdb installation and ensure udev hwdb is updated when
  package is installed / updated / uninstalled. (forwarded request 201502 from fcrozat)

OBS-URL: https://build.opensuse.org/request/show/201554
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libgphoto2?expand=0&rev=86
This commit is contained in:
Stephan Kulow 2013-10-02 11:31:03 +00:00 committed by Git OBS Bridge
commit 47dc8d57d6
2 changed files with 39 additions and 7 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Mon Sep 30 12:22:48 UTC 2013 - fcrozat@suse.com
- Replace udev rules with udev hwdb for openSUSE 13.1 or later
(more efficient).
- Fix udev hwdb installation and ensure udev hwdb is updated when
package is installed / updated / uninstalled.
-------------------------------------------------------------------
Mon Aug 19 14:57:20 UTC 2013 - meissner@suse.com

View File

@ -38,6 +38,9 @@ BuildRequires: libxml2-devel
BuildRequires: lockdev-devel
BuildRequires: pkg-config
BuildRequires: udev
%if 0%{?suse_version} > 1230
BuildRequires: systemd-rpm-macros
%endif
Url: http://gphoto.org/
# bug437293
%ifarch ppc64
@ -141,12 +144,13 @@ pushd packaging/generic
echo "*** The udev rules file location has changed. Fix the build."
exit 1
fi
%if 0%{?suse_version} > 1230
install -m 0755 -d $RPM_BUILD_ROOT/%{_udevhwdbdir}
./print-camera-list hwdb > $RPM_BUILD_ROOT/%{_udevhwdbdir}/20-gphoto.hwdb
%else
install -m 0755 -d $RPM_BUILD_ROOT%{_udevrulesdir}
./print-camera-list udev-rules version 175 > $RPM_BUILD_ROOT%{_udevrulesdir}/40-libgphoto2.rules
if [ -d /usr/lib/udev/hwdb.d ] ; then
install -m 0755 -d $RPM_BUILD_ROOT/usr/lib/udev/hwdb.d/
./print-camera-list hwdb > $RPM_BUILD_ROOT/usr/lib/udev/hwdb.d/20-gphoto.conf.
fi
%endif
popd
# udev helpers not used here.
rm $RPM_BUILD_ROOT/usr/%_lib/udev/check-ptp-camera
@ -169,8 +173,11 @@ find "%buildroot/%_libdir" -type f -name "*.la" -delete
%{_libdir}/libgphoto2_port.so.*
%{_mandir}/man3/libgphoto2.3*
%{_mandir}/man3/libgphoto2_port.3*
%if 0%{?suse_version} > 1230
%{_udevhwdbdir}/20-gphoto.hwdb
%else
%{_udevrulesdir}/40-libgphoto2.rules
/usr/lib/udev/hwdb.d/20-gphoto.conf.
%endif
%files -n libgphoto2-%{major}-lang -f libgphoto2-all.lang
@ -185,8 +192,25 @@ find "%buildroot/%_libdir" -type f -name "*.la" -delete
%{_libdir}/pkgconfig/libgphoto2.pc
%{_libdir}/pkgconfig/libgphoto2_port.pc
%post -n %name-%major -p /sbin/ldconfig
%post -n %name-%major
/sbin/ldconfig
%if 0%{?suse_version} > 1230
%udev_hwdb_update
%else
udevadm control --reload 2>&1 > /dev/null || :
%endif
%postun -n %name-%major -p /sbin/ldconfig
%postun -n %name-%major
/sbin/ldconfig
if [ $1 -eq 0 ]; then
%if 0%{?suse_version} > 1230
%udev_hwdb_update
%udev_rules_update
%else
udevadm control --reload 2>&1 > /dev/null || :
%endif
fi
%{nil}
%changelog