2010-04-01 16:21:18 +00:00
|
|
|
#
|
2011-06-20 13:24:05 +00:00
|
|
|
# spec file for package ca-certificates
|
2010-04-01 16:21:18 +00:00
|
|
|
#
|
2018-03-20 14:44:28 +00:00
|
|
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
2010-04-01 16:21:18 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2018-09-21 09:58:09 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2010-04-01 16:21:18 +00:00
|
|
|
#
|
|
|
|
|
2010-09-16 10:18:50 +00:00
|
|
|
|
2013-07-02 09:41:29 +00:00
|
|
|
# the ca bundle file was meant as compat option for e.g.
|
2013-08-28 08:42:32 +00:00
|
|
|
# proprietary packages. It's not meant to be used at all.
|
|
|
|
# unfortunately glib-networking has such a complicated abstraction
|
|
|
|
# on top of gnutls that we have to live with the bundle for now
|
|
|
|
%bcond_without cabundle
|
2013-07-02 09:41:29 +00:00
|
|
|
|
2010-04-01 16:21:18 +00:00
|
|
|
BuildRequires: openssl
|
2013-06-21 12:48:13 +00:00
|
|
|
BuildRequires: p11-kit-devel
|
2010-04-01 16:21:18 +00:00
|
|
|
|
|
|
|
Name: ca-certificates
|
|
|
|
%define ssletcdir %{_sysconfdir}/ssl
|
2010-04-29 22:45:27 +00:00
|
|
|
%define cabundle /var/lib/ca-certificates/ca-bundle.pem
|
2013-06-21 12:48:13 +00:00
|
|
|
%define sslcerts %{ssletcdir}/certs
|
2017-08-07 14:13:34 +00:00
|
|
|
Version: 2+git20170807.10b2785
|
2013-06-21 12:48:13 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: Utilities for system wide CA certificate installation
|
2018-03-20 14:44:28 +00:00
|
|
|
License: GPL-2.0-or-later
|
2010-04-01 16:21:18 +00:00
|
|
|
Group: Productivity/Networking/Security
|
2013-06-21 12:48:13 +00:00
|
|
|
Source0: ca-certificates-%{version}.tar.xz
|
2010-04-01 16:21:18 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2013-06-21 12:48:13 +00:00
|
|
|
Url: https://github.com/openSUSE/ca-certificates
|
2010-04-01 16:21:18 +00:00
|
|
|
#
|
2013-06-25 09:25:42 +00:00
|
|
|
Requires: p11-kit
|
2015-03-25 08:12:38 +00:00
|
|
|
Requires: p11-kit-tools >= 0.23.1
|
2018-09-21 09:58:09 +00:00
|
|
|
Requires: openssl(cli)
|
2014-05-08 16:02:02 +00:00
|
|
|
# needed for post
|
2013-06-21 12:48:13 +00:00
|
|
|
Requires(post): coreutils openssl p11-kit-tools
|
2010-04-14 13:44:12 +00:00
|
|
|
Recommends: ca-certificates-mozilla
|
|
|
|
# we need to obsolete openssl-certs to make sure it's files are
|
|
|
|
# gone when a package providing actual certificates gets
|
|
|
|
# installed (bnc#594434).
|
2014-07-30 11:47:17 +00:00
|
|
|
Obsoletes: openssl-certs
|
2013-06-21 12:48:13 +00:00
|
|
|
# no need for a separate Java package anymore. The bundle is
|
|
|
|
# created by C code.
|
|
|
|
Obsoletes: java-ca-certificates = 1
|
|
|
|
Provides: java-ca-certificates = %version-%release
|
2010-09-16 10:18:50 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
|
2010-04-01 16:21:18 +00:00
|
|
|
%description
|
2017-08-07 14:13:34 +00:00
|
|
|
Update-ca-certificates is intended to keep the certificate stores of
|
|
|
|
SSL libraries like OpenSSL or GnuTLS in sync with the system's CA
|
|
|
|
certificate store that is managed by p11-kit.
|
2010-04-01 16:21:18 +00:00
|
|
|
|
|
|
|
%prep
|
2013-06-21 12:48:13 +00:00
|
|
|
%setup -q
|
2010-04-01 16:21:18 +00:00
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
%install
|
2013-07-02 09:41:29 +00:00
|
|
|
%if %{without cabundle}
|
|
|
|
rm -f certbundle.run
|
|
|
|
%endif
|
2013-06-21 12:48:13 +00:00
|
|
|
%make_install
|
2017-08-07 14:13:34 +00:00
|
|
|
ln -s service %{buildroot}%{_sbindir}/rcca-certificates
|
2014-06-23 15:24:45 +00:00
|
|
|
install -d -m 755 %{buildroot}%{trustdir_cfg}/{anchors,blacklist}
|
|
|
|
install -d -m 755 %{buildroot}%{trustdir_static}/{anchors,blacklist}
|
|
|
|
install -d -m 755 %{buildroot}%{ssletcdir}
|
|
|
|
install -d -m 755 %{buildroot}/etc/ca-certificates/update.d
|
|
|
|
install -d -m 755 %{buildroot}%{_prefix}/lib/ca-certificates/update.d
|
|
|
|
install -d -m 555 %{buildroot}/var/lib/ca-certificates/pem
|
|
|
|
install -d -m 555 %{buildroot}/var/lib/ca-certificates/openssl
|
2017-06-20 08:55:50 +00:00
|
|
|
install -d -m 755 %{buildroot}/%{_prefix}/lib/systemd/system
|
2013-12-06 12:40:44 +00:00
|
|
|
ln -s /var/lib/ca-certificates/pem %{buildroot}%{sslcerts}
|
2013-07-02 09:41:29 +00:00
|
|
|
%if %{with cabundle}
|
2010-04-29 22:45:27 +00:00
|
|
|
install -D -m 644 /dev/null %{buildroot}/%{cabundle}
|
|
|
|
ln -s %{cabundle} %{buildroot}%{ssletcdir}/ca-bundle.pem
|
2013-07-02 09:41:29 +00:00
|
|
|
%endif
|
|
|
|
install -D -m 644 /dev/null %{buildroot}/var/lib/ca-certificates/java-cacerts
|
2010-04-01 16:21:18 +00:00
|
|
|
|
2014-07-17 10:05:13 +00:00
|
|
|
# should be done in git.
|
|
|
|
mv %{buildroot}/%{_prefix}/lib/ca-certificates/update.d/{,50}java.run
|
|
|
|
mv %{buildroot}/%{_prefix}/lib/ca-certificates/update.d/{,70}openssl.run
|
|
|
|
mv %{buildroot}/%{_prefix}/lib/ca-certificates/update.d/{,80}etc_ssl.run
|
|
|
|
# certbundle.run must be run after etc_ssl.run as it uses a timestamp from it
|
|
|
|
mv %{buildroot}/%{_prefix}/lib/ca-certificates/update.d/{,99}certbundle.run
|
|
|
|
|
2013-12-06 12:40:44 +00:00
|
|
|
%pre
|
|
|
|
# migrate /etc/ssl/certs to a symlink
|
|
|
|
if [ "$1" -ne 0 -a -d %{sslcerts} -a ! -L %{sslcerts} ]; then
|
2014-05-08 16:02:02 +00:00
|
|
|
# copy custom pem files to new location (bnc#875647)
|
|
|
|
mkdir -p /etc/pki/trust/anchors
|
2014-08-05 11:29:58 +00:00
|
|
|
for cert in %{sslcerts}/*.pem; do
|
2014-06-04 11:49:34 +00:00
|
|
|
test -f "$cert" -a ! -L "$cert" || continue
|
|
|
|
read firstline < "$cert"
|
|
|
|
# skip package provided certificates (bnc#875647)
|
2014-08-05 11:29:58 +00:00
|
|
|
if test "${firstline#\# generated by }" != "${firstline}" || rpm -qf "$cert" > /dev/null; then
|
|
|
|
continue
|
|
|
|
fi
|
2014-08-04 15:38:40 +00:00
|
|
|
# create a p11-kit header that set the label of
|
|
|
|
# the certificate to the file name. That ensures
|
|
|
|
# that the certificate gets the same name in
|
|
|
|
# /etc/ssl/certs as before
|
|
|
|
bn="${cert##*/}"
|
|
|
|
(
|
|
|
|
cat <<-EOF
|
|
|
|
# created by update-ca-certificates from
|
2014-08-05 11:29:58 +00:00
|
|
|
# $cert
|
2014-08-04 15:38:40 +00:00
|
|
|
[p11-kit-object-v1]
|
|
|
|
class: certificate
|
|
|
|
label: "${bn%.pem}"
|
|
|
|
trusted: true
|
|
|
|
EOF
|
|
|
|
cat $cert
|
|
|
|
) > "/etc/pki/trust/$bn"
|
2014-06-04 11:49:34 +00:00
|
|
|
done
|
2014-08-05 11:29:58 +00:00
|
|
|
mv -T --backup=numbered %{sslcerts} %{sslcerts}.rpmsave && ln -s /var/lib/ca-certificates/pem %{sslcerts}
|
2013-12-06 12:40:44 +00:00
|
|
|
fi
|
2017-06-20 08:55:50 +00:00
|
|
|
%service_add_pre ca-certificates.path ca-certificates.service
|
2013-12-06 12:40:44 +00:00
|
|
|
|
2010-04-25 16:38:44 +00:00
|
|
|
%post
|
2013-06-21 12:48:13 +00:00
|
|
|
if [ -s /etc/ca-certificates.conf ]; then
|
|
|
|
while read line; do
|
|
|
|
[ ${line#\!} != "$line" ] || continue
|
|
|
|
cert="${line#\!*/}"
|
|
|
|
ln -s /usr/share/ca-certificates/anchors/"$cert" %{trustdir_cfg}/blacklist
|
|
|
|
done < /etc/ca-certificates.conf
|
|
|
|
echo "/etc/ca-certificates.conf converted and saved as /etc/ca-certificates.conf.rpmsave"
|
|
|
|
mv /etc/ca-certificates.conf /etc/ca-certificates.conf.rpmsave
|
2010-04-29 22:45:27 +00:00
|
|
|
fi
|
2010-04-25 16:38:44 +00:00
|
|
|
# force rebuilding all certificate stores.
|
|
|
|
# This also makes sure we update the hash links in /etc/ssl/certs
|
|
|
|
# as openssl changed the hash format between 0.9.8 and 1.0
|
2017-08-07 14:13:34 +00:00
|
|
|
update-ca-certificates -f || true
|
2017-06-20 08:55:50 +00:00
|
|
|
%service_add_post ca-certificates.path ca-certificates.service
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%service_del_preun ca-certificates.path ca-certificates.service
|
2010-04-25 16:38:44 +00:00
|
|
|
|
2013-06-21 12:48:13 +00:00
|
|
|
%postun
|
|
|
|
if [ "$1" -eq 0 ]; then
|
2014-11-11 10:30:49 +00:00
|
|
|
rm -rf /var/lib/ca-certificates/pem /var/lib/ca-certificates/openssl
|
2013-06-21 12:48:13 +00:00
|
|
|
fi
|
2017-06-20 08:55:50 +00:00
|
|
|
%service_del_postun ca-certificates.path ca-certificates.service
|
2010-09-16 10:18:50 +00:00
|
|
|
|
2010-04-01 16:21:18 +00:00
|
|
|
%clean
|
|
|
|
rm -rf %{buildroot}
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-, root, root)
|
2018-03-20 14:44:28 +00:00
|
|
|
%license COPYING
|
|
|
|
%doc README
|
2013-06-21 12:48:13 +00:00
|
|
|
%dir %{pkidir_cfg}
|
|
|
|
%dir %{trustdir_cfg}
|
|
|
|
%dir %{trustdir_cfg}/anchors
|
|
|
|
%dir %{trustdir_cfg}/blacklist
|
|
|
|
%dir %{pkidir_static}
|
|
|
|
%dir %{trustdir_static}
|
|
|
|
%dir %{trustdir_static}/anchors
|
|
|
|
%dir %{trustdir_static}/blacklist
|
2013-12-06 12:40:44 +00:00
|
|
|
%sslcerts
|
2013-06-21 12:48:13 +00:00
|
|
|
%ghost /var/lib/ca-certificates/java-cacerts
|
2010-04-01 16:21:18 +00:00
|
|
|
%dir /etc/ca-certificates
|
|
|
|
%dir /etc/ca-certificates/update.d
|
2010-04-29 22:45:27 +00:00
|
|
|
%dir %{_prefix}/lib/ca-certificates
|
|
|
|
%dir %{_prefix}/lib/ca-certificates/update.d
|
2017-06-20 08:55:50 +00:00
|
|
|
%{_prefix}/lib/systemd/system/*
|
2010-04-29 22:45:27 +00:00
|
|
|
%dir /var/lib/ca-certificates
|
2013-06-21 12:48:13 +00:00
|
|
|
%dir /var/lib/ca-certificates/pem
|
|
|
|
%dir /var/lib/ca-certificates/openssl
|
2017-08-07 14:13:34 +00:00
|
|
|
%{_sbindir}/rcca-certificates
|
2010-04-01 16:21:18 +00:00
|
|
|
%{_sbindir}/update-ca-certificates
|
|
|
|
%{_mandir}/man8/update-ca-certificates.8*
|
2014-07-17 10:05:13 +00:00
|
|
|
%{_prefix}/lib/ca-certificates/update.d/*java.run
|
|
|
|
%{_prefix}/lib/ca-certificates/update.d/*etc_ssl.run
|
|
|
|
%{_prefix}/lib/ca-certificates/update.d/*openssl.run
|
2013-07-02 09:41:29 +00:00
|
|
|
#
|
|
|
|
%if %{with cabundle}
|
|
|
|
%{ssletcdir}/ca-bundle.pem
|
|
|
|
%ghost %{cabundle}
|
2014-07-17 10:05:13 +00:00
|
|
|
%{_prefix}/lib/ca-certificates/update.d/*certbundle.run
|
2013-07-02 09:41:29 +00:00
|
|
|
%endif
|
2010-04-01 16:21:18 +00:00
|
|
|
|
|
|
|
%changelog
|