Split CXXFLAGS of the spec file for -D_SECURE_LOG
[platform/framework/native/compat.git] / packaging / osp-compat.spec
1 %define debug_package %{nil}
2 %define __strip /bin/true
3
4 Name:       osp-compat
5 Summary:    osp-compat library 
6 Version:    1.2.2.0
7 Release:    1
8 Group:      TO_BE/FILLED_IN
9 License:    Apache License, Version 2.0
10 Source0:    %{name}-%{version}.tar.gz
11 BuildRequires:  cmake
12 BuildRequires:  pkgconfig(osp-appfw)
13 BuildRequires:  pkgconfig(osp-net)
14 BuildRequires:  pkgconfig(osp-nfc)
15 BuildRequires:  pkgconfig(osp-social)
16 BuildRequires:  pkgconfig(osp-uifw)
17
18 Provides:       libosp-compat.so.1
19
20 %description
21 osp-compat library
22
23 %package debug
24 Summary:    osp-compat (Development)
25 Group:      TO_BE/FILLED_IN
26 Requires:   %{name} = %{version}-%{release}
27
28 %description debug
29 osp-compat library (DEV)
30
31 %prep
32 %setup -q
33
34 %build
35 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
36
37 %ifarch %{ix86}
38         ARCH=x86
39         CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_"
40         %if 0%{?simulator}
41                 CXXFLAGS="$CXXFLAGS -D_OSP_EMUL_"
42         %endif
43 %else
44         ARCH=arm
45         CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -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_"
46 %endif
47
48 %if 0%{?tizen_build_binary_release_type_eng}
49         CXXFLAGS="$CXXFLAGS -D_SECURE_LOG"
50 %endif
51
52 cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DOBS=1 -DFULLVER=%{version} -DMAJORVER=${MAJORVER} -DARCH=${ARCH}
53
54 # Call make instruction with smp support
55 make %{?jobs:-j%jobs}
56
57 %install
58 rm -rf %{buildroot}
59 mkdir -p %{buildroot}/usr/share/license
60 cp %{_builddir}/%{name}-%{version}/LICENSE.APLv2  %{buildroot}/usr/share/license/%{name}
61
62 %make_install
63
64 %post -p /sbin/ldconfig
65
66 %postun -p /sbin/ldconfig
67
68 %files
69 %manifest osp-compat.manifest
70 %defattr(-,root,root,-)
71 /usr/share/license/%{name}
72 %{_libdir}/osp/libosp-compat.so*
73
74 %files debug
75 %{_libdir}/osp/debug/*.so*