Merge "Fix for text controller (IMF callback)." into devel/master
[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.41
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 #############################
24 # profile setup
25 #############################
26
27 %define dali_toolkit_profile MOBILE
28 %define dali_style_folder 720x1280
29 # 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
30
31 %if "%{?dali_style}"
32   %define dali_style_folder %{dali_style}
33 %endif
34
35 # Further resource locations profiles can be provided here otherwise MOBILE will be used
36 %if "%{tizen_profile_name}" == "mobile"
37   %define dali_toolkit_profile MOBILE
38 %endif
39
40 %if 0%{?enable_coverage}
41 CXXFLAGS+=" -fprofile-arcs -ftest-coverage --coverage "
42 LDFLAGS+=" -fprofile-arcs -ftest-coverage --coverage -lgcov "
43 %endif
44
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 %define dali_data_rw_dir            /opt/usr/share/dali/
67 %define dali_data_ro_dir            /usr/share/dali/
68 %define dali_toolkit_image_files    %{dali_data_ro_dir}/toolkit/images/
69 %define dali_toolkit_sound_files    %{dali_data_ro_dir}/toolkit/sounds/
70 %define dali_toolkit_style_files    %{dali_data_ro_dir}/toolkit/styles/
71 %define dev_include_path %{_includedir}
72
73 # PO
74 {
75 cd %{_builddir}/dali-toolkit-%{version}/dali-toolkit/po
76 for language in *.po
77 do
78   language=${language%.po}
79   msgfmt -o ${language}.mo ${language}.po
80 done
81 } &> /dev/null
82
83 ##############################
84 # Build
85 ##############################
86 %build
87 PREFIX="/usr"
88 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
89 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
90
91 libtoolize --force
92 cd %{_builddir}/dali-toolkit-%{version}/build/tizen
93 autoreconf --install
94 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
95 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
96
97 %configure --enable-profile=%{dali_toolkit_profile} \
98            --with-style=%{dali_style_folder} \
99 %if 0%{?enable_debug}
100            --enable-debug \
101 %endif
102            --enable-i18n=yes
103
104 make %{?jobs:-j%jobs}
105
106 ##############################
107 # Installation
108 ##############################
109 %install
110 rm -rf %{buildroot}
111 cd build/tizen
112 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
113
114 # LICENSE
115 mkdir -p %{buildroot}/usr/share/license
116 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
117
118 # PO
119 {
120 cd %{_builddir}/dali-toolkit-%{version}/dali-toolkit/po
121 for language in *.mo
122 do
123   language=${language%.mo}
124   mkdir -p %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/
125   cp ${language}.mo %{buildroot}/%{_datadir}/locale/${language}/LC_MESSAGES/dali-toolkit.mo
126 done
127 } &> /dev/null
128
129 ##############################
130 # Post Install
131 ##############################
132 %post
133 /sbin/ldconfig
134 exit 0
135
136 ##############################
137 # Post Uninstall
138 ##############################
139 %postun
140 /sbin/ldconfig
141 exit 0
142
143 ##############################
144 # Files in Binary Packages
145 ##############################
146 %files
147 %if 0%{?enable_dali_smack_rules}
148 %manifest dali-toolkit.manifest-smack
149 %else
150 %manifest dali-toolkit.manifest
151 %endif
152 %defattr(-,root,root,-)
153 %{_libdir}/lib%{name}.so*
154 %{dali_toolkit_image_files}/*
155 %{dali_toolkit_sound_files}/*
156 %{dali_toolkit_style_files}/*
157 %{_datadir}/license/%{name}
158 %{_datadir}/locale/*/LC_MESSAGES/*
159
160 %files devel
161 %defattr(-,root,root,-)
162 %{dev_include_path}/%{name}/*
163 %{_libdir}/pkgconfig/*.pc