File libkface.spec of Package libkface

#
# spec file for package libkface
#
# Copyright (c) 2017 SUSE LINUX 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/
#


%define libname libKF5KFace
%define _so  10_0_0
Name:           libkface
Version:        17.08.3
Release:        0
%define kf5_version 5.26.0
# Latest stable Applications (e.g. 17.08 in KA, but 17.11.80 in KUA)
%{!?_kapp_version: %global _kapp_version %(echo %{version}| awk -F. '{print $1"."$2}')}
Summary:        wrapper around LibFace to perform face recognition and detection over pictures
License:        LGPL-2.1+
Group:          Development/Libraries/KDE
Url:            http://www.kde.org
Source0:        %{name}-%{version}.tar.xz
BuildRequires:  extra-cmake-modules
%if 0%{?suse_version} < 1330
BuildRequires:  opencv-qt5-devel
%else
BuildRequires:  opencv-devel
%endif
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Sql)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5Xml)
Obsoletes:      libkface-kf5 < %{version}
Provides:       libkface-kf5 = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Libkface is a Qt/C++ wrapper around LibFace to perform face recognition and detection over pictures

%package -n %{libname}%{_so}
Summary:        wrapper around LibFace to perform face recognition and detection over pictures
Group:          Development/Libraries/KDE
Requires:       %{name} = %{version}

%description -n %{libname}%{_so}
Libkface is a Qt/C++ wrapper around LibFace to perform face recognition and detection over pictures

%package devel
Summary:        wrapper around LibFace to perform face recognition and detection over pictures
Group:          Development/Libraries/KDE
Requires:       %{libname}%{_so} = %{version}
Obsoletes:      libkface-kf5-devel < %{version}
Provides:       libkface-kf5-devel = %{version}

%description devel
Libkface is a Qt/C++ wrapper around LibFace to perform face recognition and detection over pictures

%prep
%setup -q

%build
  %cmake_kf5 -d build -- -DENABLE_OPENCV3=TRUE
  %make_jobs

%install
  %kf5_makeinstall -C build

%post -n %{libname}%{_so} -p /sbin/ldconfig
%postun -n %{libname}%{_so} -p /sbin/ldconfig

%files -n %{libname}%{_so}
%defattr(-,root,root)
%doc COPYING README
%{_kf5_libdir}/%{libname}.so.*

%files devel
%defattr(-,root,root)
%doc COPYING
%{_kf5_cmakedir}/KF5KFace/
%{_kf5_includedir}/KFace/
%{_kf5_includedir}/libkface_version.h
%{_kf5_libdir}/%{libname}.so

%files
%defattr(-,root,root)
%doc COPYING
%{_kf5_appsdir}/libkface/

%changelog