[Build] Remove retry command from build.sh (#572)
[platform/core/csapi/tizenfx.git] / packaging / csapi-tizenfx.spec.in
1
2 %define TIZEN_NET_API_VERSION @api_version@
3 %define TIZEN_NET_RPM_VERSION @rpm_version@
4 %define TIZEN_NET_NUGET_VERSION @nuget_version@
5
6 %define DOTNET_ASSEMBLY_PATH /usr/share/dotnet.tizen/framework
7 %define DOTNET_ASSEMBLY_DUMMY_PATH %{DOTNET_ASSEMBLY_PATH}/ref
8 %define DOTNET_ASSEMBLY_RES_PATH %{DOTNET_ASSEMBLY_PATH}/res
9 %define DOTNET_NUGET_SOURCE /nuget
10
11 Name:       csapi-tizenfx
12 Summary:    Assemblies of Tizen .NET
13 Version:    %{TIZEN_NET_RPM_VERSION}
14 Release:    1
15 Group:      Development/Libraries
16 License:    Apache-2.0 and MIT
17 URL:        https://www.tizen.org
18 Source0:    %{name}-%{version}.tar.gz
19 Source1:    %{name}.manifest
20
21 BuildArch:   noarch
22 ExcludeArch: aarch64
23 AutoReqProv: no
24
25 BuildRequires: dotnet-build-tools
26 Requires(post): /usr/bin/vconftool
27
28 %description
29 %{summary}
30
31 %package nuget
32 Summary:   NuGet package for %{name}
33 Group:     Development/Libraries
34 AutoReqProv: no
35
36 %description nuget
37 NuGet package for %{name}
38
39 %package dummy
40 Summary:   Dummy assemblies of Tizen .NET
41 Group:     Development/Libraries
42 AutoReqProv: no
43
44 %description dummy
45 Dummy assemblies of Tizen .NET
46
47 %package full
48 Summary:   All Tizen .NET assemblies
49 Group:     Development/Libraries
50 Requires:  %{name} = %{version}-%{release}
51 AutoReqProv: no
52
53 %description full
54 All Tizen .NET assemblies
55
56 %package debug
57 Summary:   All .pdb files of Tizen .NET
58 Group:     Development/Libraries
59 AutoReqProv: no
60
61 %description debug
62 All .pdb files of Tizen .NET
63
64 %package common
65 Summary:   Tizen .NET assemblies for Common profile
66 Group:     Development/Libraries
67 Requires:  %{name} = %{version}-%{release}
68 Requires:  csapi-tizenfx-dummy = %{version}-%{release}
69 AutoReqProv: no
70
71 %description common
72 Tizen .NET assemblies for Common profile
73
74 %package mobile
75 Summary:   Tizen .NET assemblies for Mobile profile
76 Group:     Development/Libraries
77 Requires:  %{name} = %{version}-%{release}
78 Requires:  csapi-tizenfx-dummy = %{version}-%{release}
79 AutoReqProv: no
80
81 %description mobile
82 Tizen .NET assemblies for Mobile profile
83
84 %package mobile-emul
85 Summary:   Tizen .NET assemblies for Emulator of Mobile profile
86 Group:     Development/Libraries
87 Requires:  %{name} = %{version}-%{release}
88 Requires:  csapi-tizenfx-dummy = %{version}-%{release}
89 AutoReqProv: no
90
91 %description mobile-emul
92 Tizen .NET assemblies for Emulator of Mobile profile
93
94 %package tv
95 Summary:   Tizen .NET assemblies for TV profile
96 Group:     Development/Libraries
97 Requires:  %{name} = %{version}-%{release}
98 Requires:  csapi-tizenfx-dummy = %{version}-%{release}
99 AutoReqProv: no
100
101 %description tv
102 Tizen .NET assemblies for TV profile
103
104 %package ivi
105 Summary:   Tizen .NET assemblies for IVI profile
106 Group:     Development/Libraries
107 Requires:  %{name} = %{version}-%{release}
108 Requires:  csapi-tizenfx-dummy = %{version}-%{release}
109 AutoReqProv: no
110
111 %description ivi
112 Tizen .NET assemblies for IVI profile
113
114 %package wearable
115 Summary:   Tizen .NET assemblies for Wearable profile
116 Group:     Development/Libraries
117 Requires:  %{name} = %{version}-%{release}
118 Requires:  csapi-tizenfx-dummy = %{version}-%{release}
119 AutoReqProv: no
120
121 %description wearable
122 Tizen .NET assemblies for Wearable profile
123
124 %prep
125 %setup -q
126 cp %{SOURCE1} .
127
128 %build
129 %{?asan:export ASAN_OPTIONS=use_sigaltstack=false:allow_user_segv_handler=true:handle_sigfpe=false:`cat /ASAN_OPTIONS`}
130
131 %define _tizenfx_bin_path Artifacts
132
133 GetFileList() {
134   PROFILE=$1
135   cat pkg/PlatformFileList.txt | grep -E "#$PROFILE[[:space:]]|#$PROFILE$" | cut -d# -f1 | sed "s#^#%{DOTNET_ASSEMBLY_PATH}/#"
136 }
137
138 GetFileList common > common.filelist
139 GetFileList mobile > mobile.filelist
140 GetFileList mobile-emul > mobile-emul.filelist
141 GetFileList tv > tv.filelist
142 GetFileList ivi > ivi.filelist
143 GetFileList wearable > wearable.filelist
144
145 rm -fr %{_tizenfx_bin_path}
146 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
147
148 %define build_cmd ./tools/scripts/retry.sh ./tools/scripts/timeout.sh -t 600 ./build.sh
149 %{build_cmd} --full
150 %{build_cmd} --dummy
151 %{build_cmd} --pack %{TIZEN_NET_NUGET_VERSION}
152
153 %install
154 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_PATH}
155 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH}
156 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
157 mkdir -p %{buildroot}%{DOTNET_NUGET_SOURCE}
158
159 # Install Runtime Assemblies
160 install -p -m 644 %{_tizenfx_bin_path}/bin/public/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
161 install -p -m 644 %{_tizenfx_bin_path}/bin/internal/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH}
162
163 # Install Debug Symbols
164 install -p -m 644 %{_tizenfx_bin_path}/bin/public/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH}
165 install -p -m 644 %{_tizenfx_bin_path}/bin/internal/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH}
166
167 # Install Resource files
168 [ -d %{_tizenfx_bin_path}/bin/public/res ] \
169   && install -p -m 644 %{_tizenfx_bin_path}/bin/public/res/* %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
170 [ -d %{_tizenfx_bin_path}/bin/internal/res ] \
171   && install -p -m 644 %{_tizenfx_bin_path}/bin/internal/res/* %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
172
173 # Install Dummy Assemblies
174 install -p -m 644 %{_tizenfx_bin_path}/bin/dummy/*.dll %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH}
175
176 # Install NuGet Packages
177 install -p -m 644 %{_tizenfx_bin_path}/*.nupkg %{buildroot}%{DOTNET_NUGET_SOURCE}
178
179 %post
180 /usr/bin/vconftool set -t int db/dotnet/tizen_api_version %{TIZEN_NET_API_VERSION} -f
181
182
183 %files
184 %license LICENSE
185
186 %files nuget
187 %{DOTNET_NUGET_SOURCE}/*.nupkg
188
189 %files dummy
190 %attr(644,root,root) %{DOTNET_ASSEMBLY_DUMMY_PATH}/*.dll
191
192 %files full
193 %manifest %{name}.manifest
194 %attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.dll
195 %attr(644,root,root) %{DOTNET_ASSEMBLY_RES_PATH}/*
196
197 %files debug
198 %attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.pdb
199
200 %files common -f common.filelist
201 %manifest %{name}.manifest
202
203 %files mobile -f mobile.filelist
204 %manifest %{name}.manifest
205
206 %files mobile-emul -f mobile-emul.filelist
207 %manifest %{name}.manifest
208
209 %files tv -f tv.filelist
210 %manifest %{name}.manifest
211
212 %files ivi -f ivi.filelist
213 %manifest %{name}.manifest
214
215 %files wearable -f wearable.filelist
216 %manifest %{name}.manifest