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