File digikam.spec of Package digikam

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

Name:           digikam
Version:        5.2.0
Release:        0
Summary:        A KDE Photo Manager
License:        GPL-2.0+
Group:          Productivity/Graphics/Viewers
# PATCH-FIX-OPENSUSE find_libastro-qt5.patch -- fix build of geolocation support in Leap 42.1
Patch2:         find_libastro-qt5.patch
# PATCH-FIX-UPSTREAM migration_from_digikam4.diff kde#364258 kde#357944 kde#368968 -- Migration wizard page to migrate configuration and db from digikam4
Patch3:         migration_from_digikam4.diff
#This pulls in QWebEngine, which is not available on ppc64
%ifarch %ix86 x86_64 %arm aarch64 mips mips64
BuildRequires:  akonadi-contact-devel
BuildRequires:  baloo5-devel
BuildRequires:  bison
BuildRequires:  boost-devel
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  flex
BuildRequires:  graphviz-devel
BuildRequires:  gtk2-devel
BuildRequires:  kfilemetadata5-devel
BuildRequires:  khtml-devel
BuildRequires:  ki18n-devel
BuildRequires:  kitemmodels-devel
BuildRequires:  knotifyconfig-devel
BuildRequires:  lensfun
BuildRequires:  lensfun-devel
BuildRequires:  libeigen3-devel
BuildRequires:  libexiv2-devel
BuildRequires:  libexpat-devel
BuildRequires:  libgcrypt-devel
BuildRequires:  libgphoto2-devel >= 2.4.0
# It invokes "gphoto2" for determining the API version
BuildRequires:  gphoto
BuildRequires:  libgpod-devel
BuildRequires:  libjasper-devel
BuildRequires:  libkdcraw-devel >= 15.12.0
BuildRequires:  libkexiv2-devel >= 15.12.0
BuildRequires:  libkface-devel >= 15.12.0
BuildRequires:  libkgeomap-devel > 15.12.0
BuildRequires:  libkipi-devel >= 16.04.0
BuildRequires:  libksane-devel >= 15.12.0
BuildRequires:  liblcms2-devel
BuildRequires:  liblqr-devel
BuildRequires:  libmysqlclient-devel
BuildRequires:  libmysqld-devel
BuildRequires:  libpgf-devel
BuildRequires:  libqca-qt5-devel
BuildRequires:  libtiff-devel
BuildRequires:  libusb-devel
BuildRequires:  marble-devel
BuildRequires:  mysql
BuildRequires:  opencv-qt5-devel
BuildRequires:  phonon4qt5-devel
BuildRequires:  soprano-backend-redland
BuildRequires:  threadweaver-devel >= 5.1.0
BuildRequires:  update-desktop-files
BuildRequires:  xorg-x11-devel
BuildRequires:  cmake(KF5CalendarCore)
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5Multimedia)
BuildRequires:  pkgconfig(Qt5OpenGL)
BuildRequires:  pkgconfig(Qt5Sql)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5Test)
BuildRequires:  pkgconfig(Qt5Test)
BuildRequires:  pkgconfig(Qt5WebKitWidgets)
BuildRequires:  pkgconfig(Qt5X11Extras)
BuildRequires:  pkgconfig(Qt5XmlPatterns)
Requires:       kipi-plugins >= %{version}
Recommends:     %{name}-doc
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       exiv2 >= 0.25
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
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+
Group:          Productivity/Graphics/Other
Recommends:     ImageMagick
Recommends:     enblend-enfuse
Recommends:     hugin
Recommends:     kipi-plugins-lang = %{version}
Supplements:    packageand(kipi-plugins:marble)
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+
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+
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}
%if 0%{?is_opensuse} && 0%{?sle_version} == 120100
# we renamed libastro to libastro-qt5 in Leap 42.1, make FindMARBLE.cmake find it
%patch2 -p1
%patch3 -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
rm -f po/*/libkvkontakte.po

%if 0%{?suse_version} < 1320 && !0%{?is_opensuse}


%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}/

# Not needed
rm -fv %{buildroot}%{_kf5_libdir}/*.a
rm -rf $RPM_BUILD_ROOT/usr/share/locale/x-test

%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}
%find_lang kipiplugins kipiplugin.lang

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
# For Leap 42.1
%dir %{_kf5_appstreamdir}

%files -n showfoto
# For Leap 42.1
%dir %{_kf5_appstreamdir}

%files -n libdigikamcore5

%files doc
%doc 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

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

openSUSE Build Service is sponsored by