File megasync.spec of Package megasync
#
# spec file for package megasync
#
# 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/
#
%define lrelease_qt5 /usr/bin/lrelease-qt5
%define fullreqs "CONFIG += FULLREQUIREMENTS"
%global sdk_ver 3.9.6a
%define _lto_cflags %{nil}
Name: megasync
Version: 4.6.2.0
Release: 0
Summary: Syncing utility your MEGA Cloud Drive
License: NonFree
Group: Productivity/Networking/File-Sharing
URL: https://mega.nz/sync
Source0: https://github.com/meganz/MEGAsync/archive/v%{version}_CentOS7.tar.gz#/%{name}-%{version}.tar.gz
Source1: https://github.com/meganz/sdk/archive/v%{sdk_ver}.tar.gz
Patch0: fix-build.patch
#%if 0%{?sle_version} >= 150000
Patch1: megasync-implicit-fortify-decl.patch
#%endif
BuildRequires: wget
BuildRequires: unzip
BuildRequires: fdupes
BuildRequires: ccache
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: ffmpeg-devel
BuildRequires: freeimage-devel
BuildRequires: fontpackages-devel
BuildRequires: hicolor-icon-theme
BuildRequires: desktop-file-utils
BuildRequires: extra-cmake-modules
BuildRequires: libqt5-qttools-devel
BuildRequires: update-desktop-files
BuildRequires: terminus-bitmap-fonts
BuildRequires: libqt5-qtbase-common-devel
BuildRequires: libqt5-qtbase-devel >= 5.6
BuildRequires: libqt5-linguist
BuildRequires: pkgconfig
BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(libuv)
BuildRequires: pkgconfig(libzen)
BuildRequires: pkgconfig(Qt5Svg)
BuildRequires: pkgconfig(libraw)
BuildRequires: pkgconfig(openssl)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(libcares)
BuildRequires: pkgconfig(libsodium)
BuildRequires: pkgconfig(thunarx-3)
BuildRequires: pkgconfig(Qt5X11Extras)
BuildRequires: pkgconfig(libmediainfo)
BuildRequires: pkgconfig(cryptopp) >= 5.6.5
BuildRequires: pkgconfig(libnautilus-extension) >= 2.16.0
BuildRequires: pkgconfig(libnemo-extension)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(readline)
BuildRequires: pkgconfig(libudev)
BuildRequires: pkgconfig(libavcodec)
BuildRequires: cmake(KF5KIO)
BuildRequires: cmake(KF5CoreAddons)
%description
Secure:
Your data is encrypted end to end. Nobody can intercept it while in storage or in transit.
Flexible:
Sync any folder from your PC to any folder in the cloud. Sync any number of folders in parallel.
Fast:
Take advantage of MEGA's high-powered infrastructure and multi-connection transfers.
Generous:
Store up to 50 GB for free!
%package -n nemo-%{name}
Summary: Extension for Nemo
Requires: nemo
Requires: %{name} = %{version}
Supplements: (%{name} and nemo)
%description -n nemo-%{name}
Extension for the file manager Nemo.
%package -n nautilus-%{name}
Summary: Extension for Nautilus
Requires: nautilus
Requires: %{name} = %{version}
Supplements: (%{name} and nautilus)
%description -n nautilus-%{name}
Extension for the file manager Nautilus.
%package -n thunar-%{name}
Summary: Extension for Nautilus
Requires: thunar
Requires: %{name} = %{version}
Supplements: (%{name} and thunar)
%description -n thunar-%{name}
Extension for the file manager Nautilus.
%package -n dolphin-%{name}
Summary: Extension for Dolphin
Requires: dolphin
Requires: %{name} = %{version}
Supplements: (%{name} and dolphin)
%description -n dolphin-%{name}
Extension for the file manager Dolphin.
%prep
%setup -n MEGAsync-%{version}_CentOS7 -qa1
mv sdk-%{sdk_ver}/* src/MEGASync/mega/
find {LICENCE,README,CREDITS}.md -type f -perm /111 -exec chmod 644 {} \;
mv src/MEGASync/mega/LICENSE LICENSE-SDK
mkdir -p src/{MEGAShellExtDolphin/build,MEGAShellExtNautilus/build,MEGAShellExtNemo/build,MEGAShellExtThunar/build}
mkdir -p %{buildroot}%{_libdir}/{nautilus/extensions-3.0,nemo/extensions-3.0}
%patch0 -p1
#%if 0%{?sle_version} >= 150000
%patch1 -p1
#%endif
%build
sed -i '/qlite_pkg $build_dir $install_dir/d' src/MEGASync/mega/contrib/build_sdk.sh
export DESKTOP_DESTDIR=%{buildroot}%{_prefix}
pushd src/MEGASync/mega
./autogen.sh
./configure
popd
pushd src
./configure -i -z
%qmake5 \
%{fullreqs} \
THE_RPM_BUILD_ROOT=%{buildroot} \
DESTDIR=%{buildroot}%{_bindir}
%{lrelease_qt5} MEGASync/MEGASync.pro
pwd
%make_build
popd
pushd src/MEGAShellExtNemo/build
%qmake5 ..
%make_build
popd
pushd src/MEGAShellExtNautilus/build
%qmake5 ..
%make_build
popd
pushd src/MEGAShellExtThunar/build
%qmake5 ..
%make_build
popd
pushd src/MEGAShellExtDolphin/build
rm ../megasync-plugin.moc
mv ../CMakeLists_kde5.txt ../CMakeLists.txt
%cmake_kf5 ..
%make_build
popd
%install
pushd src
%make_install DESTDIR=%{buildroot}%{_bindir}
popd
pushd src/MEGAShellExtNemo/build
INSTALL_ROOT=%{buildroot} %make_install
install -D -m 0755 libMEGAShellExtNemo.so %{buildroot}%{_libdir}/nemo/extensions-3.0/libMEGAShellExtNemo.so
popd
pushd src/MEGAShellExtNautilus/build
INSTALL_ROOT=%{buildroot} %make_install
install -D -m 0755 libMEGAShellExtNautilus.so %{buildroot}%{_libdir}/nautilus/extensions-3.0/libMEGAShellExtNautilus.so
popd
pushd src/MEGAShellExtDolphin/build
%make_install
popd
rm -rf %{buildroot}/home
rm -rf %{buildroot}%{_datadir}/icons/ubuntu*
rm %{buildroot}%{_datadir}/icons/hicolor/icon-theme.cache
rm %{buildroot}%{_datadir}/doc/%{name}/{distro,version}
%fdupes %{buildroot}/%{_prefix}
%post -n nemo-%{name} -p /sbin/ldconfig
%postun -n nemo-%{name} -p /sbin/ldconfig
%post -n nautilus-%{name} -p /sbin/ldconfig
%postun -n nautilus-%{name} -p /sbin/ldconfig
%post -n dolphin-%{name} -p /sbin/ldconfig
%postun -n dolphin-%{name} -p /sbin/ldconfig
%files
%license LICENCE.md
%doc README.md CREDITS.md
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/mega.png
%{_datadir}/icons/hicolor/scalable/status/*.svg
%files -n nemo-%{name}
%{_libdir}/nemo/extensions-3.0/libMEGAShellExtNemo.so*
%files -n nautilus-%{name}
%{_datadir}/icons/hicolor/*/*/mega-*.png
%{_libdir}/nautilus/extensions-3.0/libMEGAShellExtNautilus.so*
%exclude %{_datadir}/icons/hicolor/*/emblems/mega-dolphin-*.png
%files -n thunar-%{name}
%files -n dolphin-%{name}
%{_datadir}/kservices5/%{name}-plugin.desktop
%{_datadir}/icons/hicolor/*/emblems/mega-dolphin-*.png
%{_libdir}/qt5/plugins/
%changelog