Fix build error with rpm 4.14.1 version
[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 %build
38 %cmake . -DCMAKE_BUILD_TYPE=%{build_type}
39
40 make -k %{?jobs:-j%jobs}
41
42 %if %{build_type} == "COVERAGE"
43 mkdir -p gcov-obj
44 find . \( -name '*.gcno' ! -name 'tc_*' \) -exec cp '{}' gcov-obj ';'
45 %endif
46
47 %install
48 %make_install
49 %py3_compile %{buildroot}/%{python3_sitearch}
50
51 %if %{build_type} == "COVERAGE"
52 mkdir -p %{buildroot}%{_datadir}/gcov/obj
53 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
54 %endif
55
56
57 %clean
58 rm -rf %{buildroot}
59
60 ## Devel Package ###############################################################
61 %package devel
62 Summary:        Yet Another Crypto API development files
63 Group:          Security/Other
64 Requires:       yaca = %{version}-%{release}
65
66 %description devel
67 The package provides Yet Another Crypto API development files.
68
69 %files devel
70 %{_libdir}/libyaca.so
71 %{_includedir}/yaca
72 %{_libdir}/pkgconfig/yaca.pc
73
74 ## Examples Package ############################################################
75 %package examples
76 Summary:        Yet Another Crypto API example files
77 Group:          Security/Other
78 Requires:       yaca = %{version}-%{release}
79
80 %description examples
81 The package provides Yet Another Crypto API example files.
82
83 %files examples
84 %{_bindir}/yaca-example*
85 %{_datadir}/%{name}/examples
86
87 ## Tests Package ############################################################
88 %package tests
89 Summary:        Yet Another Crypto API tests
90 Group:          Security/Other
91 Requires:       yaca = %{version}-%{release}
92
93 %description tests
94 The package provides Yet Another Crypto API unit tests.
95
96 %files tests
97 %{_bindir}/yaca-unit-tests*
98
99 ## Python3 Package ############################################################
100 %package -n python3-yaca
101 Summary:        Yet Another Crypto API Python3 bindings
102 Group:          Security/Other
103 Requires:       yaca = %{version}-%{release}
104
105 %description -n python3-yaca
106 The package provides Yet Another Crypto API bindings for Python3.
107
108 %files -n python3-yaca
109 %{python3_sitearch}/%{name}
110
111 ## gcov Package ############################################################
112 %if %{build_type} == "COVERAGE"
113 %package gcov
114 Summary:  yaca gcov for measuring test coverage
115 Group:    Secureity/Testing
116 %description gcov
117 New yaca gcov objects
118
119 %files gcov
120 %{_datadir}/gcov/obj/*
121 %endif