File libkomparediff2.spec of Package libkomparediff2

#
# spec file for package libkomparediff2
#
# Copyright (c) 2016 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/
#

%bcond_without lang

%define soname 5
Name:           libkomparediff2
Version:        17.04.1
Release:        0
%define kf5_version 5.26.0
# Latest stable Applications (e.g. 16.08 in KA, but 16.11.80 in KUA)
%{!?_kapp_version: %global _kapp_version %(echo %{version}| awk -F. '{print $1"."$2}')}
Summary:        A library to compare files and strings
License:        (GPL-2.0+ and LGPL-2.0+) and BSD-2-Clause
Group:          Development/Libraries/KDE
Url:            http://www.kde.org
Source0:        %{name}-%{version}.tar.xz
BuildRequires:  extra-cmake-modules
BuildRequires:  kcodecs-devel
BuildRequires:  kconfig-devel
BuildRequires:  kcoreaddons-devel
BuildRequires:  kf5-filesystem
BuildRequires:  ki18n-devel
BuildRequires:  kio-devel
BuildRequires:  kparts-devel
BuildRequires:  kxmlgui-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(Qt5Core) > 5.2.0
BuildRequires:  pkgconfig(Qt5Test) > 5.2.0
BuildRequires:  pkgconfig(Qt5Widgets) > 5.2.0
Obsoletes:      %{name}-kf5 < %{version}
Provides:       %{name}-kf5 = %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
A library to compare files and strings, used in Kompare and KDevelop.

%package devel
Summary:        Development package for libkomparediff2
Group:          Development/Libraries/KDE
Requires:       %{name}-%{soname} = %{version}
Obsoletes:      %{name}-kf5-devel < %{version}
Provides:       %{name}-kf5-devel = %{version}

%description devel
Development package for libkomparediff2.

%package %{soname}
Summary:        A library to compare files and strings
Group:          System/Libraries
Recommends:     %{name}-lang
Provides:       %{name} = %{version}

%description %{soname}
A library to compare files and strings, used in Kompare and KDevelop.

%if %{with lang}
%lang_package
%endif

%prep
%setup -q

%build
  %cmake_kf5 -d build
  %make_jobs

%install
  %kf5_makeinstall -C build
  %if %{with lang}
    %find_lang %{name} --with-man --all-name
  %endif

%post %{soname} -p /sbin/ldconfig
%postun %{soname} -p /sbin/ldconfig

%files %{soname}
%defattr(-,root,root)
%doc COPYING*
%{_kf5_libdir}/libkomparediff2.so.*

%files devel
%defattr(-,root,root)
%{_kf5_prefix}/include/libkomparediff2/
%{_kf5_libdir}/cmake/LibKompareDiff2/
%{_kf5_libdir}/libkomparediff2.so

%if %{with lang}
%files lang -f %{name}.lang
%doc COPYING*
%endif

%changelog
openSUSE Build Service is sponsored by