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