5c70c8c96149d27179838d657c05daa547d75831
[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.1.48
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 "%{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_exe_dir      %{dali_app_ro_dir}/bin/
57 %define locale_dir            %{dali_app_ro_dir}/res/locale
58 %define local_style_dir       ../../resources/style/mobile
59
60 ##############################
61 # Build
62 ##############################
63 %build
64 PREFIX="/usr"
65 CXXFLAGS+=" -Wall -g -O2"
66 LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed"
67
68 %ifarch %{arm}
69 CXXFLAGS+=" -D_ARCH_ARM_"
70 %endif
71
72 cd %{_builddir}/%{name}-%{version}/build/tizen
73
74 cmake -DDALI_APP_DIR=%{dali_app_ro_dir} \
75       -DLOCALE_DIR=%{locale_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
93 mkdir -p %{buildroot}%{dali_xml_file_dir}
94 cp -f %{_builddir}/%{name}-%{version}/%{name}.xml %{buildroot}%{dali_xml_file_dir}
95
96 mkdir -p %{buildroot}%{dali_icon_dir}
97 mv %{buildroot}/%{dali_app_ro_dir}/images/%{name}.png %{buildroot}%{dali_icon_dir}
98
99 %if 0%{?enable_dali_smack_rules} && !%{with wayland}
100 mkdir -p %{buildroot}%{smack_rule_dir}
101 cp -f %{_builddir}/%{name}-%{version}/%{name}.rule %{buildroot}%{smack_rule_dir}
102 %endif
103
104
105 ##############################
106 # Post Install
107 ##############################
108 %post
109 /sbin/ldconfig
110 exit 0
111
112 ##############################
113 # Post Uninstall
114 ##############################
115 %postun
116 /sbin/ldconfig
117 exit 0
118
119 ##############################
120 # Files in Binary Packages
121 ##############################
122
123 %files
124 %if 0%{?enable_dali_smack_rules}
125 %manifest com.samsung.dali-demo.manifest-smack
126 %else
127 %manifest com.samsung.dali-demo.manifest
128 %endif
129 %defattr(-,root,root,-)
130 %{dali_app_exe_dir}/dali-demo
131 %{dali_app_exe_dir}/*.example
132 %{dali_app_exe_dir}/dali-builder
133 %{dali_app_ro_dir}/images/*
134 %{dali_app_ro_dir}/videos/*
135 %{dali_app_ro_dir}/models/*
136 %{dali_app_ro_dir}/scripts/*
137 %{dali_app_ro_dir}/style/*
138 %{dali_app_ro_dir}/style/images/*
139 %license LICENSE
140 %{dali_xml_file_dir}/%{name}.xml
141 %{dali_icon_dir}/*
142 %{locale_dir}/*
143 %if 0%{?enable_dali_smack_rules} && !%{with wayland}
144 %config %{smack_rule_dir}/%{name}.rule
145 %endif