File NetworkManager-sstp.spec of Package NetworkManager-sstp

#
# spec file for package NetworkManager-sstp
#
# Copyright (c) 2022 SUSE LLC
#
# 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/
#


%global pppd_plugin_dir %(rpm -ql ppp | grep -m1 pppd/[0-9]*)

# Requires ppp >= 2.4.9
%if 0%{?suse_version} >= 1550
%bcond_without pppd_auth_notify_support
%bcond_without pppd_ext_tls_settings_support
%else
%bcond_with pppd_auth_notify_support
%bcond_with pppd_ext_tls_settings_support
%endif

%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150500
%bcond_without gtk4
%else
%bcond_with gtk4
%endif
Name:           NetworkManager-sstp
Version:        1.3.1
Release:        0
Summary:        NetworkManager VPN support for SSTP
License:        GPL-2.0-or-later
Group:          Productivity/Networking/System
URL:            https://gitlab.gnome.org/GNOME/network-manager-sstp
Source0:        https://gitlab.gnome.org/GNOME/network-manager-sstp/-/releases/release-%{version}/downloads/dist/%{name}-%{version}.tar.xz
Source1:        %{name}.rpmlintrc
BuildRequires:  intltool
BuildRequires:  libxml2-tools
BuildRequires:  pkgconfig
BuildRequires:  ppp-devel >= 2.4.7
BuildRequires:  pkgconfig(gio-unix-2.0) >= 2.40
BuildRequires:  pkgconfig(gnutls) >= 2.12
BuildRequires:  pkgconfig(gtk+-3.0) >= 3.4
%if %{with gtk4}
BuildRequires:  pkgconfig(gtk4) >= 4.0
BuildRequires:  pkgconfig(libnma-gtk4) >= 1.8.33
%endif
BuildRequires:  pkgconfig(libnm) >= 1.7.0
BuildRequires:  pkgconfig(libnma) >= 1.7.0
BuildRequires:  pkgconfig(libsecret-1) >= 0.18
BuildRequires:  pkgconfig(sstp-client-1.0) >= 1.0.10
Requires:       NetworkManager >= 1.7.0
Requires:       sstp-client
%requires_eq    ppp
Recommends:     %{name}-lang

%description
NetworkManager-sstp provides VPN support to NetworkManager for SSTP.

%lang_package

%package gnome
Summary:        NetworkManager VPN support for SSTP
Group:          Productivity/Networking/System
Requires:       %{name} = %{version}-%{release}
Provides:       %{name}-frontend = %{version}

%description gnome
NetworkManager-sstp provides VPN support to NetworkManager for SSTP.

%prep
%autosetup -p1

%build
%configure \
    --disable-static \
    --with-pppd-plugin-dir=%{pppd_plugin_dir} \
    --without-libnm-glib \
    %{?with_pppd_auth_notify_support:--with-pppd-auth-notify-support} \
    %{?with_pppd_ext_tls_settings_support:--with-pppd-ext-tls-settings-support} \
    %{?with_gtk4:--with-gtk4} 
%make_build

%install
%make_install
find %{buildroot} -type f -name "*.la" -delete -print

%find_lang %{name} %{?no_lang_C}

%files
%doc AUTHORS ChangeLog NEWS README TODO
%{_datadir}/dbus-1/system.d/nm-sstp-service.conf
%if 0%{?suse_version} >= 1550
%{_vpnservicedir}/nm-sstp-service.name
%else
%dir %{_libexecdir}/NetworkManager
%dir %{_libexecdir}/NetworkManager/VPN
%{_libexecdir}/NetworkManager/VPN/nm-sstp-service.name
%endif
%{_libexecdir}/nm-sstp-service
%{_libdir}/NetworkManager/libnm-vpn-plugin-sstp.so
%{pppd_plugin_dir}/nm-sstp-pppd-plugin.so
%license COPYING

%files gnome
%{_datadir}/metainfo/network-manager-sstp.metainfo.xml
%{_libdir}/NetworkManager/libnm-*vpn-plugin-sstp-editor.so
%{_libexecdir}/nm-sstp-auth-dialog

%files lang -f %{name}.lang

%changelog
openSUSE Build Service is sponsored by