File kdrive.spec of Package kdrive

#
# spec file for package kdrive
#
# Copyright (c) 2025 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#


Name:           kdrive
Version:        3.7.1git.20250709T084254~e86d18acf
Release:        0
Summary:        kDrive desktop synchronisation client
License:        GPL-3.0-or-later
URL:            https://kdrive.infomaniak.com
Source0:        desktop-kDrive-%{version}.tar.xz
# Used for build date
Source99:       kdrive.changes
Patch0:         0001-Fix-build-errors-with-CMake-4.patch
Patch1:         0002-Add-CMake-module-to-find-log4cplus.patch
Patch2:         0003-Set-theme-to-infomaniak-if-no-custom-theme-was-defin.patch
Patch3:         0004-Add-CMake-module-to-find-system-utf8proc.patch
Patch4:         0005-Add-CMake-module-to-find-xxhash.patch
Patch5:         0006-Print-summary-after-running-CMake.patch
Patch6:         0007-Define-SYSCONFDIR-for-unix-like-builds.patch
Patch7:         0008-Fix-excluded-template-location.patch
Patch8:         0009-Allow-using-system-sqlite3.patch
Patch9:         0010-Add-a-systemd-user-unit-file.patch
BuildRequires:  kf6-extra-cmake-modules
# Packaging bug, libzip cmake files defines libzip::zipcmp which needs the executable
BuildRequires:  libzip-tools
BuildRequires:  pkgconfig
BuildRequires:  cmake(libzip)
BuildRequires:  cmake(Poco) >= 1.13.3
BuildRequires:  cmake(Qt6Concurrent)
BuildRequires:  cmake(Qt6Core)
BuildRequires:  cmake(Qt6Core5Compat)
BuildRequires:  cmake(Qt6DBus)
BuildRequires:  cmake(Qt6Gui)
BuildRequires:  cmake(Qt6LinguistTools)
BuildRequires:  cmake(Qt6Network)
BuildRequires:  cmake(Qt6Sql)
BuildRequires:  cmake(Qt6Svg)
BuildRequires:  cmake(Qt6SvgWidgets)
BuildRequires:  cmake(Qt6WebEngineCore)
BuildRequires:  cmake(Qt6WebEngineWidgets)
BuildRequires:  cmake(Qt6Widgets)
BuildRequires:  cmake(sentry)
BuildRequires:  pkgconfig(libsecret-1)
BuildRequires:  pkgconfig(libutf8proc)
BuildRequires:  pkgconfig(libxxhash)
BuildRequires:  pkgconfig(log4cplus) >= 2.1.0
BuildRequires:  pkgconfig(sqlite3)
Requires:       qt6-sql-sqlite
Requires:       sentry-native
Requires(post): shared-mime-info

%description
The Desktop application for kDrive by Infomaniak, used to synchronize and share files.

%prep
%autosetup -p1 -n desktop-kDrive-%{version}

rm -r src/3rdparty/{sqlite3,utf8proc}

%build
# Use mtime for build date
CHANGES_MTIME=`stat --format="%%y" %{SOURCE99} | cut -d' ' -f 1 | sed -e 's#-##g'`

%cmake_qt6 \
  -DKDRIVE_VERSION_BUILD:STRING=${CHANGES_MTIME} \
  -DKDRIVE_VERSION_SUFFIX:STRING="-openSUSE" \
  -DSYSCONFDIR:STRING="%{_sysconfdir}" \
  -DINSTALL_SYSTEMD_USER_UNIT:BOOL=TRUE

%qt6_build

%install
%qt6_install

# Unneeded
rm %{buildroot}%{_qt6_prefix}/lib/libkeychain.a
rm -r %{buildroot}%{_includedir}/keychain

# Needless copies for packages
rm %{buildroot}%{_sysconfdir}/kDrive/*.so

# Already installed by the sentry package
rm %{buildroot}%{_bindir}/crashpad_handler

%check

%ldconfig_scriptlets

%files
%license LICENSE
%doc README.md
%dir %{_sysconfdir}/kDrive
%config %{_sysconfdir}/kDrive/sync-exclude.lst
%{_bindir}/kDrive
%{_bindir}/kDrive_client
%{_qt6_sharedir}/applications/kDrive_client.desktop
%{_qt6_sharedir}/icons/hicolor/*/apps/kdrive-win.png
%{_qt6_sharedir}/kDrive_client/
%{_userunitdir}/infomaniak-kdrive.service

%changelog

openSUSE Build Service is sponsored by