File yubihsm-shell.spec of Package yubihsm-shell

#
# spec file for package yubihsm-shell
#
# Copyright (c) 2025 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/
#


Name:           yubihsm-shell
Version:        2.6.0
Release:        0
Summary:        Tools for YubiHSM
License:        Apache-2.0
URL:            https://github.com/Yubico/yubihsm-shell
Source0:        https://github.com/Yubico/yubihsm-shell/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch1:         pscs.patch
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  gengetopt
BuildRequires:  help2man
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(libedit)
BuildRequires:  pkgconfig(libpcsclite)
BuildRequires:  pkgconfig(libusb-1.0)
BuildRequires:  pkgconfig(openssl)

%description
This repository contains most of the components used to interact with the
YubiHSM 2 at both a user-facing and programmatic level.

%package -n libykhsmauth2
Summary:        Tools for YubiHSM

%description -n libykhsmauth2
This repository contains most of the components used to interact with the
YubiHSM 2 at both a user-facing and programmatic level.

%package -n libyubihsm2
Summary:        Tools for YubiHSM

%description -n libyubihsm2
This repository contains most of the components used to interact with the
YubiHSM 2 at both a user-facing and programmatic level.

%package pkcs11
Summary:        Tools for YubiHSM

%description pkcs11
This repository contains most of the components used to interact with the
YubiHSM 2 at both a user-facing and programmatic level.

%package devel
Summary:        Tools for YubiHSM
Requires:       libykhsmauth2 = %{version}
Requires:       libyubihsm2 = %{version}

%description devel
This repository contains most of the components used to interact with the
YubiHSM 2 at both a user-facing and programmatic level.

%prep
%autosetup -p1

%build
%cmake
%cmake_build

%install
%cmake_install

# needs a device
#check
#ctest

%files
%license LICENSE
%doc README.adoc CHANGELOG doc/*
%{_bindir}/yubihsm-auth
%{_bindir}/yubihsm-shell
%{_bindir}/yubihsm-wrap
%{_mandir}/man1/yubihsm-auth.1%{?ext_man}
%{_mandir}/man1/yubihsm-shell.1%{?ext_man}
%{_mandir}/man1/yubihsm-wrap.1%{?ext_man}

%files -n libykhsmauth2
%license LICENSE
%{_libdir}/libykhsmauth.so.*

%ldconfig_scriptlets -n libykhsmauth2

%files -n libyubihsm2
%license LICENSE
%{_libdir}/libyubihsm.so.*
%{_libdir}/libyubihsm_http.so.*
%{_libdir}/libyubihsm_usb.so.*

%ldconfig_scriptlets -n libyubihsm2

%files pkcs11
%license LICENSE
%doc README.adoc CHANGELOG doc/*
%dir %{_libdir}/pkcs11/
%{_libdir}/pkcs11/yubihsm_pkcs11.so

%files devel
%license LICENSE
%doc README.adoc CHANGELOG doc/*
%{_datadir}/pkgconfig/ykhsmauth.pc
%{_datadir}/pkgconfig/yubihsm.pc
%{_libdir}/libyubihsm_usb.so
%{_libdir}/libyubihsm_http.so
%{_libdir}/libyubihsm.so
%{_libdir}/libykhsmauth.so
%exclude %{_includedir}/pkcs11/pkcs11.h
%exclude %{_includedir}/pkcs11/pkcs11f.h
%exclude %{_includedir}/pkcs11/pkcs11t.h
%exclude %{_includedir}/pkcs11/pkcs11y.h
%{_includedir}/ykhsmauth.h
%{_includedir}/yubihsm.h

%changelog
openSUSE Build Service is sponsored by