[Tizen] Change dependency
[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.30
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
101 %if 0%{?enable_dali_smack_rules} && !%{with wayland}
102 mkdir -p %{buildroot}%{smack_rule_dir}
103 cp -f %{_builddir}/%{name}-%{version}/%{name}.rule %{buildroot}%{smack_rule_dir}
104 %endif
105
106
107 ##############################
108 # Post Install
109 ##############################
110 %post
111 /sbin/ldconfig
112 exit 0
113
114 ##############################
115 # Post Uninstall
116 ##############################
117 %postun
118 /sbin/ldconfig
119 exit 0
120
121 ##############################
122 # Files in Binary Packages
123 ##############################
124
125 %files
126 %if 0%{?enable_dali_smack_rules}
127 %manifest com.samsung.dali-demo.manifest-smack
128 %else
129 %manifest com.samsung.dali-demo.manifest
130 %endif
131 %defattr(-,root,root,-)
132 %{dali_app_exe_dir}/dali-demo
133 %{dali_app_exe_dir}/dali-examples
134 %{dali_app_exe_dir}/*.example
135 %{dali_app_exe_dir}/dali-builder
136 %{dali_app_res_dir}/images/*
137 %{dali_app_res_dir}/game/*
138 %{dali_app_res_dir}/videos/*
139 %{dali_app_res_dir}/models/*
140 %{dali_app_res_dir}/scripts/*
141 %{dali_app_res_dir}/shaders/*
142 %{dali_app_res_dir}/style/*
143 %{dali_app_res_dir}/style/images/*
144 %{dali_xml_file_dir}/%{name}.xml
145 %{dali_icon_dir}/*
146 %{locale_dir}/*
147 %if 0%{?enable_dali_smack_rules} && !%{with wayland}
148 %config %{smack_rule_dir}/%{name}.rule
149 %endif
150 %license LICENSE