DALi Version 1.3.51
[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.51
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-adaptor)
23 BuildRequires:  pkgconfig(dali-toolkit)
24
25 #need libtzplatform-config for directory if tizen version is 3.x
26 %if 0%{?tizen_version_major} >= 3
27 BuildRequires:  pkgconfig(libtzplatform-config)
28 %endif
29
30 %description
31 The OpenGLES Canvas Core Demo is a collection of examples and demonstrations
32 of the capability of the toolkit.
33
34 ##############################
35 # Preparation
36 ##############################
37 %prep
38 %setup -q
39
40 #Use TZ_PATH when tizen version is 3.x
41
42 %if "%{tizen_version_major}" == "2"
43 %define dali_app_ro_dir       /usr/apps/com.samsung.dali-demo/
44 %define dali_xml_file_dir     /usr/share/packages/
45 %define dali_icon_dir         /usr/share/icons/
46 %define smack_rule_dir        /etc/smack/accesses2.d/
47 %else
48 %define dali_app_ro_dir       %TZ_SYS_RO_APP/com.samsung.dali-demo/
49 %define dali_xml_file_dir     %TZ_SYS_RO_PACKAGES
50 %define dali_icon_dir         %TZ_SYS_RO_ICONS
51 %define smack_rule_dir        %TZ_SYS_SMACK/accesses2.d/
52 %endif
53
54 %define dali_app_res_dir      %{dali_app_ro_dir}/res/
55 %define dali_app_exe_dir      %{dali_app_ro_dir}/bin/
56 %define locale_dir            %{dali_app_res_dir}/locale
57 %define local_style_dir       ../../resources/style/mobile
58
59 ##############################
60 # Build
61 ##############################
62 %build
63 PREFIX="/usr"
64 CXXFLAGS+=" -Wall -g -O2"
65 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed"
66
67 %ifarch %{arm}
68 CXXFLAGS+=" -D_ARCH_ARM_"
69 %endif
70
71 cd %{_builddir}/%{name}-%{version}/build/tizen
72
73 cmake -DDALI_APP_DIR=%{dali_app_ro_dir} \
74       -DLOCALE_DIR=%{locale_dir} \
75       -DDALI_APP_RES_DIR=%{dali_app_res_dir} \
76 %if 0%{?enable_debug}
77       -DCMAKE_BUILD_TYPE=Debug \
78 %endif
79       -DLOCAL_STYLE_DIR=%{local_style_dir} \
80       -DINTERNATIONALIZATION:BOOL=OFF \
81       .
82
83 make %{?jobs:-j%jobs}
84
85 ##############################
86 # Installation
87 ##############################
88 %install
89 rm -rf %{buildroot}
90 cd build/tizen
91 %make_install DALI_APP_DIR=%{dali_app_ro_dir}
92 %make_install DDALI_APP_RES_DIR=%{dali_app_res_dir}
93
94 mkdir -p %{buildroot}%{dali_xml_file_dir}
95 cp -f %{_builddir}/%{name}-%{version}/%{name}.xml %{buildroot}%{dali_xml_file_dir}
96
97 mkdir -p %{buildroot}%{dali_icon_dir}
98 mv %{buildroot}/%{dali_app_res_dir}/images/%{name}.png %{buildroot}%{dali_icon_dir}
99 mv %{buildroot}/%{dali_app_res_dir}/images/dali-examples.png %{buildroot}%{dali_icon_dir}
100 mv %{buildroot}/%{dali_app_res_dir}/images/dali-tests.png %{buildroot}%{dali_icon_dir}
101
102 %if 0%{?enable_dali_smack_rules} && !%{with wayland}
103 mkdir -p %{buildroot}%{smack_rule_dir}
104 cp -f %{_builddir}/%{name}-%{version}/%{name}.rule %{buildroot}%{smack_rule_dir}
105 %endif
106
107
108 ##############################
109 # Post Install
110 ##############################
111 %post
112 /sbin/ldconfig
113 exit 0
114
115 ##############################
116 # Post Uninstall
117 ##############################
118 %postun
119 /sbin/ldconfig
120 exit 0
121
122 ##############################
123 # Files in Binary Packages
124 ##############################
125
126 %files
127 %if 0%{?enable_dali_smack_rules}
128 %manifest com.samsung.dali-demo.manifest-smack
129 %else
130 %manifest com.samsung.dali-demo.manifest
131 %endif
132 %defattr(-,root,root,-)
133 %{dali_app_exe_dir}/dali-demo
134 %{dali_app_exe_dir}/dali-examples
135 %{dali_app_exe_dir}/dali-tests
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