File digikam.spec of Package digikam

# spec file for package digikam
# Copyright (c) 2015 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:        4.13.0
Release:        0
%define rversion 4.13.0
Summary:        A KDE Photo Manager
License:        GPL-2.0+
Group:          Productivity/Graphics/Viewers
# libkgeomap translations from the 4.8.0 tarball (Missing in 4.9.0)
Source2:        digikam-4.8.0-libkgeomap-translations.tar.bz2
# PATCH-FIX-OPENSUSE digikam-buildtime.patch -- Remove build time references so build-compare can do its work
Patch0:         digikam-buildtime.patch
# PATCH-FIX-OPENSUSE remove-gplv2-only.patch bnc#711963 -- Remove GPLv2 only files from the build system
Patch3:         remove-gplv2-only.patch
# PATCH-FIX-UPSTREAM -- version check for libkdcraw currently broken
# PATCH-FIX-OPENSUSE digikam-4.6.0.install-libs-dev.patch -- install cmake module files and pkgconfig files of internally-built libraries, too
Patch7:         digikam-4.6.0.install-libs-dev.patch
BuildRequires:  ImageMagick-devel
BuildRequires:  bison
BuildRequires:  boost-devel
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  flex
BuildRequires:  gdk-pixbuf-devel
BuildRequires:  libxml2-devel
BuildRequires:  libxslt-devel
%if 0%{?suse_version} >= 1320 || 0%{?is_opensuse}
# We want libkgeomap on openSUSE 13.2+ and Leap, which is 1315 && is_opensuse
BuildRequires:  libkgeomap-devel
%if 0%{?suse_version} > 1310
BuildRequires:  baloo-devel
%if 0%{?suse_version} > 1310
BuildRequires:  libkface-devel
%if 0%{?suse_version} > 1310
BuildRequires:  gstreamer-plugins-qt-devel
BuildRequires:  gstreamer-0_10-plugins-qt-devel
BuildRequires:  lensfun-devel
%if 0%{?suse_version} > 1230
BuildRequires:  libeigen3-devel
BuildRequires:  libexpat-devel
BuildRequires:  libgphoto2-devel
BuildRequires:  libgpod-devel
BuildRequires:  libjasper-devel
BuildRequires:  libkdcraw-devel
BuildRequires:  libkde4-devel
BuildRequires:  libkdepimlibs4-devel
BuildRequires:  libkexiv2-devel
BuildRequires:  pkgconfig(libkipi) >= 2.0.0
%if 0%{?suse_version} > 1230
BuildRequires:  libkqoauth-devel
BuildRequires:  libMagick++-devel
BuildRequires:  libksane-devel
BuildRequires:  libkvkontakte-devel
%if 0%{?suse_version} < 1320 && !0%{?is_opensuse}
# from 13.2 upwards, and also Leap 42.1 (1315 && is_opensuse) we prefer lcms2
BuildRequires:  liblcms-devel
BuildRequires:  liblcms2-devel
BuildRequires:  liblqr-devel
BuildRequires:  libpgf-devel
BuildRequires:  libqca2-devel
BuildRequires:  libqjson-devel
BuildRequires:  libusb-1_0-devel
BuildRequires:  libusb-compat-devel
%if 0%{?suse_version} <= 1320 && !0%{?is_opensuse}
BuildRequires:  marble-devel
BuildRequires:  opencv-devel >= 2.4.5
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(glu)
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
Requires:       kipi-plugins >= %{version}
Requires:       libqt4-sql-mysql
Requires:       libqt4-sql-sqlite
# libkgeomap package provides older lib with same so name.
Requires:       libkgeomap2
Recommends:     %{name}-doc
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%requires_ge    libkipi8

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

# split out acquireimage plugin in order to allow the main
# kipi-plugins package to be included on livecd (acquireimage
# requires sane-backends, which is blocked for livecd)
%package -n kipi-plugins-acquireimage
Summary:        KDE Plug-Ins for Image Manipulation - Acquireimage plugin
License:        GPL-2.0+
Group:          Productivity/Graphics/Other
Requires:       kipi-plugins = %{version}
Supplements:    packageand(kipi-plugins:sane-backends)

%description -n kipi-plugins-acquireimage
This is the Acquireimage plugin from the kipi plugins package.

# split out geolocation plugin in order to allow the main
# kipi-plugins package to be included on livecd (geolocation
# requires marble, which is blocked for livecd)
%package -n kipi-plugins-geolocation
Summary:        KDE Plug-Ins for Image Manipulation - Geolocation plugin
License:        GPL-2.0+
Group:          Productivity/Graphics/Other
Requires:       kipi-plugins = %{version}
Supplements:    packageand(kipi-plugins:marble)

%description -n kipi-plugins-geolocation
This is the Geolocation plugin from the kipi plugins package.

%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)

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

%if 0%{?suse_version} <= 1320 && !0%{?is_opensuse}
# This is only being built up to 13.2 & SLE12, but NOT for Leap 42.1
%package -n libkgeomap-devel
Summary:        Development files for libkgeomap
License:        GPL-2.0+
Group:          Development/Libraries/KDE
Requires:       libkgeomap2 = %{version}

%description -n libkgeomap-devel
This package contains development files for libkgeomap.

%package -n libkgeomap2
Summary:        World-Map Library interface for KDE
License:        GPL-2.0+
Group:          System/Libraries
Recommends:     libkgeomap-lang = %{version}
Recommends:     marble
# libkgeomap was last used at openSUSE 12.1 (version 2.2.0)
Provides:       libkgeomap = %{version}
Obsoletes:      libkgeomap < %{version}
# libkgeomap1 was last used at openSUSE 13.2 (version 4.4.0)
Obsoletes:      libkgeomap1

%description -n libkgeomap2
Libkgeomap is a wrapper around different world-map components, to browse and
arrange photos over a map.
Currently supported map engine are:
- Marble
- OpenstreetMap (via Marble)
- GoogleMap
This library is used by kipi-plugins, digiKam and other kipi host programs.

%if 0%{?suse_version} < 1320 && !0%{?is_opensuse}
# This is built up to openSUSE 13.1 plus also SLE12
%package -n libkface-devel
Summary:        Development files for libkface
License:        BSD-3-Clause and GPL-2.0+ and LGPL-2.1+ and MIT
Group:          Development/Libraries/KDE
Requires:       libkface3 = %{version}

%description -n libkface-devel
This package contains development files for libkface.

%package -n libkface3
Summary:        Wrapper around LibFace to perform face recognition and detection over pictures
License:        BSD-3-Clause and GPL-2.0+ and LGPL-2.1+ and MIT
Group:          System/Libraries
# libkface2 was last used at openSUSE 13.2 (version 4.4.0)
Obsoletes:      libkface2

%description -n libkface3
Libkface is a Qt/C++ wrapper around LibFace to perform face recognition and
detection over pictures.

%package -n libmediawiki1
Summary:        Interface for MediaWiki based web services
License:        GPL-2.0+
Group:          System/Libraries
Provides:       libmediawiki = %{version}

%description -n libmediawiki1
libmediawiki is a KDE C++ interface for MediaWiki based web service as

This package contains the shared library.

%package -n libmediawiki-devel
Summary:        Development files for libmediawiki
License:        GPL-2.0+
Group:          Development/Libraries/C and C++
Requires:       libmediawiki1 = %{version}

%description -n libmediawiki-devel
libmediawiki is a KDE C++ interface for MediaWiki based web service as

This package contains the development files for libmediawiki.


%lang_package -n kipi-plugins

%if 0%{?suse_version} <= 1320 && !0%{?is_opensuse}
%lang_package -n libkgeomap

%setup -q -n %{name}-%{rversion}
%if 0%{?suse_version} <= 1320 && !0%{?is_opensuse}
# Don't unpack the libkgeomap translations for Tumbleweed/Leap 42.1 as that they are being delivered through kde-l10n
tar -xjf %{SOURCE2}
%patch6 -p1
%patch7 -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')
sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/" core/app/utils/
sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/g" extra/kipi-plugins/common/libkipiplugins/tools/

pushd extra/kipi-plugins
# Remove GPL-v2 only files
rm gpssync/borrowed/modeltest.cpp
rm gpssync/borrowed/modeltest.h

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

# there are files in there that are so heavy to the compiler, that one is enough
%make_jobs VERBOSE=1

%kde4_makeinstall -C build

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

# Not needed
rm -fv %{buildroot}%{_kde4_libdir}/*.a

%if 0%{?suse_version}
%suse_update_desktop_file -r %{name} Qt KDE Graphics Photography
%suse_update_desktop_file -r showfoto Qt KDE Graphics Photography
%suse_update_desktop_file -r dngconverter Qt KDE Graphics Photography
%suse_update_desktop_file -r expoblending Qt KDE Graphics Photography
%suse_update_desktop_file -r panoramagui Qt KDE Graphics Photography
%suse_update_desktop_file -r scangui Qt KDE Graphics Scanning

%find_lang %{name}

%if 0%{?suse_version} <= 1320 && !0%{?is_opensuse}
%find_lang libkgeomap libkgeomap.lang

%if 0%{?kde_updatedapps}
%find_lang libkipi libkipi.lang
rm -f %{buildroot}/usr/share/locale/*/LC_MESSAGES/

%find_lang kipiplugins kipiplugin.lang

for l in acquireimages advancedslideshow batchprocessimages calendar debianscreenshots dlnaexport dngconverter dropbox expoblending facebook flashexport flickrexport galleryexport googledrive gpssync htmlexport imageshackexport imageviewer imgurexport ipodexport jalbumexport jpeglossless kioexportimport kmlexport kopete metadataedit panorama photolayouteditor piwigoexport printimages rajceexport rawconverter removeredeyes sendimages shwup smug timeadjust videoslideshow vkontakte wikimedia yandexfotki;
%find_lang kipiplugin_$l kipiplugin.lang

# this allows the icon to be used as an application icon safely
for res in 16x16 22x22 32x32 48x48 64x64 128x128
pushd %{buildroot}%{_kde4_iconsdir}/hicolor/$res/apps/
ln -s %{_kde4_iconsdir}/oxygen/$res/apps/rawconverter.png
pushd %{buildroot}%{_kde4_iconsdir}/hicolor/scalable/apps/
ln -s %{_kde4_iconsdir}/oxygen/scalable/apps/rawconverter.svgz

%fdupes -s %{buildroot}


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

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

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

%if 0%{?suse_version} <= 1320 && !0%{?is_opensuse}
%post -n libkgeomap2 -p /sbin/ldconfig

%postun -n libkgeomap2 -p /sbin/ldconfig

%if 0%{?suse_version} < 1320 && !0%{?is_opensuse}
%post -n libkface3 -p /sbin/ldconfig

%postun -n libkface3 -p /sbin/ldconfig

%post -n libmediawiki1 -p /sbin/ldconfig

%postun -n libmediawiki1 -p /sbin/ldconfig

%dir %{_kde4_iconsdir}/hicolor/*
%dir %{_kde4_iconsdir}/hicolor/*/apps
%dir %{_kde4_datadir}/appdata

%files doc
%doc %{_kde4_htmldir}/*/
%doc %{_mandir}/man1/cleanup_digikamdb.1%{ext_man}
%doc %{_mandir}/man1/digitaglinktree.1%{ext_man}

%files lang -f %{name}.lang
%exclude %{_kde4_htmldir}/

%files -n kipi-plugins
%exclude %{_kde4_applicationsdir}/digikam.desktop
%exclude %{_kde4_applicationsdir}/showfoto.desktop
%exclude %{_kde4_applicationsdir}/scangui.desktop
%dir %{_kde4_iconsdir}/hicolor/24x24/apps
%exclude %{_kde4_iconsdir}/hicolor/*/apps/kipi-gpsimagetag.png
%exclude %{_kde4_modulesdir}/
%exclude %{_kde4_modulesdir}/
%exclude %{_kde4_servicesdir}/kipiplugin_acquireimages.desktop
%exclude %{_kde4_servicesdir}/kipiplugin_gpssync.desktop
%dir %{_kde4_sharedir}/templates

%files -n kipi-plugins-lang -f kipiplugin.lang
%exclude %{_kde4_htmldir}/en/kipi-plugins

%files -n kipi-plugins-acquireimage

%files -n kipi-plugins-geolocation

%if 0%{?suse_version} <= 1320 && !0%{?is_opensuse}
%files -n libkgeomap-devel

%files -n libkgeomap-lang -f libkgeomap.lang

%files -n libkgeomap2

%if 0%{?suse_version} < 1320 && !0%{?is_opensuse}
%files -n libkface3

%files -n libkface-devel
%dir %{_kde4_libdir}/cmake/Kface-3.5.0/

%files -n libmediawiki1

%files -n libmediawiki-devel

openSUSE Build Service is sponsored by