File kexi.spec of Package kexi

#
# spec file for package kexi
#
# 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/
#

%bcond_without lang

Name:           kexi
Version:        3.0.1.1
Release:        0
License:        GPL-2.0+ and LGPL-2.1+ and GFDL-1.2
Summary:        Database Application
Group:          Productivity/Office/Suite
Url:            http://www.kexi-project.org/
Source0:        http://download.kde.org/stable/%{name}/src/%{name}-%{version}.tar.xz
BuildRequires:  breeze5-icons
BuildRequires:  cmake(Qt5Core)
BuildRequires:  cmake(Qt5Gui)
BuildRequires:  cmake(Qt5PrintSupport)
BuildRequires:  cmake(Qt5UiTools)
BuildRequires:  cmake(Qt5Widgets)
BuildRequires:  cmake(Qt5Xml)
BuildRequires:  cmake(Qt5Network)
BuildRequires:  cmake(Qt5Test)
BuildRequires:  cmake(Qt5WebKit)
BuildRequires:  cmake(Qt5WebKitWidgets)
BuildRequires:  extra-cmake-modules
BuildRequires:  fdupes
BuildRequires:  glib2-devel
BuildRequires:  karchive-devel
BuildRequires:  kcodecs-devel
BuildRequires:  kcompletion-devel
BuildRequires:  kconfig-devel
BuildRequires:  kconfigwidgets-devel
BuildRequires:  kcoreaddons-devel
BuildRequires:  kcrash-devel
BuildRequires:  kdb-devel
BuildRequires:  kf5-filesystem
BuildRequires:  kguiaddons-devel
BuildRequires:  ki18n-devel
BuildRequires:  kiconthemes-devel
BuildRequires:  kio-devel
BuildRequires:  kitemviews-devel
BuildRequires:  kproperty-devel
BuildRequires:  kreport-devel
BuildRequires:  ktexteditor-devel
BuildRequires:  ktextwidgets-devel
BuildRequires:  kwidgetsaddons-devel
BuildRequires:  kxmlgui-devel
BuildRequires:  libmysqld-devel
BuildRequires:  marble-devel
BuildRequires:  mysql-devel
BuildRequires:  postgresql-devel
BuildRequires:  update-desktop-files
%if %{with lang}
Recommends:     %{name}-lang = %{version}
%endif
Obsoletes:      calligra-kexi < %{version}
Provides:       calligra-kexi = %{version}
# not ported yet
Obsoletes:      calligra-kexi-spreadsheet-import < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Kexi is a visual database applications creator, competing with
programs like MS Access or Filemaker.

%package spreadsheet-import
Summary:        Spreadsheet-to-Kexi-table import plugin
License:        GPL-2.0+ and LGPL-2.1+
Group:          Productivity/Office/Suite
Obsoletes:      calligra-kexi-spreadsheet-import < %{version}
Provides:       calligra-kexi-spreadsheet-import = %{version}

%description spreadsheet-import
Kexi is a visual database applications creator, competing with
programs like MS Access or Filemaker.

This package contains a Spreadsheet-to-Kexi-table import plugin.

%if %{with lang}
%lang_package
%endif

%prep
%setup -q -n kexi-3.0.1

%build
# install translations to %{_kf5_localedir} so they don't clash with the kexi translations in calligra-l10n (KDE4 based)
# can probably be changed back to the standard location when we have calligra 3 in all supported distributions...
%cmake_kf5 -d build -- -DCMAKE_INSTALL_LOCALEDIR=%{_kf5_localedir}
%make_jobs

%install
cd build
%kf5_makeinstall

mkdir -p %{buildroot}%{_kf5_iconsdir}/hicolor/scalable/apps
cp %{_kf5_iconsdir}/breeze/apps/48/calligrakexi.svg %{buildroot}%{_kf5_iconsdir}/hicolor/scalable/apps/

%suse_update_desktop_file -r org.kde.kexi       Qt KDE Office Database

#Remove unwanted development files
for i in dataviewcommon formutils extendedwidgets relationsview main migrate utils guiutils datatable core undo
do
    rm %{buildroot}%{_kf5_libdir}/libkexi${i}.so
done
rm %{buildroot}%{_kf5_libdir}/libkformdesigner.so

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc AUTHORS README.md COPYING COPYING.*
%{_bindir}/kexi
%{_libdir}/libkexi*.so*
%{_libdir}/libkformdesigner.so*
%dir %{_kf5_appstreamdir}
%{_kf5_appstreamdir}/org.kde.kexi.appdata.xml
%{_kf5_applicationsdir}/org.kde.kexi.desktop
%{_kf5_iconsdir}/hicolor/*/*/*
%{_kf5_sharedir}/kexi/
%{_kf5_plugindir}/kexi/

%files lang
%defattr(-,root,root,-)
%{_kf5_localedir}

%changelog
openSUSE Build Service is sponsored by