File ca-certificates-suse.spec of Package ca-certificates-suse
#
# spec file for package ca-certificates-suse
#
# Copyright (c) 2020 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 http://bugs.opensuse.org/
#
# norootforbuild
Name: ca-certificates-suse
Summary: SUSE internal root certificates
Version: 1.0
Release: 0
URL: https://www.suse.com/
%if 0%{?centos} || 0%{?rhel} || 0%{?fedora}
%define certdir /usr/share/pki/ca-trust-source/anchors
%else
%if 0%{?suse_version} > 1110
%if 0%{?suse_version} < 1310
%bcond_with trustedcerts
%define trustdir_static %{_datadir}/ca-certificates/suse
%define certdir %{_datadir}/ca-certificates/suse
%else
%bcond_without trustedcerts
%define certdir %{trustdir_static}/anchors
BuildRequires: p11-kit-devel
%endif
BuildRequires: ca-certificates
PreReq: ca-certificates
%else
%define certdir %{_sysconfdir}/ssl/certs
PreReq: openssl
%endif
%endif
License: MIT
Group: Productivity/Networking/Security
Source: %{name}-%{version}.tar.bz2
Source1: ca-certificates-suse.COPYING
Source2: ca-certificates-suse-rpmlintrc
BuildRequires: openssl
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
This package contains the internal root certificates from SUSE.
%prep
%setup -q
install -m 644 %{SOURCE1} COPYING
%build
%install
install -d -m 755 %{buildroot}/%{certdir}
for i in SUSE_Trust_Root.crt; do openssl x509 -in $i -out \
%{buildroot}/%{certdir}/${i##*/}.pem;
done
%clean
rm -rf %{buildroot}
%post
%if 0%{?centos} || 0%{?rhel} || 0%{?fedora}
update-ca-trust extract
%else
%if 0%{?suse_version} > 1110
update-ca-certificates || true
%else
# need to do that here so c_rehash can deal with hash collisions
c_rehash %{certdir} > /dev/null || true
%endif
%endif
%postun
%if 0%{?centos} || 0%{?rhel} || 0%{?fedora}
update-ca-trust extract
%else
%if 0%{?suse_version} > 1110
update-ca-certificates || true
%else
c_rehash %{certdir} > /dev/null || true
%endif
%endif
%files
%defattr(-, root, root)
%doc COPYING
%if 0%{?suse_version} > 1110
%if 0%{?suse_version} < 1310
%dir %{_datadir}/ca-certificates
%endif
%endif
%{certdir}
%changelog