From 95d45cee50eed33c28acc2f456d71abcb44c04f8 Mon Sep 17 00:00:00 2001 From: Cedric Staniewski Date: Tue, 1 Mar 2022 22:57:08 +0100 Subject: [PATCH] Build gnome-ssh-askpass against gtk3 --- openssh.spec | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/openssh.spec b/openssh.spec index d282317..f66891d 100644 --- a/openssh.spec +++ b/openssh.spec @@ -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