File kup.spec of Package kup-kf5

Name:           kup
Version:        0.7.3
Release:        1
Summary:        A KDE-based frontend for the very excellent bup backup software
License:        GPL-2.0+
Url:            http://kde-apps.org/content/show.php/Kup+Backup+System?content=147465
Group:          System/GUI/KDE
Source:         %{name}-%{version}.tar.gz

BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%if 0%{?fedora}
BuildRequires:  extra-cmake-modules
BuildRequires:  python
BuildRequires:  gettext

BuildRequires:  desktop-file-utils
BuildRequires:  kf5-rpm-macros

BuildRequires:  qt5-qtbase-devel

BuildRequires:  kf5-kcoreaddons-devel
BuildRequires:  kf5-kdbusaddons-devel
BuildRequires:  kf5-ki18n-devel
BuildRequires:  kf5-kio-devel
BuildRequires:  kf5-solid-devel
BuildRequires:  kf5-kidletime-devel
BuildRequires:  kf5-knotifications-devel
BuildRequires:  kf5-kiconthemes-devel
BuildRequires:  kf5-kconfig-devel
BuildRequires:  kf5-kinit-devel
BuildRequires:  kf5-plasma-devel
%endif

%if 0%{?suse_version}
BuildRequires:  extra-cmake-modules
BuildRequires:  gettext

BuildRequires:  pkgconfig(Qt5Widgets)

BuildRequires:  kf5-filesystem
BuildRequires:  kcoreaddons-devel
BuildRequires:  kdbusaddons-devel
BuildRequires:  ki18n-devel
BuildRequires:  kio-devel
BuildRequires:  solid-devel
BuildRequires:  kidletime-devel
BuildRequires:  knotifications-devel
BuildRequires:  kiconthemes-devel
BuildRequires:  kconfig-devel
BuildRequires:  kinit-devel
BuildRequires:  kwindowsystem-devel
BuildRequires:  cmake(KF5Plasma)
%endif

%prep
%setup -q -n %{name}-%{version}

%if 0%{?fedora}

%build
mkdir -p %{_target_platform}
pushd %{_target_platform}
%{cmake_kf5} ..
popd

#make %{?_smp_mflags} -C %{_target_platform}
make -C %{_target_platform}

%install
make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
%find_lang %{name}

# %check
# desktop-file-validate %{buildroot}%{_kf5_sysconfdir}/xdg/autostart/kup-daemon.desktop

%post
touch --no-create %{_kf5_datadir}/icons/hicolor &> /dev/null ||:

%posttrans
gtk-update-icon-cache %{_kf5_datadir}/icons/hicolor &> /dev/null ||:
update-desktop-database -q &> /dev/null ||:

%postun
if [ $1 -eq 0 ] ; then
touch --no-create %{_kf5_datadir}/icons/hicolor &> /dev/null ||:
gtk-update-icon-cache %{_kf5_datadir}/icons/hicolor &> /dev/null ||:
update-desktop-database -q &> /dev/null ||:
fi

%endif

%if 0%{?suse_version}

%build
%cmake_kf5 -d build -- -DLIB_INSTALL_DIR:PATH=%{_lib}
%make_jobs

%install
%{kf5_makeinstall} -C build
%find_lang %{name}

%endif

%description
Kup currently consists of two parts:

- Configuration module, available in your system settings. Here you can configure backup
plans, what to include, where to backup to and how often. You can also see the status for
these backup plans to monitor if you're running low on disk space etc.
- A small program running in the background, with a system tray icon that shows up when
a backup destination is available. This program will monitor to see when your backup destination
is available and schedule and run backups.

Author(s):
  Simon Persson <simonpersson1@gmail.com> 

%clean
rm -rf $RPM_BUILD_ROOT

%if 0%{?fedora}

%files -f %{name}.lang
%defattr(-,root,root)
%{_kf5_qtplugindir}/kcm_kup.so
%{_kf5_qtplugindir}/kio_bup.so
%{_kf5_qtplugindir}/plasma/dataengine/plasma_engine_kup.so

%{_kf5_bindir}/kup-daemon
%{_kf5_bindir}/kup-filedigger

/usr/lib/libgit24kup.so
/usr/lib/libgit24kup.so.0
/usr/lib/libgit24kup.so.0.19.0
%{_kf5_libdir}/libkdeinit5_kup-daemon.so

%{_kf5_sysconfdir}/xdg/autostart/kup-daemon.desktop

/usr/share/

%{_kf5_datadir}/knotifications5/kupdaemon.notifyrc
%{_kf5_datadir}/kservices5/
%{_kf5_datadir}/plasma/services/kupservice.operations
%{_kf5_datadir}/plasma/plasmoids/
%{_kf5_datadir}/icons/hicolor/*/*/*

%endif

%if 0%{?suse_version}

%files -f %{name}.lang
%defattr(-,root,root)
%{_kf5_plugindir}/

%{_kf5_bindir}/kup-daemon
%{_kf5_bindir}/kup-filedigger

%{_libdir}/libgit24kup.so
%{_libdir}/libgit24kup.so.0
%{_libdir}/libgit24kup.so.0.19.0
%{_kf5_libdir}/libkdeinit5_kup-daemon.so

%{_kf5_configdir}/autostart/kup-daemon.desktop

/usr/share/

%{_kf5_sharedir}/knotifications5/kupdaemon.notifyrc
%{_kf5_sharedir}/plasma/services/kupservice.operations

%{_kf5_iconsdir}/hicolor/*/*/*

%{_kf5_servicesdir}/
%{_kf5_plasmadir}/
%endif


%changelog