File tpm2-pkcs11.spec of Package tpm2-pkcs11

#
# spec file for package tpm2
#
# Copyright (c) 2021 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/
#

%define so_ver   0
%define realname tpm2-pkcs11

Name:           libtpm2_pkcs110
Version:        1.6.0
Release:        0
URL:            https://github.com/tpm2-software/tpm2-pkcs11
Summary:        A PKCS#11 interface for TPM2 hardware
License:        BSD-2-Clause
Group:          Productivity/Security

# Build-time parameters
BuildRequires:  autoconf
BuildRequires:  autoconf-archive >= 2017.03.21
BuildRequires:  automake
BuildRequires:  libtool
BuildRequires:  pkg-config
BuildRequires:  tpm2.0-tools
BuildRequires:  pkgconfig(libcrypto) >= 1.0.2g
BuildRequires:  pkgconfig(p11-kit-1)
BuildRequires:  pkgconfig(sqlite3)
BuildRequires:  pkgconfig(tss2-esys) >= 2.0
BuildRequires:  pkgconfig(tss2-mu)
BuildRequires:  pkgconfig(tss2-rc)
BuildRequires:  pkgconfig(tss2-tctildr)
BuildRequires:  pkgconfig(yaml-0.1)
Source:         https://github.com/tpm2-software/tpm2-pkcs11/archive/refs/tags/%{version}.tar.gz

%description
PKCS #11 is a Public-Key Cryptography Standard that defines a standard method to
access cryptographic services from tokens/ devices such as hardware security
modules (HSM), smart cards, etc. In this project we intend to use a TPM2 device
as the cryptographic token.

%package -n %{realname}-devel
Summary:        Developent files for %{name}
Group:          Development/Languages/C and C++

Requires:       %{name} = %{version}-%{release}
Provides:       %{name}-devel = %{version}-%{release}
Provides:       libtpm2_pkcs11-devel = %{version}-%{release}

%description -n %{realname}-devel
Headers and linraries to build software against %{name}.

%prep
%setup -q -n tpm2-pkcs11-%version
if [ ! -x configure ]; then
    test -x bootstrap && ./bootstrap || autoreconf --install
fi

%build
%{configure} --disable-static
%{__make} %{?_smp_mflags}

%install
%{__make} install DESTDIR=%{buildroot}

%files
%defattr(-,root,root)
%doc CHANGELOG.md LICENSE docs/*
%dir %{_libdir}/pkcs11
%{_libdir}/pkcs11/libtpm2_pkcs11.so
%{_libdir}/pkcs11/libtpm2_pkcs11.so.%{?so_ver}*
%dir %{_datadir}/p11-kit/modules
%dir %{_datadir}/p11-kit
%{_datadir}/p11-kit/modules/tpm2_pkcs11.module

%files -n %{realname}-devel
%defattr(-,root,root)
%{_libdir}/pkgconfig/tpm2-pkcs11.pc
%exclude %{_libdir}/pkcs11/libtpm2_pkcs11.la

%post   -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%changelog
openSUSE Build Service is sponsored by