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