770367d6ab130140044fbe8cb331fbc05e98605c
[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.20
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
17 # dali-toolkit only need to know the interfaces(APIs) of dali-adaptor(the devel package).
18 # It doesn't need to know which adaptor will be used by applications.
19 # Applications or dali-addon will decide which one they will use.
20 BuildRequires:  dali-adaptor-devel
21
22 #############################
23 # profile setup
24 #############################
25
26 %define dali_toolkit_profile MOBILE
27 %define dali_style_folder 720x1280
28 # 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
29
30 %if "%{?dali_style}"
31   %define dali_style_folder %{dali_style}
32 %endif
33
34 # Further resource locations profiles can be provided here otherwise MOBILE will be used
35 %if "%{tizen_profile_name}" == "mobile"
36   %define dali_toolkit_profile MOBILE
37 %endif
38
39 %description
40 The OpenGLES Canvas Core Library Toolkit - a set of controls that provide
41 user interface functionality.
42
43 ##############################
44 # devel
45 ##############################
46 %package devel
47 Summary:    Application development package for the OpenGLES Canvas toolkit
48 Group:      Development/Building
49 Requires:   %{name} = %{version}-%{release}
50
51 %description devel
52 Application development package for the OpenGLES Canvas toolkit - headers and package config
53
54 ##############################
55 # Preparation
56 ##############################
57 %prep
58 %setup -q
59 %define dali_data_rw_dir            /opt/usr/share/dali/
60 %define dali_data_ro_dir            /usr/share/dali/
61 %define dali_toolkit_image_files    %{dali_data_ro_dir}/toolkit/images/
62 %define dali_toolkit_sound_files    %{dali_data_ro_dir}/toolkit/sounds/
63 %define dali_toolkit_style_files    %{dali_data_ro_dir}/toolkit/styles/
64 %define dev_include_path %{_includedir}
65
66 ##############################
67 # Build
68 ##############################
69 %build
70 PREFIX="/usr"
71 CXXFLAGS+=" -Wall -g -Os -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
72 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -Wl,-Bsymbolic-functions "
73
74 libtoolize --force
75 cd %{_builddir}/dali-toolkit-%{version}/build/tizen
76 autoreconf --install
77 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
78 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
79 %configure --enable-profile=%{dali_toolkit_profile} --with-style=%{dali_style_folder} --enable-i18n=yes
80 make %{?jobs:-j%jobs}
81
82 ##############################
83 # Installation
84 ##############################
85 %install
86 rm -rf %{buildroot}
87 cd build/tizen
88 %make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
89
90 # LICENSE
91 mkdir -p %{buildroot}/usr/share/license
92 cp -af %{_builddir}/%{name}-%{version}/LICENSE %{buildroot}/usr/share/license/%{name}
93
94 ##############################
95 # Post Install
96 ##############################
97 %post
98 /sbin/ldconfig
99 exit 0
100
101 ##############################
102 # Post Uninstall
103 ##############################
104 %postun
105 /sbin/ldconfig
106 exit 0
107
108 ##############################
109 # Files in Binary Packages
110 ##############################
111 %files
112 %if 0%{?enable_dali_smack_rules}
113 %manifest dali-toolkit.manifest-smack
114 %else
115 %manifest dali-toolkit.manifest
116 %endif
117 %defattr(-,root,root,-)
118 %{_libdir}/lib%{name}.so*
119 %{dali_toolkit_image_files}/*
120 %{dali_toolkit_sound_files}/*
121 %{dali_toolkit_style_files}/*
122 %{_datadir}/license/%{name}
123
124 %files devel
125 %defattr(-,root,root,-)
126 %{dev_include_path}/%{name}/*
127 %{_libdir}/pkgconfig/*.pc
128