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