perl-Mozilla-CA/perl-Mozilla-CA.spec

77 lines
2.8 KiB
RPMSpec

#
# spec file for package perl-Mozilla-CA
#
# Copyright (c) 2015 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/
#
Name: perl-Mozilla-CA
Version: 20150826
Release: 0
#Upstream: For the bundled Mozilla CA PEM file the following applies: This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. The Mozilla::CA distribution itself is available under the same license.
%define cpan_name Mozilla-CA
Summary: Mozilla's CA cert bundle in PEM format
License: MPL-1.1 or GPL-2.0+ or LGPL-2.1+
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Mozilla-CA/
Source0: http://www.cpan.org/authors/id/A/AB/ABH/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
%{perl_requires}
%description
Mozilla::CA provides a copy of Mozilla's bundle of Certificate Authority
certificates in a form that can be consumed by modules and libraries based
on OpenSSL.
The module provide a single function:
* SSL_ca_file()
Returns the absolute path to the Mozilla's CA cert bundle PEM file.
%prep
%setup -q -n %{cpan_name}-%{version}
find . -type f -print0 | xargs -0 chmod 644
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
%{__make} %{?_smp_mflags}
%check
%{__make} test
%install
%perl_make_install
%perl_process_packlist
# MANUAL BEGIN
mkdir -p %{buildroot}/%{_bindir}
sed -e "s|/usr/bin/env perl|%{_bindir}/perl|g" %{buildroot}/%{perl_vendorlib}/Mozilla/mk-ca-bundle.pl > %{buildroot}/%{_bindir}/mk-ca-bundle.pl
chmod +x %{buildroot}/%{_bindir}/mk-ca-bundle.pl
rm %{buildroot}/%{perl_vendorlib}/Mozilla/mk-ca-bundle.pl
sed -i "s|./mk-ca-bundle.pl|%{_bindir}/mk-ca-bundle.pl|g; \
s|lib/Mozilla/CA.pm|%{perl_vendorlib}/Mozilla/CA.pm|g; \
s|lib/Mozilla/CA/cacert.pem|%{perl_vendorlib}/Mozilla/CA/cacert.pem|g" update-cacert-file
# MANUAL END
%perl_gen_filelist
%files -f %{name}.files
%defattr(-,root,root,755)
%doc Changes README update-cacert-file
%changelog