(Build) Only use lcov if it's available
[platform/core/uifw/dali-core.git] / packaging / dali.spec
1 Name:       dali
2 Summary:    DALi 3D Engine
3 Version:    1.4.34
4 Release:    1
5 Group:      System/Libraries
6 License:    Apache-2.0 and BSD-3-Clause and MIT
7 URL:        https://review.tizen.org/git/?p=platform/core/uifw/dali-core.git;a=summary
8 Source0:    %{name}-%{version}.tar.gz
9
10 Requires(post): /sbin/ldconfig
11 Requires(postun): /sbin/ldconfig
12 BuildRequires:  cmake
13 BuildRequires:  pkgconfig
14 BuildRequires:  gawk
15
16 %if 0%{?tizen_version_major} >= 3
17 BuildRequires:  pkgconfig(libtzplatform-config)
18 %endif
19
20 %description
21 DALi 3D Engine
22
23 ##############################
24 # devel
25 ##############################
26 %package devel
27 Summary:    Development components for DALi 3D Engine
28 Group:      Development/Building
29 Requires:   %{name} = %{version}-%{release}
30 Requires:   %{name}-integration-devel = %{version}-%{release}
31
32 %description devel
33 Development components for DALi 3D Engine - public headers and package config
34
35 ##############################
36 # integration-devel
37 ##############################
38 %package integration-devel
39 Summary:    Integration development package for DALi 3D Engine
40 Group:      Development/Building
41 Requires:   %{name} = %{version}-%{release}
42
43 %description integration-devel
44 Integration development package for DALi 3D Engine - headers for integrating with an adaptor/platform abstraction library.
45
46 ##############################
47 # Preparation
48 ##############################
49 %prep
50 %setup -q
51
52 %define dev_include_path %{_includedir}
53
54 ##############################
55 # Build
56 ##############################
57 %build
58 PREFIX="/usr"
59 CXXFLAGS+=" -Wall -g -Os -DNDEBUG -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
60 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -lgcc_s -lgcc -Wl,-Bsymbolic-functions "
61
62 %ifarch %{arm}
63 CXXFLAGS+=" -D_ARCH_ARM_ -mfpu=neon"
64 %endif
65
66 %if 0%{?enable_coverage}
67 CXXFLAGS+=" --coverage "
68 LDFLAGS+=" --coverage "
69 %endif
70
71 libtoolize --force
72 cd %{_builddir}/%{name}-%{version}/build/tizen
73
74 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS;
75 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS;
76 LDFLAGS="${LDFLAGS:-%optflags}" ; export LDFLAGS;
77
78 cmake \
79 %if 0%{?enable_debug}
80       -DCMAKE_BUILD_TYPE=Debug \
81 %endif
82 %if 0%{?enable_trace}
83       -DENABLE_TRACE=ON \
84 %endif
85       -DCMAKE_INSTALL_PREFIX=%{_prefix}
86
87 make %{?jobs:-j%jobs}
88
89 ##############################
90 # Installation
91 ##############################
92 %install
93 rm -rf %{buildroot}
94 cd build/tizen
95
96 pushd %{_builddir}/%{name}-%{version}/build/tizen
97 %make_install
98
99 # Create links to ensure linking with cxx11 library is preserved
100 pushd  %{buildroot}%{_libdir}
101 ln -sf libdali-core.so libdali-core-cxx11.so
102 ln -sf libdali-core.so libdali-core-cxx11.so.0
103 ln -sf libdali-core.so libdali-core-cxx11.so.0.0.0
104 popd
105
106 ##############################
107 # Post Install
108 ##############################
109 %post
110 /sbin/ldconfig
111 exit 0
112
113 ##############################
114 # Post Uninstall
115 ##############################
116 %postun
117 /sbin/ldconfig
118 exit 0
119
120 ##############################
121 # Files in Binary Packages
122 ##############################
123
124 %files
125 %if 0%{?enable_dali_smack_rules}
126 %manifest dali.manifest-smack
127 %else
128 %manifest dali.manifest
129 %endif
130 %defattr(-,root,root,-)
131 %{_libdir}/libdali-core-cxx11.so*
132 %{_libdir}/libdali-core.so*
133 %license LICENSE
134
135 %files devel
136 %defattr(-,root,root,-)
137 %{_libdir}/pkgconfig/dali-core.pc
138 %{dev_include_path}/dali/public-api/*
139 %{dev_include_path}/dali/devel-api/*
140 %{dev_include_path}/dali/doc/*
141
142 %files integration-devel
143 %defattr(-,root,root,-)
144 %{_includedir}/dali/integration-api/*