File qt-fsarchiver.spec of Package qt-fsarchiver
#
# spec file for package qt-fsarchiver
#
# 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 https://bugs.opensuse.org/
# or upstream https://sourceforge.net/p/qt-fsarchiver/tickets/
%define custom_version 1.8.7-0
Name: qt-fsarchiver
Version: 1.8.7_0
Release: 0
Summary: Qt GUI for fsarchiver
License: GPL-2.0-or-later
Group: System/Filesystems
URL: http://qt-fsarchiver.sourceforge.net/
Source0: https://sourceforge.net/projects/qt-fsarchiver/files/source/qt-fsarchiver/%{name}-%{custom_version}.tar.gz
Patch1: %{name}-xattr.patch
BuildRequires: e2fsprogs-devel
BuildRequires: libattr-devel
BuildRequires: libgcrypt-devel
BuildRequires: libgpg-error-devel
BuildRequires: libqt5-linguist
BuildRequires: pkgconfig
BuildRequires: update-desktop-files
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(blkid)
BuildRequires: pkgconfig(bzip2)
BuildRequires: pkgconfig(com_err)
BuildRequires: pkgconfig(e2p)
BuildRequires: pkgconfig(liblz4)
BuildRequires: pkgconfig(liblzma)
BuildRequires: pkgconfig(libzip)
BuildRequires: pkgconfig(libzstd)
BuildRequires: pkgconfig(lzo2)
BuildRequires: pkgconfig(uuid)
BuildRequires: pkgconfig(zlib)
Requires: btrfsprogs
Requires: gdisk
Requires: jfsutils
Requires: nfs-kernel-server
Requires: nmap
Requires: samba
Requires: sshfs
Requires: xfsprogs
%description
qt-fsarchiver is a GUI for the program fsarchiver to backup/save/restore partitions and folders.
%prep
%setup -q -n %{name}
%patch1 -p1
rm -f .qmake.stash
sed "s|target.path = /usr/sbin|target.path = %{_sbindir}|" -i %{name}.pro
sed "s|icon.path = /usr/share/app-install/icons|icon.path = %{_datadir}/icons/hicolor/48x48/apps|" -i %{name}.pro
sed "s|autostart.path = /usr/share/applications|autostart.path = %{_datadir}/applications|" -i %{name}.pro
sed "s|DOC_DIR = /usr/share/doc/qt-fsarchiver|DOC_DIR = %{_defaultdocdir}/%{name}|" -i %{name}.pro
sed "s|Icon=/usr/share/app-install/icons/harddrive2.png|Icon=%{name}|" -i starter/%{name}.desktop
%build
%qmake5 %{name}.pro
%make_jobs
%install
%make_install INSTALL_ROOT=%{buildroot}
#clean doc directory from backup files
rm -rf %{buildroot}%{_datadir}/doc/%{name}/*~
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/48x48/apps
mkdir -p %{buildroot}%{_datadir}/applications
mv ~/rpmbuild/BUILD/qt-fsarchiver/src/sbin/qt-fsarchiver.sh %{buildroot}/%{_sbindir}
install -m 0644 -p translations/*.qm %{buildroot}%{_datadir}/qt5/translations/
%suse_update_desktop_file -r %{name} System Filesystem
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%{_sbindir}/%{name}
%{_sbindir}/%{name}.sh
%defattr(644,root,root,755)
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/qt-fsarchiver.png
%dir %{_datadir}/icons/hicolor/48x48
%dir %{_datadir}/icons/hicolor/48x48/apps
%{_defaultdocdir}/%{name}
%dir %{_datadir}/qt5
%dir %{_datadir}/qt5/translations
%{_datadir}/qt5/translations/%{name}*.qm
%changelog