File sasl-xoauth2.spec of Package sasl-xoauth2

%global selinuxtype targeted

Name:           sasl-xoauth2
Version:        0.26
Release:        0
Summary:        The xoauth2 plugin for cyrus-sasl

License:        Apache-2.0
URL:            https://github.com/tarickb/%{name}
Source0:        %{name}-%{version}.tar.xz

%if 0%{?rhel} < 8
BuildRequires:  cmake3
%else
BuildRequires:  cmake
%endif
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(jsoncpp)
BuildRequires:  pkgconfig(libsasl2)
BuildRequires:  gcc-c++
BuildRequires:  pandoc
BuildRequires:  pkgconfig(pkg-config)
BuildRequires:  argparse-manpage
BuildRequires:  python3-msal
Requires:       cyrus-sasl-lib
Requires:       ca-certificates
Requires:       python3-msal
Requires:       (%{name}-selinux if selinux-policy-%{selinuxtype})

%description
sasl-xoauth2 is a SASL plugin that enables client-side use of OAuth 2.0.

Among other things it enables the use of Gmail or Outlook/Office 365 SMTP
relays from Postfix.

%prep
%autosetup

%build
%if 0%{?rhel} && 0%{?rhel} < 8
%cmake3 -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir}
%cmake3_build
%else
%cmake \
  -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir} \
  -DCMAKE_POLICY_VERSION_MINIMUM=3.5
%cmake_build
%endif

%install
%if 0%{?rhel} && 0%{?rhel} < 8
%cmake3_install
%else
%cmake_install
%endif

%check
%ctest

%files
%doc README.md
%license COPYING
%dir %{_libdir}/sasl-xoauth2
%{_libdir}/sasl-xoauth2/test-config
%{_libdir}/sasl2/libsasl-xoauth2.so
%{_bindir}/sasl-xoauth2-tool
%config(noreplace) %{_sysconfdir}/sasl-xoauth2.conf
%{_mandir}/man5/%{name}.conf.5.gz
%{_mandir}/man1/%{name}-tool.1.gz

%changelog
openSUSE Build Service is sponsored by