File digikam.spec of Package digikam

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

%define soversion 6
%bcond_without lang
Name:           digikam
Version:        6.0.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:         Lower-minimum-exiv2-version.patch
BuildRequires:  QtAV-devel >= 1.12
BuildRequires:  bison
BuildRequires:  boost-devel
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  flex
BuildRequires:  graphviz-devel
BuildRequires:  hicolor-icon-theme
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:  libjasper-devel
BuildRequires:  libksane-devel >= 15.12.0
BuildRequires:  liblcms2-devel
BuildRequires:  liblqr-devel
BuildRequires:  libpng-devel
BuildRequires:  libtiff-devel
BuildRequires:  libxml2-devel
BuildRequires:  libxslt-devel
BuildRequires:  marble-devel
BuildRequires:  opencv-devel
BuildRequires:  pkgconfig
BuildRequires:  solid-devel
BuildRequires:  threadweaver-devel >= 5.1.0
BuildRequires:  update-desktop-files
BuildRequires:  cmake(KF5CalendarCore)
BuildRequires:  cmake(Qt5Concurrent)
BuildRequires:  cmake(Qt5Core) >= 5.6.0
BuildRequires:  cmake(Qt5DBus)
BuildRequires:  cmake(Qt5Gui)
BuildRequires:  cmake(Qt5Network)
BuildRequires:  cmake(Qt5OpenGL)
BuildRequires:  cmake(Qt5PrintSupport)
BuildRequires:  cmake(Qt5Sql)
BuildRequires:  cmake(Qt5Test)
BuildRequires:  cmake(Qt5Widgets)
BuildRequires:  cmake(Qt5X11Extras)
BuildRequires:  cmake(Qt5Xml)
BuildRequires:  cmake(Qt5XmlPatterns)
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavfilter)
BuildRequires:  pkgconfig(libavformat)
BuildRequires:  pkgconfig(libavutil)
BuildRequires:  pkgconfig(libgphoto2) >= 2.4.0
BuildRequires:  pkgconfig(libswscale)
Requires:       libQt5Sql5-sqlite
Recommends:     %{name}-lang
Recommends:     enblend-enfuse
Recommends:     hugin
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}
# Docs no longer included in 6.0.0
Provides:       %{name}-doc = %{version}
Obsoletes:      %{name}-doc < %{version}
#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)
%if 0%{?suse_version} < 1320
# It does not build with the default compiler (GCC 4.8) on Leap 42.x
BuildRequires:  gcc7-c++

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 -n showfoto
Summary:        DigiKam: Showfoto
Group:          Productivity/Graphics/Viewers
Supplements:    %{name}

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

%package -n libdigikamcore%{soversion}
Summary:        The main digikam libraries
Group:          Development/Libraries/KDE

%description -n libdigikamcore%{soversion}
The main digikam libraries that are being shared between showfoto and digikam


%setup -q
%ifarch %{arm} aarch64
# Disable OpenGL slideshow on embedded platforms
%patch0 -p1
%if 0%{?suse_version} < 1320
%patch1 -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" core/libs/dimg/filters/greycstoration/cimg/CImg.h
sed -i "s/__TIME__/\"$FAKE_BUILDTIME\"/g" core/libs/dimg/filters/greycstoration/cimg/CImg.h

%if 0%{?suse_version} < 1320
# gcc 4.8.5 is too old
export CC=gcc-7
export CXX=g++-7
%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}/

%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

%if %{with lang}
%find_lang %{name} --without-kde

%fdupes %{buildroot}

%post -n libdigikamcore%{soversion} -p /sbin/ldconfig
%postun -n libdigikamcore%{soversion} -p /sbin/ldconfig

%doc %{_kf5_mandir}/man1/cleanup_digikamdb.1%{ext_man}
%doc %{_kf5_mandir}/man1/digitaglinktree.1%{ext_man}
%dir %{_kf5_sharedir}/solid
%dir %{_kf5_sharedir}/solid/actions

%files -n showfoto

%files -n libdigikamcore%{soversion}
%license COPYING*
%doc AUTHORS ChangeLog NEWS

%if %{with lang}
%files lang -f %{name}.lang

openSUSE Build Service is sponsored by