summaryrefslogtreecommitdiff
path: root/boringssl.spec
blob: bbe48073a3c458b925c723f503835b25f6ff1133 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
%define debug_package %{nil}
%define src_install_dir /usr/src/%{name}

Name:           boringssl
Version:        342e805bc1f5dfdd650e3f031686d6c939b095d9
Release:        1
Summary:        An SSL/TLS protocol implementation
License:        OpenSSL
Group:          Development/Sources
URL:            https://boringssl.googlesource.com/%{name}
Source:         https://github.com/google/%{name}/archive/%{version}.tar.gz

Patch0:         Fix-print-Syntax-error.patch

BuildRequires:  cmake >= 3.0
BuildRequires:  fdupes
BuildRequires:  gcc-c++

%description
BoringSSL is an implementation of the Secure Sockets Layer (SSL) and
Transport Layer Security (TLS) protocols, derived from OpenSSL.

%package devel
Summary:        Development files for BoringSSL
Group:          Development/Libraries/C and C++

%description devel
Development files for BoringSSL - an implementation of the Secure
Sockets Layer (SSL) and Transport Layer Security (TLS) protocols,
derived from OpenSSL.

%package source
Summary:        Source code of BoringSSL
Group:          Development/Sources
BuildArch:      noarch

%description source
Source files for BoringSSL implementation

%prep
%autosetup -n %{name}-%{version} -p1 

%build

%install
# Install sources
mkdir -p %{buildroot}%{src_install_dir}
cp -r * %{buildroot}%{src_install_dir}
%fdupes %{buildroot}%{src_install_dir}
# Fix arch-independent-package-contains-binary-or-object
find %{buildroot}%{src_install_dir} -type f \( -name "*.a" -o -name "*.lib" -o -name "*.o" \) -exec rm -f "{}" +
# Fix non-executable-script warning.
find %{buildroot}%{src_install_dir} -type f -name "*.sh" -exec chmod +x "{}" +
# Fix env-script-interpreter error.
find %{buildroot}%{src_install_dir} -type f -name "*.pl" -exec sed -i 's|#!.*/usr/bin/env perl|#!/usr/bin/perl|' "{}" +
find %{buildroot}%{src_install_dir} -type f -name "*.py" -exec sed -i 's|#!.*/usr/bin/python$|#!/usr/bin/python3|' "{}" +
find %{buildroot}%{src_install_dir} -type f -name "*.py" -exec sed -i 's|#!.*/usr/bin/env python.*|#!/usr/bin/python3|' "{}" +
find %{buildroot}%{src_install_dir} -type f -name "*.sh" -exec sed -i 's|#!.*/usr/bin/env bash|#!/bin/bash|' "{}" +

# To avoid conflicts with openssl development files, change all includes from
# openssl to boringssl.
# BoringSSL headers provided by this pachage are installed in
# /usr/include/boringssl for the same reason.
find src/include/openssl -type f -exec sed -i 's/openssl/boringssl/' "{}" +

find src/include/openssl -type f -execdir install -D -m0644 "{}" "%{buildroot}%{_includedir}/boringssl/{}" \;

rm -rf %{buildroot}%{src_install_dir}/src/util/ar/testdata/mac/libsample.a
rm -rf %{buildroot}%{src_install_dir}/src/util/ar/testdata/windows/*

%files
%doc src/README.md
%license LICENSE

%files devel
%{_includedir}/boringssl

%files source
%{src_install_dir}

%changelog
* Mon Apr 7 2025 fuanan <fuanan3@h-partners.com> - 342e805bc1f5dfdd650e3f031686d6c939b095d9-1
- package init