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