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