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