DALi Version 1.2.2
[platform/core/uifw/dali-core.git] / packaging / dali.spec
1 Name:       dali
2 Summary:    The OpenGLES Canvas Core Library
3 Version:    1.2.2
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 "%{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 "
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 # LICENSE
126 mkdir -p %{buildroot}/usr/share/license
127 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
128
129
130 ##############################
131 # Post Install
132 ##############################
133 %post
134 /sbin/ldconfig
135 exit 0
136
137 ##############################
138 # Post Uninstall
139 ##############################
140 %postun
141 /sbin/ldconfig
142 exit 0
143
144 ##############################
145 # Files in Binary Packages
146 ##############################
147
148 %files
149 %if 0%{?enable_dali_smack_rules}
150 %manifest dali.manifest-smack
151 %else
152 %manifest dali.manifest
153 %endif
154 %defattr(-,root,root,-)
155 %{_libdir}/lib%{name}-core.so*
156 %defattr(-,app,app,-)
157 %{_datadir}/license/%{name}
158
159 %files devel
160 %defattr(-,root,root,-)
161 %{_libdir}/pkgconfig/*.pc
162 %{dev_include_path}/%{name}/public-api/*
163 %{dev_include_path}/%{name}/devel-api/*
164 %{dev_include_path}/%{name}/doc/*
165
166 %files integration-devel
167 %defattr(-,root,root,-)
168 %{_includedir}/%{name}/integration-api/*