%if %{?fedora}%{!?fedora:0} >= 38 %global maketrace --debug=print %else %global maketrace .SHELLFLAGS=-xc %endif Name: oidc-agent Version: 4.5.2 Release: 1%{?dist} Summary: Managing OpenID Connect tokens on the command line License: MIT AND ISC AND LGPL-2.1-or-later AND BSD-2-Clause URL: https://github.com/indigo-dc/%{name} Source0: %{url}/archive/refs/tags/v%{version}/%{name}-%{version}.tar.gz Patch0: %{name}.patch BuildRequires: gcc-c++ BuildRequires: make %if %{?rhel}%{!?rhel:0} != 7 BuildRequires: cjson-devel BuildRequires: clibs-list-devel %endif BuildRequires: curl-devel BuildRequires: libsodium-devel BuildRequires: libmicrohttpd-devel BuildRequires: libsecret-devel BuildRequires: glib2-devel BuildRequires: qrencode-devel BuildRequires: gtk3-devel BuildRequires: webkitgtk4-devel #BuildRequires: webkit2gtk3-devel (equivalent, but doesn't work on EPEL 7) #BuildRequires: webkit2gtk4.0-devel (equivalent, but doesn't work on EPEL) BuildRequires: help2man %description oidc-agent is a set of tools to manage OpenID Connect tokens and make them easily usable from the command line. We followed the ssh-agent design, so users can handle OIDC tokens in a similar way as they do with ssh keys. oidc-agent is usually started in the beginning of an X-session or a login session. Through use of environment variables the agent can be located and used to handle OIDC tokens. The agent initially does not have any account configurations loaded. You can load an account configuration by using oidc-add. Multiple account configurations may be loaded in oidc-agent concurrently. oidc-add is also used to remove a loaded configuration from oidc-agent. oidc-gen is used to initially generate an account configurations file. %package cli Summary: Command line tool for obtaining OpenID Connect tokens Requires: %{name}-libs%{?_isa} = %version-%{release} %description cli oidc-agent is a set of tools to manage OpenID Connect tokens and make them easily usable from the command line. These tools follow ssh-agent design, so OIDC tokens can be handled in a similar way as ssh keys. The agent stores multiple configurations and their associated refresh tokens securely. This tool consists of five programs: - oidc-agent that handles communication with the OIDC provider - oidc-gen that generates config files - oidc-add that loads (and unloads) configuration into the agent - oidc-token that can be used to get access token on the command line - oidc-key-chain that re-uses oidc-agent across logins %package desktop Summary: GUI integration for obtaining OpenID Connect tokens Requires: %{name}-libs%{?_isa} = %version-%{release} Requires: %{name}-cli = %version-%{release} Provides: %{name} = %version-%{release} Obsoletes: %{name} < %version-%{release} %description desktop Desktop integration files for oidc-gen and oidc-agent. This package adds two ways for supporting the usage of oidc-agent in a graphical environment: - The .desktop file to leverage browser integration to support the authorization code flow in oidc-gen. - The Xsession file to consistently set the environment variables necessary to for client tools to connect to the oidc-agent daemon. %package libs Summary: Library for oidc-agent Provides: liboidc-agent4 = %version-%{release} Obsoletes: liboidc-agent4 < %version-%{release} %if %{?rhel}%{!?rhel:0} == 7 Provides: bundled(cjson) Provides: bundles(clibs-list) %endif %description libs oidc-agent is a command line tool for obtaining OpenID Connect tokens on the command line. This package provides a library for easy communication with oidc-agent. Applications can use this library to request access tokens from oidc-agent. %package devel Summary: Headers for the oidc-agent library Requires: %{name}-libs%{?_isa} = %version-%{release} %description devel oidc-agent is a command line tool for obtaining OpenID Connect tokens on the command line. This package provides headers for the oidc-agent library. %prep %setup -q %patch -P 0 -p1 %if %{?rhel}%{!?rhel:0} != 7 # Remove bundled cJSON and clib-list (use system versions) except on EPEL 7 rm -rf lib/cJSON lib/list %endif %build %set_build_flags %make_build %{maketrace} %install %set_build_flags %make_install install_includes %{maketrace} \ PREFIX=%{buildroot} \ INCLUDE_PATH=%{buildroot}%{_includedir} \ LIB_PATH=%{buildroot}%{_libdir} \ BIN_AFTER_INST_PATH=%{_prefix} \ CONFIG_AFTER_INST_PATH=%{_sysconfdir} ln -s liboidc-agent.so.%{version} %{buildroot}%{_libdir}/liboidc-agent.so %files cli %{_bindir}/oidc-add %{_bindir}/oidc-agent %{_bindir}/oidc-agent-service %{_bindir}/oidc-gen %{_bindir}/oidc-keychain %{_bindir}/oidc-token %bash_completions_dir/oidc-add %bash_completions_dir/oidc-agent %bash_completions_dir/oidc-agent-service %bash_completions_dir/oidc-gen %bash_completions_dir/oidc-keychain %bash_completions_dir/oidc-token %{_mandir}/man1/oidc-add.1* %{_mandir}/man1/oidc-agent.1* %{_mandir}/man1/oidc-agent-service.1* %{_mandir}/man1/oidc-gen.1* %{_mandir}/man1/oidc-keychain.1* %{_mandir}/man1/oidc-token.1* %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/issuer.config %config(noreplace) %{_sysconfdir}/%{name}/oidc-agent-service.options %config(noreplace) %{_sysconfdir}/%{name}/pubclients.config %license LICENSE %doc CHANGELOG.md PRIVACY README.md %files desktop %{_bindir}/oidc-prompt %{_mandir}/man1/oidc-prompt.1* %dir %{_sysconfdir}/X11/Xsession.d %config(noreplace) %{_sysconfdir}/X11/Xsession.d/91oidc-agent %{_datadir}/applications/oidc-gen.desktop %files libs %{_libdir}/liboidc-agent.so.4* %license LICENSE %files devel %{_includedir}/%{name} %{_libdir}/liboidc-agent.so %changelog * Mon Jul 10 2023 Mattias Ellert - 4.5.2-1 - Initial build for Fedora and EPEL