%global pkgname FreeFileSync %global prog2name RealTimeSync %global dummy_package 0 %define min_libcurl %{nil} %define min_libssh2 %{nil} %define min_openssl %{nil} %define scl_env %{nil} %define scl_buildreq coreutils %if 0%{?el6}%{?el7} %define scl_env devtoolset-7 %define scl_buildreq devtoolset-7-toolchain %define min_libcurl >= 7.64.0 %define min_libssh2 >= 1.8.0 %define min_openssl >= 1.1.1c %endif %define libssh2_name libssh2 %if 0%{?rhel} >= 8 %define libssh2_name libssh2-%{name} %endif Name: freefilesync Version: 10.19 Release: 1%{?dist} Summary: A file synchronization utility Group: Applications/File License: GPLv3 URL: http://www.freefilesync.org/ # upstream does not provide easy automatic downloads of the source, so use the mirror #Source0: http://www.freefilesync.org/download/%%{pkgname}_%%{version}_Source.zip Source0: https://gitlab.com/opensource-tracking/%{pkgname}/-/archive/%{version}/%{pkgname}-%{version}.tar.gz Source1: %{pkgname}.desktop Source2: %{prog2name}.desktop Source3: %{name}.xml Patch0: ffs_allow_parallel_ops.patch Patch1: ffs_no_check_updates.patch Patch2: ffs_no_wx311.patch Patch3: ffs_sftp.patch Patch4: ffs_fedora.patch Patch5: ffs_el.patch Patch6: ffs_libssh2.patch Patch7: ffs_curl.patch Patch8: ffs_bit.patch Patch9: ffs_no_eraseif.patch Packager: B Stack # WARNING: the build will FAIL if you have wxGTK3-devel installed. Only wxGTK2-devel should be on the build system. BuildRequires: compat-wxGTK3-gtk2-devel BuildRequires: desktop-file-utils BuildRequires: gcc-c++ BuildRequires: ImageMagick BuildRequires: libcurl-devel %{min_libcurl} BuildRequires: %{libssh2_name}-devel %{min_libssh2} BuildRequires: patch BuildRequires: pkgconfig(gtk+-2.0) BuildRequires: pkgconfig(libselinux) BuildRequires: pkgconfig(zlib) %if 0%{?el6}%{?el7} BuildRequires: wxGTK-devel BuildRequires: %{scl_buildreq} BuildRequires: openssl-%{name}-devel %{min_openssl} Requires: libcurl %{min_libcurl} Requires: %{libssh2_name} %{min_libssh2} Requires: openssl-%{name}-libs %{min_openssl} %else BuildRequires: openssl-devel %endif Requires: hicolor-icon-theme Requires: xdg-utils Provides: mimehandler(application/x-freefilesync-ffs) Provides: mimehandler(application/x-freefilesync-real) Provides: mimehandler(application/x-freefilesync-batch) %description FreeFileSync is a free Open Source software that helps you synchronize files and synchronize folders for Windows, Linux and macOS. It is designed to save your time setting up and running backup jobs while having nice visual feedback along the way. %prep %setup -n %{pkgname}-%{version} # fix text file line endings and permissions to unix find . ! -type d \( -name '*.c' -o -name '*.cpp' -o -name '*.h' \) \ -exec %{__sed} -i -r -e 's/\r$//' {} + %patch0 -p1 %patch1 -p1 %patch2 -p1 %patch3 -p1 %if 0%{?el6}%{?el7} # use the el patch %patch5 -p1 %else # use the fedora patch %patch4 -p1 %endif %patch6 -p1 %patch7 -p1 %if 0%{?el6}%{?el7}%{?el8}%{?fc29} %patch8 -p1 %patch9 -p1 %endif # custom build parameters for packaging application in rpm # fedora provides build_cxxflags, which is really just optflags %{__sed} \ -e 's|-O3 -DNDEBUG|-DNDEBUG -D"warn_static(arg)= " -DZEN_LINUX %{?build_cxxflags:%{build_cxxflags}}%{!?build_cxxflags:%{optflags}}|g' \ -e '/LINKFLAGS/s|-s|%{__global_ldflags}|;' \ -i %{pkgname}/Source/Makefile %{pkgname}/Source/%{prog2name}/Makefile %build %if !%{dummy_package} %if "%{?scl_env}" != "" scl enable %{scl_env} /bin/bash << 'EOFSCL' %endif %make_build -C %{pkgname}/Source %make_build -C %{pkgname}/Source/%{prog2name} %if "%{?scl_env}" != "" EOFSCL %endif %endif %install %if !%{dummy_package} # removed by upstream! #%%make_install -C %%{pkgname}/Source #%%make_install -C %%{pkgname}/Source/%%{prog2name} pushd %{pkgname}/Build install -d %{buildroot}%{_bindir} %{buildroot}%{_datadir}/%{name} install -Dm 0755 -t %{buildroot}%{_bindir} Bin/%{pkgname} Bin/%{prog2name} cd Resources ; cp -pr * %{buildroot}%{_datadir}/%{name} popd %endif # make extra sure the files are not marked with executable find %{buildroot}%{_datadir}/%{name} -type f -exec chmod -x '{}' \; || : # desktop files mkdir -p %{buildroot}%{_datadir}/applications desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE1} desktop-file-install --dir %{buildroot}%{_datadir}/applications %{SOURCE2} # application start script # none # man pages # none # mimetypes install -d %{buildroot}%{_datadir}/mime/packages install -Dm 0644 -t %{buildroot}%{_datadir}/mime/packages %{SOURCE3} # icons unzip %{pkgname}/Build/Resources/Icons.zip file_batch.png file_sync.png ff=" -filter Lanczos" for res in 16 22 24 32 48 64 96 128 256 ;do dir=%{buildroot}%{_datadir}/icons/hicolor/${res}x${res} rr=" -resize ${res}x${res}" mkdir -p ${dir}/apps ${dir}/mimetypes # apps convert %{pkgname}/Build/Resources/%{pkgname}.png ${ff} ${rr} ${dir}/apps/%{pkgname}.png convert %{pkgname}/Build/Resources/%{prog2name}.png ${ff} ${rr} ${dir}/apps/%{prog2name}.png # mimetypes convert file_batch.png ${ff} ${rr} ${dir}/mimetypes/application-x-freefilesync-batch.png convert file_sync.png ${ff} ${rr} ${dir}/mimetypes/application-x-freefilesync-ffs.png convert %{pkgname}/Build/Resources/%{prog2name}.png ${ff} ${rr} ${dir}/mimetypes/application-x-freefilesync-real.png done %clean %{__rm} -rf %{buildroot} || : %post touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : %preun # is it a final removal? #if test "$1" = "0" ; #then #fi %postun if test "$1" = "0" ; then touch --no-create %{_datadir}/icons/hicolor &>/dev/null fi %posttrans update-desktop-database 1>/dev/null 2>&1 & : gtk-update-icon-cache %{_datadir}/icons/hicolor 1>/dev/null 2>&1 & : update-mime-database -n ${_datadir}/mime 1>/dev/null 2>&1 & : %files %license %attr(444, -, -) License.txt %doc %attr(444, -, -) Changelog.txt %{_bindir}/%{pkgname} %{_bindir}/%{prog2name} %{_datadir}/applications/*.desktop %{_datadir}/icons/hicolor/*x*/*/*.png %{_datadir}/mime/packages/* %{_datadir}/%{name} %ghost %config %attr(666, -, -) %{_datadir}/%{name}/GlobalSettings.xml %changelog * Fri Dec 27 2019 B Stack - 10.19-1 - version bump * Thu Nov 21 2019 B Stack - 10.18-2 - el and fc29 reverted to devtoolset-7, -std=c++17, and some older internal logic * Wed Nov 20 2019 B Stack - 10.18-1 - version bump * Wed Oct 23 2019 B Stack - 10.17-1 - version bump - el7 uses devtoolset-8 for c++2a support * Wed Oct 09 2019 B Stack - 10.16-2 - include support for el8 * Tue Sep 17 2019 B Stack - 10.16-1 - version bump * Thu Aug 15 2019 B Stack - 10.15-1 - version bump * Tue Jul 16 2019 B Stack - 10.14-3 - completely disable update-check * Tue Jul 16 2019 B Stack - 10.14-2 - adjust dependencies for el7 * Mon Jul 15 2019 B Stack - 10.14-1 - version bump * Sat Jun 15 2019 B Stack - 10.13-1 - version bump - improve mimetype icon deployment - add mimetypes, to match dpkg * Sun May 12 2019 B Stack - 10.12-1 - version bump - improve icons used from upstream, to match dpkg - add mimetypes, to match dpkg * Fri Apr 12 2019 B Stack - 10.11-1 - version bump * Tue Feb 12 2019 B Stack - 10.10-1 - version bump - add libssh2 patch from AUR * Tue Feb 12 2019 B Stack - 10.9-1 - version bump - add manual install that is now absent from upstream - move datadir to lowercase name instead of camelcase * Thu Jan 17 2019 B Stack - 10.8-1 - version bump * Tue Dec 18 2018 B Stack - 10.7-1 - version bump * Fri Nov 16 2018 B Stack - 10.6-3 - version bump * Tue Oct 16 2018 B Stack - 10.5-1 - version bump * Mon Sep 10 2018 B Stack - 10.4-1 - version bump * Wed Aug 29 2018 B Stack - 10.3-3 - forked from phantomx release * Fri Aug 17 2018 Phantom X - 10.3-1 - 10.3