File redis-desktop-manager.spec of Package redis-desktop-manager

#
# spec file for package redis-desktop-manager
#
# Copyright (c) 2018 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 http://bugs.opensuse.org/
#
%define appname rdm

%define _lto_cflags %{nil}
Name:           redis-desktop-manager
Version:        2022.5
Release:        0
Summary:        Cross-platform GUI management tool
License:        AGPL-3.0-only
Group:          Productivity/Databases/Clients
Url:            https://github.com/uglide/RedisDesktopManager
Source0:        %{name}-%{version}.tar.gz
Source1:        linux_syscall_support.h
Patch0:         bin-file-install.patch
%if 0%{?suse_version} > 1500
Patch1:         rdm-python3-link.patch
%endif
Patch3:         rdm-incomplete-type-QUuid.patch
BuildRequires:  gcc-c++
BuildRequires:  ccache
BuildRequires:  libqt5-qtbase-devel
BuildRequires:  libqt5-qtbase-common-devel
BuildRequires:  libqt5-qtimageformats-devel
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(Qt5Charts)
BuildRequires:  pkgconfig(Qt53DQuick)
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5Multimedia)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(liblz4)
BuildRequires:  libssh2-devel
BuildRequires:  python3-devel
BuildRequires:  python3-bitstring
BuildRequires:  python3-msgpack
BuildRequires:  python3-phpserialize

Requires:       libqt5-qtquickcontrols2
Requires:       libqt5-qtquickcontrols
Requires:       libqt5-qtcharts-imports
Requires:       python3-bitstring
Requires:       python3-cbor
Requires:       python3-msgpack
Requires:       python3-phpserialize

%description
Cross-platform GUI management tool for Redis
%prep
%autosetup -p1
sed -i 's%Exec=/opt/resp_app/resp%Exec=resp%g' src/resources/resp.desktop

%build
mkdir -p 3rdparty/gbreakpad/src/third_party/lss
cp %{SOURCE1} 3rdparty/gbreakpad/src/third_party/lss/linux_syscall_support.h
pushd 3rdparty/lz4/build/cmake
cmake \
 -DLZ4_BUNDLED_MODE=ON
make
popd
pushd 3rdparty/brotli
cmake \
 -DBUILD_SHARED_LIBS=OFF
make
popd
pushd 3rdparty/snappy
cmake \
 -DHAVE_LIBLZO2=0 \
 -DHAVE_LIBLZ4=0
make
popd
pushd 3rdparty/zstd/build/cmake
cmake ./ && make
popd
export QMAKE_CFLAGS="-Werror=return-type"
export QMAKE_CXXFLAGS="-Werror=return-type"
%qmake5 src/resp.pro
%make_build

%install
%qmake5_install
install -D -m 0755 bin/linux/release/resp %{buildroot}%{_bindir}/resp
%suse_update_desktop_file -r resp Database System Application
strip --strip-all %{buildroot}%{_bindir}/*

%files
%defattr(-,root,root)
%{_bindir}/resp
%{_datadir}/applications/resp.desktop
%doc
%license LICENSE
%dir %{_datadir}/pixmaps
%{_datadir}/pixmaps/resp.png

%changelog
openSUSE Build Service is sponsored by