File libgsignon-glib.spec of Package libgsignon-glib

#
# spec file for package libgsignon-glib
#
# Copyright (c) 2016 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 dbus_type session
%define typelib typelib-1_0-gSignon-1_0
%define sover   1
%define _typelibdir %(pkg-config --variable=typelibdir gobject-introspection-1.0)
%define _girdir %(pkg-config --variable=girdir gobject-introspection-1.0)
%define _version a10da2694106fe6de4587278e09dc85e72b33ae2
Name:           libgsignon-glib
Version:        2.4.1
Release:        0
Summary:        Single signon authentication library for GLib applications
License:        LGPL-2.1
Group:          System/Libraries
Url:            https://gitlab.com/accounts-sso/libgsignon-glib
Source:         https://gitlab.com/accounts-sso/%{name}/repository/archive.tar.gz?ref=%{_version}#/%{name}-%{version}.tar.gz
Source1:        baselibs.conf
# PATCH-FIX-OPENSUSE libgsignon-glib-gtk2-disable-werror.patch sor.alexei@meowr.ru -- Disable -Werror.
Patch0:         %{name}-disable-werror.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  fdupes
BuildRequires:  gtk-doc
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(check)
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(gobject-2.0)
BuildRequires:  pkgconfig(gobject-introspection-1.0)
BuildRequires:  pkgconfig(pygobject-3.0)
BuildRequires:  pkgconfig(python2)
BuildRequires:  pkgconfig(python3)
Requires:       dbus-1
Requires:       gsignond
Recommends:     gsignond-plugin-oauth
Recommends:     gsignond-plugin-sasl
%if 0%{?suse_version} > 1320 || 0%{?sle_version} >= 120200 || (0%{?sle_version} >= 120100 && 0%{?is_opensuse})
BuildRequires:  vala >= 0.28.0
%endif

%description
This project is a library for managing single signon credentilas
which can be used from GLib applications. It is effectively a GLib
binding for the D-Bus API provided by signond.

%package -n %{name}%{sover}
Summary:        Single signon authentication library for GLib Applications
Group:          System/Libraries

%description -n %{name}%{sover}
This package contains the shared libraries for use by applications.

%package -n python-libgsignon
Summary:        Python bindings for the single signon authentication library
Group:          Development/Languages/Python

%description -n python-libgsignon
This package contains the python bindings for the single signon
authentication library.

%package -n python3-libgsignon
Summary:        Python bindings for the Single signon authentication library
Group:          Development/Languages/Python

%description -n python3-libgsignon
This package contains the python bindings for the single signon
authentication library.

%package -n %{typelib}
Summary:        Library for GLib applications -- Introspection Bindings
Group:          System/Libraries

%description -n %{typelib}
This package contains the GObject Introspection bindings for the
gsignon-glib library.

%package devel
Summary:        Development files for libgsignon-glib
Group:          Development/Libraries/C and C++
Requires:       %{name}%{sover} = %{version}
Requires:       %{typelib} = %{version}
Requires:       python-libgsignon = %{version}
Requires:       python3-libgsignon = %{version}

%description devel
This package contains the development files for the gsignon-glib
library.

%package doc
Summary:        Documentation for libgsignon-glib
Group:          Documentation/HTML
BuildArch:      noarch

%description doc
This package contains the documentation for the gsignon-glib
library.

%prep
%setup -q -n %{name}-%{_version}-%{_version}
%patch0 -p1

%build
NOCONFIGURE=1 ./autogen.sh
%global _configure ../configure
for python in python2 python3; do
    mkdir -p build-$python
    pushd build-$python
    export PYTHON=$python
    %configure \
      --disable-static                \
      --enable-python                 \
      --enable-dbus-type=%{dbus_type} \
      --enable-introspection=yes      \
      --enable-gtk-doc
    make %{?_smp_mflags}
    popd
done

%install
%make_install -C build-python2
%make_install -C build-python3/pygobject
find %{buildroot} -type f -name "*.la" -delete -print

%fdupes %{buildroot}%{python3_sitearch}/
%fdupes %{buildroot}%{python_sitearch}/

%post -n %{name}%{sover} -p /sbin/ldconfig

%postun -n %{name}%{sover} -p /sbin/ldconfig

%files -n %{name}%{sover}
%defattr(-,root,root)
%doc AUTHORS COPYING NEWS
%{_libdir}/%{name}.so.%{sover}*

%files -n %{typelib}
%defattr(-,root,root)
%{_typelibdir}/gSignon-1.0.typelib

%files -n python-libgsignon
%defattr(-,root,root)
%{python_sitearch}/gi/overrides/

%files -n python3-libgsignon
%defattr(-,root,root)
%{python3_sitearch}/gi/overrides/

%files devel
%defattr(-,root,root)
%{_includedir}/%{name}/
%{_bindir}/gsso-example
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/%{name}.pc
%{_girdir}/gSignon-1.0.gir
%{_datadir}/gir-1.0/gSignon-1.0.gir
%if 0%{?suse_version} > 1320 || 0%{?sle_version} >= 120200 || (0%{?sle_version} >= 120100 && 0%{?is_opensuse})
%dir %{_datadir}/vala/vapi/
%{_datadir}/vala/vapi/%{name}.*
%endif

%files doc
%defattr(-,root,root)
%doc %{_datadir}/gtk-doc/html/%{name}/

%changelog