File libudev0.spec of Package libudev0

#
# spec file for package libudev0
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           libudev0
Url:            http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
Version:        182
Release:        0
Summary:        Dynamic library to access udev device information
License:        LGPL-2.1+
Group:          System/Libraries
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  glib2-devel
BuildRequires:  gperf
BuildRequires:  libacl-devel
BuildRequires:  libblkid-devel >= 2.20
BuildRequires:  libkmod-devel > 5
BuildRequires:  libselinux-devel
BuildRequires:  libsepol-devel
BuildRequires:  libtool
#BuildRequires:  libusb-devel
BuildRequires:  pciutils-ids
BuildRequires:  pkg-config
BuildRequires:  usbutils
Source0:        ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/udev-%{version}.tar.bz2
# PATCH-FIX-OPENSUSE 0001-Reinstate-TIMEOUT-handling.patch
Patch1:         0001-Reinstate-TIMEOUT-handling.patch
# PATCH-FIX-OPENSUSE 0015-udev-secure-getenv.patch
Patch15:        0015-udev-secure-getenv.patch
# PATCH-FIX-UPSTREAM 0017-udev-add-some-O_CLOEXEC.patch
Patch17:        0017-udev-add-some-O_CLOEXEC.patch

# Upstream First - Policy:
# Never add any patches to this package without the upstream commit id
# in the patch. Any patches added here without a very good reason to make
# an exception will be silently removed with the next version update.

%description
This package contains the dynamic library libudev, which provides
access to udev device information

%prep
%setup -q -n udev-%{version}
# patching
%patch1 -p1
%patch15 -p1
%patch17 -p1

%build
export V=1
%configure \
  --disable-introspection \
  --disable-gudev \
  --sysconfdir=%{_sysconfdir} \
  --sbindir=/sbin \
  --libexecdir=/lib \
  --docdir=%{_docdir}/udev \
  --with-selinux \
  CFLAGS="$RPM_OPT_FLAGS"
# Add -lrt since configure does not catch this.
make %{?_smp_mflags} LIBS="-lrt"

%install
make DESTDIR=$RPM_BUILD_ROOT install
# we are only interested in shared library
rm -f $RPM_BUILD_ROOT/%{_libdir}/libudev.{la,so}
rm -rf $RPM_BUILD_ROOT{/lib/udev,%{_sysconfdir},%{_datadir},%{_bindir},%{_includedir},%{_libdir}/pkgconfig}

%post -n libudev0 -p /sbin/ldconfig

%postun -n libudev0 -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files -n libudev0
%defattr(-,root,root)
/%{_libdir}/libudev.so.*

%changelog
openSUSE Build Service is sponsored by