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