683867c13a5aed3b6b813eb7b11c204f2a9274c3
[platform/core/uifw/dali-core.git] / packaging / dali.spec
1 Name:       dali
2 Summary:    The OpenGLES Canvas Core Library
3 Version:    1.2.36
4 Release:    1
5 Group:      System/Libraries
6 License:    Apache-2.0 and BSD-2-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:  pkgconfig
13 BuildRequires:  gawk
14
15 %if 0%{?tizen_version_major} >= 3
16 BuildRequires:  pkgconfig(libtzplatform-config)
17 %endif
18
19
20 %description
21 The OpenGLES Canvas Core Library provides a 3D scene graph
22
23 ##############################
24 # devel
25 ##############################
26 %package devel
27 Summary:    Development components for the OpenGLES Canvas Core Library
28 Group:      Development/Building
29 Requires:   %{name} = %{version}-%{release}
30 Requires:   %{name}-integration-devel = %{version}-%{release}
31
32 %description devel
33 Development components for the OpenGLES Canvas Core Library - public headers and package config
34
35 ##############################
36 # integration-devel
37 ##############################
38 %package integration-devel
39 Summary:    Integration development package for the OpenGLES Canvas
40 Group:      Development/Building
41 Requires:   %{name} = %{version}-%{release}
42
43 %description integration-devel
44 Integration development package for the OpenGLES Canvas - headers for integrating with an adaptor/platform abstraction library.
45
46 ##############################
47 # Preparation
48 ##############################
49 %prep
50 %setup -q
51
52 #Use TZ_PATH when tizen version is 3.x
53
54 %if "%{tizen_version_major}" == "2"
55 %define dali_data_rw_dir /opt/usr/share/dali/
56 %define dali_data_ro_dir /usr/share/dali/
57 %else
58 %define dali_data_rw_dir %TZ_SYS_SHARE/dali/
59 %define dali_data_ro_dir %TZ_SYS_RO_SHARE/dali/
60 %endif
61
62 %define dev_include_path %{_includedir}
63
64 ##############################
65 # Build
66 ##############################
67 %build
68 PREFIX="/usr"
69 CXXFLAGS+=" -Wall -g -Os -DNDEBUG -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections -D_GLIBCXX_USE_CXX11_ABI=0 "
70 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -lgcc_s -lgcc -lpthread -Wl,-Bsymbolic-functions "
71
72 %ifarch %{arm}
73 CXXFLAGS+=" -D_ARCH_ARM_ -mfpu=neon"
74 %endif
75
76 %if 0%{?enable_coverage}
77 CXXFLAGS+=" --coverage "
78 LDFLAGS+=" --coverage "
79 %endif
80
81 libtoolize --force
82 cd %{_builddir}/%{name}-%{version}/build/tizen
83 autoreconf --install
84 DALI_DATA_RW_DIR="%{dali_data_rw_dir}"
85 DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
86 export DALI_DATA_RW_DIR
87 export DALI_DATA_RO_DIR
88
89 # Default to GLES 2.0 if not specified.
90 %{!?target_gles_version: %define target_gles_version 20}
91
92 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS;
93 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS;
94 LDFLAGS="${LDFLAGS:-%optflags}" ; export LDFLAGS;
95 ./configure \
96       --program-prefix=%{?_program_prefix} \
97       --prefix=%{_prefix} \
98       --exec-prefix=%{_exec_prefix} \
99       --bindir=%{_bindir} \
100       --sbindir=%{_sbindir} \
101       --sysconfdir=%{_sysconfdir} \
102       --datadir=%{_datadir} \
103       --includedir=%{_includedir} \
104       --libdir=%{_libdir} \
105       --libexecdir=%{_libexecdir} \
106       --localstatedir=%{_localstatedir} \
107       --sharedstatedir=%{_sharedstatedir} \
108       --mandir=%{_mandir} \
109       --enable-gles=%{target_gles_version} \
110 %if 0%{?enable_debug}
111       --enable-debug \
112 %endif
113       --infodir=%{_infodir}
114
115 make %{?jobs:-j%jobs}
116
117 ##############################
118 # Installation
119 ##############################
120 %install
121 rm -rf %{buildroot}
122 cd build/tizen
123 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
124
125
126
127 ##############################
128 # Post Install
129 ##############################
130 %post
131 /sbin/ldconfig
132 exit 0
133
134 ##############################
135 # Post Uninstall
136 ##############################
137 %postun
138 /sbin/ldconfig
139 exit 0
140
141 ##############################
142 # Files in Binary Packages
143 ##############################
144
145 %files
146 %if 0%{?enable_dali_smack_rules}
147 %manifest dali.manifest-smack
148 %else
149 %manifest dali.manifest
150 %endif
151 %defattr(-,root,root,-)
152 %{_libdir}/lib%{name}-core.so*
153 %defattr(-,app,app,-)
154 %license LICENSE
155
156 %files devel
157 %defattr(-,root,root,-)
158 %{_libdir}/pkgconfig/*.pc
159 %{dev_include_path}/%{name}/public-api/*
160 %{dev_include_path}/%{name}/devel-api/*
161 %{dev_include_path}/%{name}/doc/*
162
163 %files integration-devel
164 %defattr(-,root,root,-)
165 %{_includedir}/%{name}/integration-api/*