Build gnome-ssh-askpass against gtk3

This commit is contained in:
Cedric Staniewski 2022-03-01 22:57:08 +01:00
parent bffeef3c12
commit 95d45cee50

View File

@ -17,8 +17,8 @@
# Do we want to link against a static libcrypto? (1=yes 0=no)
%global static_libcrypto 0
# Use GTK2 instead of GNOME in gnome-ssh-askpass
%global gtk2 1
# Use GTK3 instead of GTK2 in gnome-ssh-askpass
%global gtk3 1
# Build position-independent executables (requires toolchain support)?
%global pie 1
@ -42,8 +42,8 @@
# Add option to build without GTK2 for older platforms with only GTK+.
# Red Hat Linux <= 7.2 and Red Hat Advanced Server 2.1 are examples.
# rpm -ba|--rebuild --define 'no_gtk2 1'
%{?no_gtk2:%global gtk2 0}
# rpm -ba|--rebuild --define 'no_gtk3 1'
%{?no_gtk3:%global gtk3 0}
# Options for static OpenSSL link:
# rpm -ba|--rebuild --define "static_openssl 1"
@ -202,11 +202,11 @@ License: BSD
Requires: /sbin/nologin
%if ! %{no_gnome_askpass}
%if %{gtk2}
BuildRequires: gtk2-devel
BuildRequires: libX11-devel
%if %{gtk3}
BuildRequires: gtk3-devel
%else
BuildRequires: gnome-libs-devel
BuildRequires: gtk2-devel
%endif
%endif
@ -459,24 +459,24 @@ perl -pi -e "s|-lcrypto|%{_libdir}/libcrypto.a|g" Makefile
%make_build
# Define a variable to toggle gnome1/gtk2 building. This is necessary
# Define a variable to toggle gtk2/gtk3 building. This is necessary
# because RPM doesn't handle nested %%if statements.
%if %{gtk2}
gtk2=yes
%if %{gtk3}
gtk3=yes
%else
gtk2=no
gtk3=no
%endif
%if ! %{no_gnome_askpass}
pushd contrib
if [ $gtk2 = yes ] ; then
if [ $gtk3 = yes ] ; then
CFLAGS="$CFLAGS %{?__global_ldflags}" \
make gnome-ssh-askpass3
mv gnome-ssh-askpass3 gnome-ssh-askpass
else
CFLAGS="$CFLAGS %{?__global_ldflags}" \
make gnome-ssh-askpass2
mv gnome-ssh-askpass2 gnome-ssh-askpass
else
CFLAGS="$CFLAGS %{?__global_ldflags}"
make gnome-ssh-askpass1
mv gnome-ssh-askpass1 gnome-ssh-askpass
fi
popd
%endif