-
Notifications
You must be signed in to change notification settings - Fork 3
/
leancrypto.spec
148 lines (121 loc) · 4.89 KB
/
leancrypto.spec
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#
# spec file for package leancrypto
#
# Copyright (c) 2022 - 2024 Stephan Mueller <[email protected]
#
Name: leancrypto
Version: 1.2.0
Release: 1.1
Summary: Cryptographic library with stack-only support and PQC-safe algorithms
License: GPL-2.0 OR BSD-2-Clause
URL: https://www.leancrypto.org
Source0: https://www.leancrypto.org/%{name}/releases/%{name}-%{version}/%{name}-%{version}.tar.xz
#Source1: https://www.leancrypto.org/%{name}/releases/%{name}-%{version}/%{name}-%{version}.tar.xz.asc
BuildRequires: meson
BuildRequires: clang
BuildRequires: %kernel_module_package_buildreqs
%description
Leancrypto provides a general-purpose cryptographic library with PQC-safe
algorithms. Further it only has POSIX dependencies, and allows all algorithms
to be used on stack as well as on heap. Accelerated algorithms are transparently
enabled if possible.
%package -n lib%{name}1
Summary: Cryptographic library with stack-only support and PQC-safe algorithms
Provides: %{name} = %{version}-%{release}
Obsoletes: %{name} < %{version}-%{release}
%description -n lib%{name}1
Leancrypto provides a general-purpose cryptographic library with PQC-safe
algorithms. Further it only has POSIX dependencies, and allows all algorithms
to be used on stack as well as on heap. Accelerated algorithms are transparently
enabled if possible.
%package devel
Summary: Development files for leancrypto, a cryptographic library
Requires: glibc-devel
Requires: lib%{name}1 = %{version}
# Cannot be noarch due to leancrypto.so symlink
#BuildArch: noarch
#BuildArchitectures: noarch
%description devel
Leancrypto provides a general-purpose cryptographic library with PQC-safe
algorithms. Further it only has POSIX dependencies, and allows all algorithms
to be used on stack as well as on heap. Accelerated algorithms are transparently
enabled if possible.
This subpackage holds the development headers for the library.
%package devel-static
Summary: Static library for leancrypto
Requires: %{name}-devel = %{version}
Provides: %{name}-devel:%{_libdir}/lib%{name}.a
%description devel-static
Leancrypto provides a general-purpose cryptographic library with PQC-safe
algorithms. Further it only has POSIX dependencies, and allows all algorithms
to be used on stack as well as on heap. Accelerated algorithms are transparently
enabled if possible.
This subpackage contains the static version of the library
used for development.
%package -n %{name}-tools
Summary: Applications provided by leancrypto
Requires: glibc-devel
Requires: lib%{name}1 = %{version}
%description -n %{name}-tools
Leancrypto provides a general-purpose cryptographic library with PQC-safe
algorithms. Further it only has POSIX dependencies, and allows all algorithms
to be used on stack as well as on heap. Accelerated algorithms are transparently
enabled if possible.
This subpackage holds the tools provided by the library, such as sha*sum.
%kernel_module_package
%package -n lib%{name}1-kernel
Summary: Cryptographic library with PQC-safe algorithms Kernel Module Package
%description -n lib%{name}1-kernel
Leancrypto provides a general-purpose cryptographic library with PQC-safe
algorithms. Further it only has POSIX dependencies, and allows all algorithms
to be used on stack as well as on heap. Accelerated algorithms are transparently
enabled if possible.
This package contains the Linux kernel module version of leancrypto. This
kernel module offers the same APIs and functions in kernel space that are
available in user space.
%prep
%setup -q
set -- *
mkdir source
cp -ar "$@" source/
mkdir obj
%build
%meson -Dseedsource=esdm
%meson_build
for flavor in %flavors_to_build; do
KERNELRELEASE=`make -s -C /%{_prefix}/src/linux-obj/%{_target_cpu}/$flavor kernelrelease`
rm -rf obj/$flavor
cp -r source obj/$flavor
make -C obj/$flavor/linux_kernel modules M=$PWD/obj/$flavor KERNELRELEASE=$KERNELRELEASE
done
%check
%meson_test --suite regression
%install
%meson_install
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates
for flavor in %flavors_to_build; do
KERNELRELEASE=`make -s -C /%{_prefix}/src/linux-obj/%{_target_cpu}/$flavor kernelrelease`
make -C obj/$flavor/linux_kernel modules_install M=$PWD/obj/$flavor KERNELRELEASE=$KERNELRELEASE
done
%post -n lib%{name}1 -p /sbin/ldconfig
%postun -n lib%{name}1 -p /sbin/ldconfig
%files -n lib%{name}1
%license LICENSE LICENSE.bsd LICENSE.gplv2
%{_libdir}/lib%{name}.so.*
%{_libdir}/pkgconfig/%{name}.pc
%files devel
%doc README.md CHANGES.md
%{_includedir}/%{name}.h
%{_includedir}/%{name}
%{_libdir}/lib%{name}.so
%files devel-static
%{_libdir}/lib%{name}.a
%files -n %{name}-tools
%{_libexecdir}/%{name}
%{_libexecdir}/%{name}/sha256sum
%{_libexecdir}/%{name}/sha384sum
%{_libexecdir}/%{name}/sha512sum
%{_libexecdir}/%{name}/sha3-256sum
%{_libexecdir}/%{name}/sha3-384sum
%{_libexecdir}/%{name}/sha3-512sum