File ca-certificates-letsencrypt.spec of Package ca-certificates-letsencrypt

#
# spec file for package ca-certificates-letsencrypt
#
# Copyright (c) 2017 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         certdir %{_datadir}/pki/trust/anchors
Name:           ca-certificates-letsencrypt
Version:        1
Release:        0
Summary:        Let's Encrypt root certificates
License:        CC-BY-4.0
Group:          Productivity/Networking/Security
Url:            http://www.letsencrypt.org
# Root Certificate
                # ISRG Root X1 (self-signed)
Source0:        https://letsencrypt.org/certs/isrgrootx1.pem.txt
Source1:        IdenTrust-DST-Root-CA-X3.pem
# Intermediate Certificates - Active
                # Let’s Encrypt Authority X3 (IdenTrust cross-signed)
Source11:       https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem.txt
                # Let’s Encrypt Authority X3 (Signed by ISRG Root X1)
Source12:       https://letsencrypt.org/certs/letsencryptauthorityx3.pem.txt
# Intermediate Certificates - Backup
                # Let’s Encrypt Authority X4 (IdenTrust cross-signed)
Source13:       https://letsencrypt.org/certs/lets-encrypt-x4-cross-signed.pem.txt
                # Let’s Encrypt Authority X4 (Signed by ISRG Root X1)
Source14:       https://letsencrypt.org/certs/letsencryptauthorityx4.pem.txt
Source20:       LICENSE
BuildArch:      noarch
BuildRequires:  ca-certificates
BuildRequires:  openssl
BuildRequires:  p11-kit-devel
Requires(post): ca-certificates
Requires(postun): ca-certificates

%description
This package contains the root certificates from letsencrypt.org

%prep
%setup -qcT
cp %{S:20} .

%build

%install
install -d -m 755 %{buildroot}/%{certdir}
for i in %{S:0} %{S:1} %{S:11} %{S:12} %{S:13} %{S:14}; do
  openssl x509 -in $i -out %{buildroot}%{certdir}/${i##*/}; done
for i in $(ls -1 %{buildroot}%{certdir}/*.txt); do
  mv $i ${i%.txt}
done

%post
update-ca-certificates || true

%postun
update-ca-certificates || true

%files
%defattr(-,root,root)
%doc LICENSE
%{certdir}

%changelog
openSUSE Build Service is sponsored by