summaryrefslogtreecommitdiff
path: root/packaging/libcryptsvc.spec
blob: c467259ff33ed5d0158a79a05d1b5ad79c3ed24b (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
84
85
86
87
88
89
90
91
92
Name:       libcryptsvc
Summary:    Crypto Service Library
Version:    0.0.1
Release:    6
Group:      Security/Libraries
License:    Apache-2.0 and BSL-1.0
Source0:    %{name}-%{version}.tar.gz
Source1001: libcryptsvc.manifest
BuildRequires: cmake
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(libcrypto)
BuildRequires: pkgconfig(capi-system-info)
BuildRequires:  pkgconfig(libtzplatform-config)

%description
Crypto Service Library.

%package devel
Summary:    Crypto Service Library (Development)
Group:      Security/Libraries
Requires:   %{name} = %{version}-%{release}

%description devel
Crypto Service Library (Development).

%package test
Summary:    Testing for Crypto Service
Group:      Security/Testing
BuildRequires: boost-devel >= 1.62.0
Requires:   boost-test
Requires:   %{name} = %{version}-%{release}

%description test
Testing for Crypto Service.

%prep
%setup -q
cp %{SOURCE1001} .

%build
export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"

export CFLAGS="$CFLAGS -DTIZEN_ENGINEER_MODE"
export CXXFLAGS="$CXXFLAGS -DTIZEN_ENGINEER_MODE"
export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"

%ifarch %ix86
export CFLAGS="$CFLAGS -DTIZEN_EMULATOR_MODE"
export CXXFLAGS="$CXXFLAGS -DTIZEN_EMULATOR_MODE"
export FFLAGS="$FFLAGS -DTIZEN_EMULATOR_MODE"
%endif

%{!?build_type:%define build_type "Release"}
%cmake . \
    -DCMAKE_BUILD_TYPE=%build_type \
%ifarch %ix86 x86_64
    -DARCH=x86 \
%else
    -DARCH=arm \
%endif
    -DVERSION=%version \
    -DDESCRIPTION="%summary" \
    -DTZ_SYS_ETC=%TZ_SYS_ETC

make %{?jobs:-j%jobs}

%install
%make_install


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%manifest %{name}.manifest
%license LICENSE
%license LICENSE.BSL-1.0
%{_libdir}/libcryptsvc.so.*
%{_libdir}/libdevice_info.so.*
%{TZ_SYS_ETC}/duid-gadget

%files devel
%{_includedir}/*
%{_libdir}/libcryptsvc.so
%{_libdir}/libdevice_info.so
%{_libdir}/pkgconfig/cryptsvc.pc

%files test
%{_bindir}/cryptsvc-test