[3.0] DALi Version 1.1.49
[platform/core/uifw/dali-toolkit.git] / packaging / dali-toolkit.spec
1 Name:       dali-toolkit
2 Summary:    The OpenGLES Canvas Core Library Toolkit
3 Version:    1.1.49
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-toolkit.git;a=summary
8 Source0:    %{name}-%{version}.tar.gz
9
10 Requires(post): /sbin/ldconfig
11 Requires(postun): /sbin/ldconfig
12
13 BuildRequires:  pkgconfig
14 BuildRequires:  pkgconfig(dlog)
15 BuildRequires:  pkgconfig(dali-core)
16 BuildRequires:  pkgconfig(dali-adaptor)
17 BuildRequires: gettext
18
19 # dali-toolkit only need to know the interfaces(APIs) of dali-adaptor(the devel package).
20 # It doesn't need to know which adaptor will be used by applications.
21 # Applications or dali-addon will decide which one they will use.
22 BuildRequires:  dali-adaptor-devel
23
24 #need libtzplatform-config for directory if tizen version is 3.x
25
26 %if "%{tizen_version_major}" == "3"
27 BuildRequires:  pkgconfig(libtzplatform-config)
28 %endif
29
30 #############################
31 # profile setup
32 #############################
33
34 %if "%{tizen_version_major}" == "2" && 0%{?tizen_profile_name:1}
35 %define profile %{tizen_profile_name}
36 %endif
37
38 %if "%{profile}" == "tv"
39 %define dali_toolkit_profile TV
40 %define dali_style_folder 1920x1080
41 %else
42 %if "%{profile}" == "wearable"
43 %define dali_toolkit_profile WEARABLE
44 %define dali_style_folder 360x360
45 %else
46 %define dali_toolkit_profile MOBILE
47 %define dali_style_folder 720x1280
48 # dali_style to be provided by build system as with dali_toolkit_profile or by passing --define 'dali_style 470x800' to the rpm build command
49 %endif
50 %endif
51
52 %if "%{?dali_style}"
53   %define dali_style_folder %{dali_style}
54 %endif
55
56 %description
57 The OpenGLES Canvas Core Library Toolkit - a set of controls that provide
58 user interface functionality.
59
60 ##############################
61 # devel
62 ##############################
63 %package devel
64 Summary:    Application development package for the OpenGLES Canvas toolkit
65 Group:      Development/Building
66 Requires:   %{name} = %{version}-%{release}
67
68 %description devel
69 Application development package for the OpenGLES Canvas toolkit - headers and package config
70
71 ##############################
72 # Preparation
73 ##############################
74 %prep
75 %setup -q
76
77 #Use TZ_PATH when tizen version is 3.x
78
79 %if "%{tizen_version_major}" == "2"
80 %define dali_data_rw_dir            /opt/usr/share/dali/
81 %define dali_data_ro_dir            /usr/share/dali/
82 %else
83 %define dali_data_rw_dir            %TZ_SYS_SHARE/dali/
84 %define dali_data_ro_dir            %TZ_SYS_RO_SHARE/dali/
85 %endif
86
87 %define dali_toolkit_image_files    %{dali_data_ro_dir}/toolkit/images/
88 %define dali_toolkit_sound_files    %{dali_data_ro_dir}/toolkit/sounds/
89 %define dali_toolkit_style_files    %{dali_data_ro_dir}/toolkit/styles/
90 %define dev_include_path %{_includedir}
91
92 # PO
93 {
94 cd %{_builddir}/dali-toolkit-%{version}/dali-toolkit/po
95 for language in *.po
96 do
97   language=${language%.po}
98   msgfmt -o ${language}.mo ${language}.po
99 done
100 } &> /dev/null
101
102 ##############################
103 # Build
104 ##############################
105 %build
106 PREFIX="/usr"
107 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
108 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
109
110 %if 0%{?enable_coverage}
111 CXXFLAGS+=" --coverage "
112 LDFLAGS+=" --coverage "
113 %endif
114
115 libtoolize --force
116 cd %{_builddir}/dali-toolkit-%{version}/build/tizen
117 autoreconf --install
118 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
119 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
120
121 %configure --enable-profile=%{dali_toolkit_profile} \
122            --with-style=%{dali_style_folder} \
123 %if 0%{?enable_debug}
124            --enable-debug \
125 %endif
126            --enable-i18n=yes
127
128 make %{?jobs:-j%jobs}
129
130 ##############################
131 # Installation
132 ##############################
133 %install
134 rm -rf %{buildroot}
135 cd build/tizen
136 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
137
138
139 # PO
140 {
141 cd %{_builddir}/dali-toolkit-%{version}/dali-toolkit/po
142 for language in *.mo
143 do
144   language=${language%.mo}
145   mkdir -p %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/
146   cp ${language}.mo %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/dali-toolkit.mo
147 done
148 } &> /dev/null
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 %files
168 %if 0%{?enable_dali_smack_rules}
169 %manifest dali-toolkit.manifest-smack
170 %else
171 %manifest dali-toolkit.manifest
172 %endif
173 %defattr(-,root,root,-)
174 %{_libdir}/lib%{name}.so*
175 %{dali_toolkit_image_files}/*
176 %{dali_toolkit_sound_files}/*
177 %{dali_toolkit_style_files}/*
178 %license LICENSE
179 #%{_datadir}/license/%{name}
180 %{_datadir}/locale/*/LC_MESSAGES/*
181
182 %files devel
183 %defattr(-,root,root,-)
184 %{dev_include_path}/%{name}/*
185 %{_libdir}/pkgconfig/*.pc