File libfprint.spec of Package libfprint

#
# spec file for package libfprint
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2013 Mariusz Fik <fisiu@opensuse.org>.
#
# 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:           libfprint
Version:        0.5.0
Release:        0
Summary:        Library for fingerprint reader support
License:        LGPL-2.1+
Group:          Development/Libraries/C and C++
Url:            http://www.freedesktop.org/wiki/Software/fprint
Source0:        %{name}-%{version}.tar.xz
Patch17:        libfprint-upeke2_6stage.diff
Patch18:        libfprint-upeke2_add_147e_2020_id_support.patch
Patch21:        libfprint-install_examples.patch
Source99:       baselibs.conf
BuildRequires:  automake
BuildRequires:  gcc-c++
# Needed for patch21
BuildRequires:  libtool
BuildRequires:  pkg-config
BuildRequires:  pkgconfig(gdk-pixbuf-2.0)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(libusb-1.0)
BuildRequires:  pkgconfig(nss)
BuildRequires:  pkgconfig(udev)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires(pre):  %fillup_prereq

%define _udevrulesdir %(pkg-config --variable=udevdir udev)/rules.d

%description
The fprint project aims to plug a gap in the Linux desktop: support for
consumer fingerprint reader devices.

%package -n libfprint0
Summary:        Library for fingerprint reader support
Group:          Development/Libraries/C and C++
Provides:       %{name} = %{version}

%description -n libfprint0
The fprint project aims to plug a gap in the Linux desktop: support for
consumer fingerprint reader devices.

%package devel
Summary:        Library for fingerprint reader support (developer files)
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}
Requires:       glibc-devel
Requires:       libfprint0 = %{version}

%description devel
This package contains the header files, static libraries and
development documentation for libfprint. If you like to develop
programs using libfprint, you will need to install this package.

%package examples
Summary:        Library for fingerprint reader support (example programs)
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description examples
This package contains the header files, static libraries and
development documentation for libfprint. If you like to develop
programs using libfprint, you will need to install this package.

%prep
%setup -q
%patch17
%patch18 -p1
%patch21

%build
# Needed for patch21
autoreconf -fi
%configure \
    --enable-static=no \
    --mandir=%{_mandir} \
    --with-udev-rules-dir=%{_udevrulesdir}

make %{?smp_flags}
make %{?smp_flags} -C examples

%install
make DESTDIR=%{buildroot} install
make DESTDIR=%{buildroot} -C examples install

# Fix file conflict
for f in enroll img_capture verify verify_live; do
    mv %{buildroot}%{_bindir}/$f %{buildroot}%{_bindir}/fprint_$f
done

#remove unpackaged files
rm -f %{buildroot}%{_libdir}/*.la

%post -n libfprint0 -p /sbin/ldconfig

%postun -n libfprint0 -p /sbin/ldconfig

%files -n libfprint0
%defattr(-, root, root)
%{_libdir}/%{name}.so.*
%{_udevrulesdir}/60-fprint-autosuspend.rules

%files devel
%defattr(-, root, root)
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/fprint.h
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/%{name}.pc

%files examples
%defattr(-, root, root)
%{_bindir}/fprint_enroll
%{_bindir}/fprint_img_capture
%{_bindir}/fprint_verify
%{_bindir}/fprint_verify_live

%changelog
openSUSE Build Service is sponsored by