Merge "TextLabel example uses ExpandingButtons" into devel/master
[platform/core/uifw/dali-demo.git] / packaging / com.samsung.dali-demo.spec
1 %bcond_with wayland
2
3 Name:       com.samsung.dali-demo
4 Summary:    The OpenGLES Canvas Core Demo
5 Version:    1.3.6
6 Release:    1
7 Group:      System/Libraries
8 License:    Apache-2.0
9 URL:        https://review.tizen.org/git/?p=platform/core/uifw/dali-demo.git;a=summary
10 Source0:    %{name}-%{version}.tar.gz
11
12 Requires(post): /sbin/ldconfig
13 Requires(postun): /sbin/ldconfig
14
15 BuildRequires:  cmake
16 BuildRequires:  pkgconfig
17 BuildRequires:  pkgconfig(capi-appfw-application)
18 BuildRequires:  pkgconfig(capi-media-player)
19 BuildRequires:  pkgconfig(dlog)
20 BuildRequires:  gettext-tools
21 BuildRequires:  pkgconfig(dali-core)
22 BuildRequires:  pkgconfig(dali-toolkit)
23
24 #need libtzplatform-config for directory if tizen version is 3.x
25 %if 0%{?tizen_version_major} >= 3
26 BuildRequires:  pkgconfig(libtzplatform-config)
27 %endif
28
29 # DALi C++ applications always run on dali-adaptor.
30 BuildRequires:  pkgconfig(dali-adaptor)
31
32 %description
33 The OpenGLES Canvas Core Demo is a collection of examples and demonstrations
34 of the capability of the toolkit.
35
36 ##############################
37 # Preparation
38 ##############################
39 %prep
40 %setup -q
41
42 #Use TZ_PATH when tizen version is 3.x
43
44 %if "%{tizen_version_major}" == "2"
45 %define dali_app_ro_dir       /usr/apps/com.samsung.dali-demo/
46 %define dali_xml_file_dir     /usr/share/packages/
47 %define dali_icon_dir         /usr/share/icons/
48 %define smack_rule_dir        /etc/smack/accesses2.d/
49 %else
50 %define dali_app_ro_dir       %TZ_SYS_RO_APP/com.samsung.dali-demo/
51 %define dali_xml_file_dir     %TZ_SYS_RO_PACKAGES
52 %define dali_icon_dir         %TZ_SYS_RO_ICONS
53 %define smack_rule_dir        %TZ_SYS_SMACK/accesses2.d/
54 %endif
55
56 %define dali_app_res_dir      %{dali_app_ro_dir}/res/
57 %define dali_app_exe_dir      %{dali_app_ro_dir}/bin/
58 %define locale_dir            %{dali_app_res_dir}/locale
59 %define local_style_dir       ../../resources/style/mobile
60
61 ##############################
62 # Build
63 ##############################
64 %build
65 PREFIX="/usr"
66 CXXFLAGS+=" -Wall -g -O2"
67 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed"
68
69 %ifarch %{arm}
70 CXXFLAGS+=" -D_ARCH_ARM_"
71 %endif
72
73 cd %{_builddir}/%{name}-%{version}/build/tizen
74
75 cmake -DDALI_APP_DIR=%{dali_app_ro_dir} \
76       -DLOCALE_DIR=%{locale_dir} \
77       -DDALI_APP_RES_DIR=%{dali_app_res_dir} \
78 %if 0%{?enable_debug}
79       -DCMAKE_BUILD_TYPE=Debug \
80 %endif
81       -DLOCAL_STYLE_DIR=%{local_style_dir} \
82       -DINTERNATIONALIZATION:BOOL=OFF \
83       .
84
85 make %{?jobs:-j%jobs}
86
87 ##############################
88 # Installation
89 ##############################
90 %install
91 rm -rf %{buildroot}
92 cd build/tizen
93 %make_install DALI_APP_DIR=%{dali_app_ro_dir}
94 %make_install DDALI_APP_RES_DIR=%{dali_app_res_dir}
95
96 mkdir -p %{buildroot}%{dali_xml_file_dir}
97 cp -f %{_builddir}/%{name}-%{version}/%{name}.xml %{buildroot}%{dali_xml_file_dir}
98
99 mkdir -p %{buildroot}%{dali_icon_dir}
100 mv %{buildroot}/%{dali_app_res_dir}/images/%{name}.png %{buildroot}%{dali_icon_dir}
101 mv %{buildroot}/%{dali_app_res_dir}/images/dali-examples.png %{buildroot}%{dali_icon_dir}
102
103 %if 0%{?enable_dali_smack_rules} && !%{with wayland}
104 mkdir -p %{buildroot}%{smack_rule_dir}
105 cp -f %{_builddir}/%{name}-%{version}/%{name}.rule %{buildroot}%{smack_rule_dir}
106 %endif
107
108
109 ##############################
110 # Post Install
111 ##############################
112 %post
113 /sbin/ldconfig
114 exit 0
115
116 ##############################
117 # Post Uninstall
118 ##############################
119 %postun
120 /sbin/ldconfig
121 exit 0
122
123 ##############################
124 # Files in Binary Packages
125 ##############################
126
127 %files
128 %if 0%{?enable_dali_smack_rules}
129 %manifest com.samsung.dali-demo.manifest-smack
130 %else
131 %manifest com.samsung.dali-demo.manifest
132 %endif
133 %defattr(-,root,root,-)
134 %{dali_app_exe_dir}/dali-demo
135 %{dali_app_exe_dir}/dali-examples
136 %{dali_app_exe_dir}/*.example
137 %{dali_app_exe_dir}/dali-builder
138 %{dali_app_res_dir}/images/*
139 %{dali_app_res_dir}/game/*
140 %{dali_app_res_dir}/videos/*
141 %{dali_app_res_dir}/models/*
142 %{dali_app_res_dir}/scripts/*
143 %{dali_app_res_dir}/shaders/*
144 %{dali_app_res_dir}/style/*
145 %{dali_app_res_dir}/style/images/*
146 %{dali_xml_file_dir}/%{name}.xml
147 %{dali_icon_dir}/*
148 %{locale_dir}/*
149 %if 0%{?enable_dali_smack_rules} && !%{with wayland}
150 %config %{smack_rule_dir}/%{name}.rule
151 %endif
152 %license LICENSE