diff options
Diffstat (limited to 'freefilesync/freefilesync.spec')
-rw-r--r-- | freefilesync/freefilesync.spec | 157 |
1 files changed, 101 insertions, 56 deletions
diff --git a/freefilesync/freefilesync.spec b/freefilesync/freefilesync.spec index 76d9c4b..83012d8 100644 --- a/freefilesync/freefilesync.spec +++ b/freefilesync/freefilesync.spec @@ -6,17 +6,29 @@ %define min_libssh2 %{nil} %define min_openssl %{nil} %define scl_env %{nil} -%define scl_buildreq coreutils +%define scl_buildreq %{nil} %if 0%{?el6}%{?el7} %define scl_env devtoolset-7 %define scl_buildreq devtoolset-7-toolchain - %define min_libcurl >= 7.64.0 + %define min_libcurl >= 7.61.0 %define min_libssh2 >= 1.8.0 %define min_openssl >= 1.1.1c %endif +%if 0%{?el8} + %define scl_env gcc-toolset-11 + %define scl_buildreq gcc-toolset-11-gcc-c++, gcc-toolset-11-annobin-plugin-gcc + %define min_libcurl >= 7.61.0 + %define min_libssh2 >= 1.9.0 + %define min_openssl >= 1.1.1k +%endif %define libssh2_name libssh2 -%if 0%{?rhel} >= 8 -%define libssh2_name libssh2-%{name} +%define openssl_name openssl +# EL8 copr has some dnf module weirdness with libssh2, not a version problem. +%if 0%{?el6}%{?el7}%{?el8} +%define libssh2_name libssh2-freefilesync +%endif +%if 0%{?el6}%{?el7} +%define openssl_name openssl-freefilesync %endif %if 0%{?fedora} >= 36 # https://www.spinics.net/lists/fedora-devel/msg296646.html @@ -37,22 +49,28 @@ Source0: https://gitlab.com/opensource-tracking/%{pkgname}/-/archive/%{versio 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 -Patch10: revert_zenju_aggressive_upstreamisms.patch -Patch11: ffs_traditional_view.patch -Patch12: ffs_desktop_notifications.patch -Patch13: ffs_openssl.patch -Patch14: ffs_icon_loader.patch -Patch15: ffs_no_gcc12.patch +# all rpm distros use these +Patch0: 00_allow_parallel_ops.patch +Patch1: 01_no_check_updates.patch +Patch2: 02_no_wx311.patch +Patch3: 03_sftp.patch +Patch4: 04_revert_zenju_aggressive_upstreamisms.patch +Patch5: 05_traditional_view.patch +Patch6: 06_icon_loader.patch +Patch7: 07_libssh2.patch +# distro specific patches +## Fedora and EL8 +Patch20: ffs_distro_fedora.patch +## EL6 and EL7 +Patch30: ffs_distro_el6_el7.patch +Patch31: ffs_el6_el7_bit.patch +Patch32: ffs_el6_el7_no_eraseif.patch +# dependency specific +Patch40: ffs_openssl.patch +Patch41: ffs_no_gcc12.patch +Patch60: ffs_desktop_notifications.patch +Patch70: ffs_libcurl_7.61.1.patch +Patch71: ffs_libcurl_7.71.1.patch Packager: B. Stack <bgstack15@gmail.com> BuildRequires: brotli-devel @@ -60,22 +78,34 @@ BuildRequires: wxGTK3-devel BuildRequires: desktop-file-utils BuildRequires: gcc-c++ BuildRequires: ImageMagick +%if "%{?min_libcurl}" != "" BuildRequires: libcurl-devel %{min_libcurl} +%else +BuildRequires: libcurl-devel +%endif +%if "%{?min_libssh2}" != "" BuildRequires: %{libssh2_name}-devel %{min_libssh2} +%else +BuildRequires: %{libssh2_name}-devel +%endif BuildRequires: patch BuildRequires: pkgconfig(giomm-2.4) BuildRequires: pkgconfig(gtk+-2.0) BuildRequires: pkgconfig(libselinux) BuildRequires: pkgconfig(zlib) -%if 0%{?el6}%{?el7} +# We need the binary so we can check version number +BuildRequires: %{openssl_name} +%if "%{?scl_buildreq}" != "" BuildRequires: %{scl_buildreq} -BuildRequires: openssl-%{name}-devel %{min_openssl} -Requires: libcurl %{min_libcurl} -Requires: %{libssh2_name} %{min_libssh2} -Requires: openssl-%{name}-libs %{min_openssl} +%endif +%if "%{?min_openssl}" != "" +BuildRequires: %{openssl_name}-devel %{min_openssl} %else -BuildRequires: openssl-devel +BuildRequires: %{openssl_name}-devel %endif +#Requires: libcurl %%{?min_libcurl} +#Requires: %%{libssh2_name} %%{?min_libssh2} +#Requires: openssl-%%{name}-libs %%{?min_openssl} Requires: hicolor-icon-theme Requires: xdg-utils Provides: mimehandler(application/x-freefilesync-ffs) @@ -90,37 +120,60 @@ 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 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 %if 0%{?el6}%{?el7} # use the el patch -%patch5 -p1 +%patch30 -p1 +%patch31 -p1 +%patch32 -p1 %else # use the fedora patch, even for el8 -%patch4 -p1 +%patch20 -p1 %endif -%patch6 -p1 -%patch7 -p1 -%if 0%{?el6}%{?el7}%{?el8}%{?fc29} -%patch8 -p1 -%patch9 -p1 +# Determine if openssl < 3.0.0 +opensslver="$( openssl version | awk '{if($2>=3){print "3"}else{print"1"}}' )" +if test ${opensslver} -lt 3 ; +then +%patch40 -p1 +fi +# Determine if g++ < 12 +g__version="$( +%if "%{?scl_env}" != "" + scl enable %{scl_env} /bin/bash <<'EOFSCL' %endif -%patch10 -p1 -%patch11 -p1 -%patch12 -p1 -%if 0%{?fedora} < 36 -# Patch13 openssl is only for openssl < 3.0.0 -%patch13 -p1 + g++ --version +%if "%{?scl_env}" != "" +EOFSCL %endif -%patch14 -p1 -%patch15 -p1 +)" +g__version="$( echo "${g__version}" | awk 'NR==1{if($3>=12){print "12"}else{print"11"}}' )" +echo "G__version=${g_version}" +if test ${g__version} -lt 12 ; +then +%patch41 -p1 +fi +# desktop notifications merely has to happen after distro patch +%patch60 -p1 +# Determine version of libcurl +%define libcurl_ver %( rpm -q libcurl-devel --queryformat '%%{version}' ) +case "%{libcurl_ver}" in + 7.61.1) +%patch70 -p1 + ;; + *) +%patch71 -p1 + ;; +esac # custom build parameters for packaging application in rpm # fedora provides build_cxxflags, which is really just optflags @@ -144,7 +197,7 @@ EOFSCL %install %if !%{dummy_package} -# removed by upstream! +# removed by upstream around version 11 #%%make_install -C %%{pkgname}/Source #%%make_install -C %%{pkgname}/Source/%%{prog2name} pushd %{pkgname}/Build @@ -162,12 +215,6 @@ 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} @@ -195,12 +242,6 @@ done %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 @@ -224,6 +265,10 @@ update-mime-database -n ${_datadir}/mime 1>/dev/null 2>&1 & : %ghost %config %attr(666, -, -) %{_datadir}/%{name}/GlobalSettings.xml %changelog +* Tue Jun 07 2022 B. Stack <bgstack15@gmail.com> - 11.21-2 +- rewrite spec for easier cross-distro support +- fix builds for el8 + * Wed May 25 2022 B. Stack <bgstack15@gmail.com> - 11.21-1 - version bump - add ffs_no_gcc12 patch |