Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-core.git] / packaging / dali.spec
1 Name:       dali
2 Summary:    DALi 3D Engine
3 Version:    1.4.34
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:  pkgconfig
13 BuildRequires:  gawk
14
15 %if 0%{?tizen_version_major} >= 3
16 BuildRequires:  pkgconfig(libtzplatform-config)
17 %endif
18
19 %description
20 DALi 3D Engine
21
22 ##############################
23 # devel
24 ##############################
25 %package devel
26 Summary:    Development components for DALi 3D Engine
27 Group:      Development/Building
28 Requires:   %{name} = %{version}-%{release}
29 Requires:   %{name}-integration-devel = %{version}-%{release}
30
31 %description devel
32 Development components for DALi 3D Engine - public headers and package config
33
34 ##############################
35 # integration-devel
36 ##############################
37 %package integration-devel
38 Summary:    Integration development package for DALi 3D Engine
39 Group:      Development/Building
40 Requires:   %{name} = %{version}-%{release}
41
42 %description integration-devel
43 Integration development package for DALi 3D Engine - 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 %else
57 %define dali_data_rw_dir %TZ_SYS_SHARE/dali/
58 %define dali_data_ro_dir %TZ_SYS_RO_SHARE/dali/
59 %endif
60
61 %define dev_include_path %{_includedir}
62
63 ##############################
64 # Build
65 ##############################
66 %build
67 PREFIX="/usr"
68 CXXFLAGS+=" -Wall -g -Os -DNDEBUG -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
69 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -lgcc_s -lgcc -Wl,-Bsymbolic-functions "
70
71 %ifarch %{arm}
72 CXXFLAGS+=" -D_ARCH_ARM_ -mfpu=neon"
73 %endif
74
75 %if 0%{?enable_coverage}
76 CXXFLAGS+=" --coverage "
77 LDFLAGS+=" --coverage "
78 %endif
79
80 libtoolize --force
81 cd %{_builddir}/%{name}-%{version}/build/tizen
82 autoreconf --install
83 DALI_DATA_RW_DIR="%{dali_data_rw_dir}"
84 DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
85 export DALI_DATA_RW_DIR
86 export DALI_DATA_RO_DIR
87
88 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS;
89 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS;
90 LDFLAGS="${LDFLAGS:-%optflags}" ; export LDFLAGS;
91
92 ./configure \
93       --program-prefix=%{?_program_prefix} \
94       --prefix=%{_prefix} \
95       --exec-prefix=%{_exec_prefix} \
96       --bindir=%{_bindir} \
97       --sbindir=%{_sbindir} \
98       --sysconfdir=%{_sysconfdir} \
99       --datadir=%{_datadir} \
100       --includedir=%{_includedir} \
101       --libdir=%{_libdir} \
102       --libexecdir=%{_libexecdir} \
103       --localstatedir=%{_localstatedir} \
104       --sharedstatedir=%{_sharedstatedir} \
105       --mandir=%{_mandir} \
106 %if 0%{?enable_debug}
107       --enable-debug \
108 %endif
109 %if 0%{?enable_trace}
110       --enable-trace \
111 %endif
112       --infodir=%{_infodir} \
113       --enable-rename-so=no
114
115 make %{?jobs:-j%jobs}
116
117 pushd %{_builddir}/%{name}-%{version}/build/tizen
118 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
119 popd
120
121 pushd %{buildroot}%{_libdir}
122 for FILE in libdali-core-cxx11.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
123 mv pkgconfig/dali-core.pc %{_builddir}/%{name}-%{version}/build/tizen/dali-core.pc
124 popd
125
126 ##############################
127 # Installation
128 ##############################
129 %install
130 rm -rf %{buildroot}
131 cd build/tizen
132
133 pushd %{_builddir}/%{name}-%{version}/build/tizen
134 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
135
136 for FILE in libdali-*.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE"; done
137 mv dali-core.pc %{buildroot}%{_libdir}/pkgconfig/dali-core.pc
138 popd
139
140 #############################
141 #rename
142 #############################
143 pushd  %{buildroot}%{_libdir}
144 rm -rf libdali-core.so
145 rm -rf libdali-core-cxx11.so
146 ln -s libdali-core-cxx11.so.0.0.* libdali-core.so
147 popd
148
149
150 ##############################
151 # Post Install
152 ##############################
153 %post
154 /sbin/ldconfig
155 exit 0
156
157 ##############################
158 # Post Uninstall
159 ##############################
160 %postun
161 /sbin/ldconfig
162 exit 0
163
164 ##############################
165 # Files in Binary Packages
166 ##############################
167
168 %files
169 %if 0%{?enable_dali_smack_rules}
170 %manifest dali.manifest-smack
171 %else
172 %manifest dali.manifest
173 %endif
174 %defattr(-,root,root,-)
175 %{_libdir}/libdali-core-cxx11.so.*
176 %{_libdir}/libdali-core.so
177 %license LICENSE
178
179 %files devel
180 %defattr(-,root,root,-)
181 %{_libdir}/pkgconfig/dali-core.pc
182 %{dev_include_path}/dali/public-api/*
183 %{dev_include_path}/dali/devel-api/*
184 %{dev_include_path}/dali/doc/*
185
186 %files integration-devel
187 %defattr(-,root,root,-)
188 %{_includedir}/dali/integration-api/*