File digikam.spec of Package digikam

# spec file for package digikam
# Copyright (c) 2018 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

Name:           digikam
Version:        5.9.0
Release:        0
Summary:        A KDE Photo Manager
License:        GPL-2.0-or-later
Group:          Productivity/Graphics/Viewers
# PATCH-FIX-OPENSUSE 0001-Disable-detection-of-OpenGL-for-GLES-platforms.patch -- The OpenGL slideshow depends on Desktop GL, see kde#383715
Patch0:         0001-Disable-detection-of-OpenGL-for-GLES-platforms.patch
Patch1:         0001-Revert-replace-obsolete-qSort-function.patch
Patch2:         0002-Revert-replace-obsolete-qSort-function.patch
Patch3:         Lower-minimum-exiv2-version.patch
Patch4:         Add-QtWebEngine-support.patch
Patch5:         fix-black-Welcome-page-by-clicking-on-a-link.patch
# PATCH-FIX-UPSTREAM -- fix build with exiv2-0.27
Patch6:         add-support-for-Exiv2-0.27.patch
Patch7:         be-compatible-with-backward-0.26.patch
Patch8:         adjust-find-cmake-script-to-exiv2-0.27-RC1.patch
Patch9:         first-patch-to-be-compatible-with-Exiv2-0.27.patch
Patch10:        f27ab9c1051bd0a0.patch
Patch11:        fix-compile.patch
#This pulls in QWebEngine, which is not available on ppc64
%ifarch %ix86 x86_64 %arm aarch64 mips mips64
BuildRequires:  akonadi-contact-devel
BuildRequires:  pkgconfig(Qt5WebEngineWidgets)
BuildRequires:  pkgconfig(Qt5WebKitWidgets)
BuildRequires:  QtAV-devel >= 1.12
BuildRequires:  bison
BuildRequires:  boost-devel
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  flex
BuildRequires:  graphviz-devel
BuildRequires:  gtk2-devel
BuildRequires:  karchive-devel
BuildRequires:  kconfig-devel
BuildRequires:  kcoreaddons-devel
BuildRequires:  kdoctools-devel
BuildRequires:  kfilemetadata5-devel
BuildRequires:  ki18n-devel
BuildRequires:  kiconthemes-devel
BuildRequires:  kio-devel
BuildRequires:  knotifications-devel
BuildRequires:  knotifyconfig-devel
BuildRequires:  kservice-devel
BuildRequires:  kwindowsystem-devel
BuildRequires:  kxmlgui-devel
BuildRequires:  lensfun
BuildRequires:  lensfun-devel
BuildRequires:  libeigen3-devel
BuildRequires:  libexiv2-devel >= 0.25
BuildRequires:  libexpat-devel
BuildRequires:  libgcrypt-devel
BuildRequires:  libgpod-devel
BuildRequires:  libjasper-devel
BuildRequires:  libkipi-devel >= 16.04.0
BuildRequires:  libksane-devel >= 15.12.0
BuildRequires:  liblcms2-devel
BuildRequires:  liblqr-devel
BuildRequires:  libmediawiki-devel
BuildRequires:  libmysqlclient-devel
BuildRequires:  libmysqld-devel
BuildRequires:  libpgf-devel
BuildRequires:  libtiff-devel
BuildRequires:  libusb-devel
BuildRequires:  marble-devel
BuildRequires:  mysql
BuildRequires:  opencv-devel
BuildRequires:  solid-devel
BuildRequires:  threadweaver-devel >= 5.1.0
BuildRequires:  update-desktop-files
BuildRequires:  cmake(KF5CalendarCore)
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5Core) >= 5.6.0
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5OpenGL)
BuildRequires:  pkgconfig(Qt5PrintSupport)
BuildRequires:  pkgconfig(Qt5Sql)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5Test)
BuildRequires:  pkgconfig(Qt5X11Extras)
BuildRequires:  pkgconfig(Qt5Xml)
BuildRequires:  pkgconfig(Qt5XmlPatterns)
BuildRequires:  pkgconfig(libgphoto2) >= 2.4.0
Requires:       kipi-plugins >= %{version}
Requires:       libQt5Sql5-sqlite
Recommends:     %{name}-doc
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Recommends:     marble
Recommends:     showfoto
# Got merged into libimageeditor in 5.2.0
Provides:       %{name}-plugin-color = %{version}
Obsoletes:      %{name}-plugin-color < %{version}
Provides:       %{name}-plugin-decorate = %{version}
Obsoletes:      %{name}-plugin-decorate < %{version}
Provides:       %{name}-plugin-enhance = %{version}
Obsoletes:      %{name}-plugin-enhance < %{version}
Provides:       %{name}-plugin-fxfilters = %{version}
Obsoletes:      %{name}-plugin-fxfilters < %{version}
Provides:       %{name}-plugin-transform = %{version}
Obsoletes:      %{name}-plugin-transform < %{version}
Obsoletes:      digikam-libs < %{version}

digiKam is a simple digital photo management application for KDE, which
allows you to import and organize your digital photos easily. The
photos can be organized in albums, which can be sorted chronologically,
by directory layout, or by custom collections. An easy-to-use interface
that enables you to connect to your camera and preview, download, or
delete your images, is provided.

%package doc
Summary:        Documentation of Digikam
License:        GFDL-1.2-only
Group:          Documentation/HTML
BuildArch:      noarch

%description doc
This package contains the documentation for digikam

%package -n kipi-plugins
Summary:        KDE Plug-Ins for Image Manipulation
License:        GPL-2.0-or-later
Group:          Productivity/Graphics/Other
Recommends:     ImageMagick
Recommends:     enblend-enfuse
Recommends:     hugin
Recommends:     kipi-plugins-lang = %{version}
Obsoletes:      kipi-plugins-acquireimage < %{version}
Obsoletes:      kipi-plugins-geolocation < %{version}
Obsoletes:      kipi-plugins5 < %{version}
Provides:       kipi-plugins5 = %{version}
Obsoletes:      kipi-plugin-icons < %{version}
Provides:       kipi-plugin-icons = %{version}

%description -n kipi-plugins
A set of plug-ins for the KDE KIPI interface, used by some KDE imaging

%package -n showfoto
Summary:        DigiKam: Showfoto
License:        GPL-2.0-or-later
Group:          Productivity/Graphics/Viewers
Supplements:    %{name}

%description -n showfoto
Additional program to browse and view photos

%package -n libdigikamcore5
Summary:        The main digikam libraries
License:        GPL-2.0-or-later
Group:          Development/Libraries/KDE

%description -n libdigikamcore5
The main digikam libraries that are being shared between showfoto and digikam


%lang_package -n kipi-plugins

%setup -q -n %{name}-%{version}
%ifarch %arm aarch64
# Disable OpenGL slideshow on embedded platforms
%patch0 -p1
%if 0%{?suse_version} < 1320
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1

# Remove build time references so build-compare can do its work
FAKE_BUILDDATE=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%b %%e %%Y')
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M')
sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/" core/app/utils/
sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/g" extra/kipi-plugins/common/libkipiplugins/tools/
sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/g" core/libs/dimg/filters/greycstoration/cimg/CImg.h
sed -i "s/__TIME__/\"$FAKE_BUILDTIME\"/g" core/libs/dimg/filters/greycstoration/cimg/CImg.h

# Workaround for kde#369517 - vkontakte installs translations even if not built
rm -f po/*/kipiplugin_vkontakte.po

%ifarch %ix86 x86_64 %arm aarch64 mips mips64
%make_jobs VERBOSE=1

%kf5_makeinstall -C build

# Not needed, the package doesn't actually provide any shared libraries
rm -f %{buildroot}%{_kf5_libdir}/
rm -f %{buildroot}%{_kf5_libdir}/
rm -f %{buildroot}%{_kf5_libdir}/
rm -f %{buildroot}%{_kf5_libdir}/

%if 0%{?suse_version}
%suse_update_desktop_file -r org.kde.digikam Qt KDE Graphics Photography
%suse_update_desktop_file -r org.kde.showfoto Qt KDE Graphics Photography

%find_lang %{name} --without-kde
%find_lang kipiplugins kipiplugin.lang --without-kde

for i in dropbox googleservices sendimages facebook flashexport flickr imageshack imgur kmlexport piwigo printimages rajce remotestorage sendimages smug yandexfotki
  %find_lang kipiplugin_$i kipiplugin.lang

%fdupes -s %{buildroot}

%post -n libdigikamcore5 -p /sbin/ldconfig

%postun -n libdigikamcore5 -p /sbin/ldconfig

%post -n kipi-plugins -p /sbin/ldconfig

%postun -n kipi-plugins -p /sbin/ldconfig

%dir %_datadir/solid
%dir %_datadir/solid/actions

%files -n showfoto

%files -n libdigikamcore5
%license COPYING*
%doc core/{AUTHORS,ChangeLog,NEWS,}

%files doc
%license doc/COPYING.DOC
%doc %{_mandir}/man1/cleanup_digikamdb.1%{ext_man}
%doc %{_mandir}/man1/digitaglinktree.1%{ext_man}
%doc %{_kf5_htmldir}/*/

%files lang -f %{name}.lang

%files -n kipi-plugins
%license COPYING*
%doc extra/kipi-plugins/{AUTHORS,ChangeLog,NEWS,README,TODO}

%files -n kipi-plugins-lang -f kipiplugin.lang

openSUSE Build Service is sponsored by