[3.0] Tizen Directory Migration
[platform/core/uifw/dali-core.git] / packaging / dali.spec
1 Name:       dali
2 Summary:    The OpenGLES Canvas Core Library
3 Version:    1.1.39
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 %description
20 The OpenGLES Canvas Core Library provides a 3D scene graph
21
22 ##############################
23 # devel
24 ##############################
25 %package devel
26 Summary:    Development components for the OpenGLES Canvas Core Library
27 Group:      Development/Building
28 Requires:   %{name} = %{version}-%{release}
29 Requires:   %{name}-integration-devel = %{version}-%{release}
30
31 %description devel
32 Development components for the OpenGLES Canvas Core Library - public headers and package config
33
34 ##############################
35 # integration-devel
36 ##############################
37 %package integration-devel
38 Summary:    Integration development package for the OpenGLES Canvas
39 Group:      Development/Building
40 Requires:   %{name} = %{version}-%{release}
41
42 %description integration-devel
43 Integration development package for the OpenGLES Canvas - headers for integrating with an adaptor/platform abstraction library.
44
45 ##############################
46 # Preparation
47 ##############################
48 %prep
49 %setup -q
50
51 #Use TZ_PATH when tizen version is 3.x
52
53 %if "%{tizen_version_major}" == "2"
54 %define dali_data_rw_dir /opt/usr/share/dali/
55 %define dali_data_ro_dir /usr/share/dali/
56 %endif
57
58 %if "%{tizen_version_major}" == "3"
59 %define dali_data_rw_dir %TZ_SYS_SHARE/dali/
60 %define dali_data_ro_dir %TZ_SYS_RO_SHARE/dali/
61 %endif
62
63 %define dev_include_path %{_includedir}
64
65 ##############################
66 # Build
67 ##############################
68 %build
69 PREFIX="/usr"
70 CXXFLAGS+=" -Wall -g -Os -DNDEBUG -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
71 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -lgcc_s -lgcc -lpthread -Wl,-Bsymbolic-functions "
72
73 %ifarch %{arm}
74 CXXFLAGS+=" -D_ARCH_ARM_ -mfpu=neon"
75 %endif
76
77 libtoolize --force
78 cd %{_builddir}/%{name}-%{version}/build/tizen
79 autoreconf --install
80 DALI_DATA_RW_DIR="%{dali_data_rw_dir}"
81 DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
82 export DALI_DATA_RW_DIR
83 export DALI_DATA_RO_DIR
84
85 # Default to GLES 2.0 if not specified.
86 %{!?target_gles_version: %define target_gles_version 20}
87
88 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS;
89 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS;
90 LDFLAGS="${LDFLAGS:-%optflags}" ; export LDFLAGS;
91 ./configure \
92       --program-prefix=%{?_program_prefix} \
93       --prefix=%{_prefix} \
94       --exec-prefix=%{_exec_prefix} \
95       --bindir=%{_bindir} \
96       --sbindir=%{_sbindir} \
97       --sysconfdir=%{_sysconfdir} \
98       --datadir=%{_datadir} \
99       --includedir=%{_includedir} \
100       --libdir=%{_libdir} \
101       --libexecdir=%{_libexecdir} \
102       --localstatedir=%{_localstatedir} \
103       --sharedstatedir=%{_sharedstatedir} \
104       --mandir=%{_mandir} \
105       --enable-gles=%{target_gles_version} \
106 %if 0%{?enable_debug}
107       --enable-debug \
108 %endif
109       --infodir=%{_infodir}
110
111 #make %{?jobs:-j%jobs}
112 make
113
114 ##############################
115 # Installation
116 ##############################
117 %install
118 rm -rf %{buildroot}
119 cd build/tizen
120 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
121
122 # LICENSE
123 mkdir -p %{buildroot}/usr/share/license
124 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
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 %{_datadir}/license/%{name}
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/*