Modify CMake file for using pkgconfig
[platform/framework/native/secure-element.git] / packaging / osp-secure-element.spec
1 Name:           osp-secure-element
2 Summary:        The Secure Element library of OSP
3 Version:        1.2.2.0
4 Release:        1
5 Group:          System/Libraries
6 License:        Apache-2.0
7 Source0:        %{name}-%{version}.tar.gz
8 Source1001:             osp-secure-element.manifest
9 BuildRequires:  cmake
10 BuildRequires:  pkgconfig(osp-appfw)
11 BuildRequires:  osp-appfw-internal-devel
12 BuildRequires:  pkgconfig(smartcard-service)
13 BuildRequires:  pkgconfig(smartcard-service-common)
14
15 # runtime requires
16 Requires: osp-appfw
17
18 %description
19 The Secure Element library of OSP
20
21 %package devel
22 Summary:    The Secure Element library of OSP (Development)
23 Group:      Development/Libraries
24 Requires:   %{name} = %{version}-%{release}
25
26 %description devel
27 The Secure Element library of OSP (DEV)
28
29 %package internal-devel
30 Summary:    The Secure Element library of OSP (Internal)
31 Group:      TO_BE/FILLED_IN
32 Requires:   %{name} = %{version}-%{release}
33
34 %description internal-devel
35 The Secure Element library of OSP (Internal-DEV)
36
37 %prep
38 %setup -q
39 cp %{SOURCE1001} .
40
41 %build
42 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
43 %ifarch %{ix86}
44 %if 0%{?simulator}
45 CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_ -D_OSP_EMUL_"
46 %else
47 CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_ "
48 %endif
49 %else
50 CXXFLAGS="-O2 -g -pipe -Wall -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_OSP_ARMEL_"
51 %endif
52
53 %if 0%{?tizen_build_binary_release_type_eng}
54 CXXFLAGS="$CXXFLAGS -D_SECURE_LOG"
55 %endif
56
57 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
58
59 # Call make instruction with smp support
60 make %{?jobs:-j%jobs}
61
62 %install
63 rm -rf %{buildroot}
64 mkdir -p %{buildroot}/usr/share/license
65 cp LICENSE %{buildroot}/usr/share/license/%{name}
66
67 %make_install
68
69 %post -p /sbin/ldconfig
70
71 %postun -p /sbin/ldconfig
72
73 %files
74 %manifest osp-secure-element.manifest
75 /usr/share/license/%{name}
76 %{_libdir}/osp/*.so*
77
78 %files devel
79 %{_includedir}/osp/*.h
80 %{_libdir}/pkgconfig/osp-secure-element.pc