Add dependency python3-setuptools for python 3.12
[platform/core/security/yaca.git] / packaging / yaca.spec
1 %{!?build_type:%define build_type RELEASE}
2
3 Name:               yaca
4 Version:            0.0.6
5 Release:            0
6 Source0:            %{name}-%{version}.tar.gz
7 License:            Apache-2.0
8 Group:              Security/Other
9 Summary:            Yet Another Crypto API
10 BuildRequires:      cmake
11 BuildRequires:      python3 >= 3.4
12 BuildRequires:      python3-setuptools
13 BuildRequires:      pkgconfig(capi-base-common)
14 BuildRequires:      pkgconfig(openssl3)
15 BuildRequires:      boost-devel
16 %if "%build_type" == "COVERAGE"
17 BuildRequires:      lcov
18 %endif
19 Requires(post):     /sbin/ldconfig
20 Requires(postun):   /sbin/ldconfig
21
22 %description
23 The package provides Yet Another Crypto API.
24
25 %post -p /sbin/ldconfig
26
27 %postun -p /sbin/ldconfig
28
29 %files
30 %license LICENSE
31 %manifest yaca.manifest
32 %{_libdir}/libyaca.so.0
33 %{_libdir}/libyaca.so.%{version}
34
35 %prep
36 %setup -q
37
38 %global coverage_dir %{_datadir}/yaca-coverage
39
40 %build
41 %cmake . \
42         -DCMAKE_BUILD_TYPE=%{build_type} \
43         -DCOVERAGE_DIR=%{coverage_dir}
44
45 make -k %{?jobs:-j%jobs}
46
47 %install
48 %make_install
49 %py3_compile %{buildroot}/%{python3_sitelib}
50
51 %clean
52 rm -rf %{buildroot}
53
54 ## Devel Package ##############################################################
55 %package devel
56 Summary:        Yet Another Crypto API development files
57 Group:          Security/Other
58 Requires:       yaca = %{version}-%{release}
59
60 %description devel
61 The package provides Yet Another Crypto API development files.
62
63 %files devel
64 %{_libdir}/libyaca.so
65 %{_includedir}/yaca
66 %{_libdir}/pkgconfig/yaca.pc
67
68 ## Examples Package ###########################################################
69 %package examples
70 Summary:        Yet Another Crypto API example files
71 Group:          Security/Other
72 Requires:       yaca = %{version}-%{release}
73
74 %description examples
75 The package provides Yet Another Crypto API example files.
76
77 %files examples
78 %{_bindir}/yaca-example*
79 %{_datadir}/%{name}/examples
80
81 ## Tests Package ##############################################################
82 %package tests
83 Summary:        Yet Another Crypto API tests
84 Group:          Security/Other
85 Requires:       yaca = %{version}-%{release}
86
87 %description tests
88 The package provides Yet Another Crypto API unit tests.
89
90 %files tests
91 %{_bindir}/yaca-unit-tests*
92
93 ## Python3 Package ############################################################
94 %package -n python3-yaca
95 Summary:        Yet Another Crypto API Python3 bindings
96 Group:          Security/Other
97 Requires:       yaca = %{version}-%{release}
98
99 %description -n python3-yaca
100 The package provides Yet Another Crypto API bindings for Python3.
101
102 %files -n python3-yaca
103 %{python3_sitelib}/%{name}
104
105 ## Coverage Package ###########################################################
106 %if "%build_type" == "COVERAGE"
107 %package coverage
108 Summary:        Yet Another Crypto API code coverage data
109 Group:          Security/Other
110 Requires:       yaca-tests = %{version}-%{release}
111 Requires:       yaca-debugsource = %{version}-%{release}
112 Requires:       lcov
113 Requires:       gcc
114
115 %description coverage
116 Yet Another Crypto API code coverage data
117
118 %files coverage
119 %{_bindir}/yaca-coverage.sh
120 %coverage_dir
121 %endif