[Build] Add RIDs of Tizen.6.0.0 and Set RIDs to vconf automatically (#1420)
[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_TOOLS_PATH /usr/share/dotnet.tizen/tools
10 %define DOTNET_NUGET_SOURCE /nuget
11
12 %define TIZEN_NET_RUNTIME_IDENTIFIERS @rid_version@
13
14 Name:       csapi-tizenfx
15 Summary:    Assemblies of Tizen .NET
16 Version:    %{TIZEN_NET_RPM_VERSION}
17 Release:    1
18 Group:      Development/Libraries
19 License:    Apache-2.0 and MIT
20 URL:        https://www.tizen.org
21 Source0:    %{name}-%{version}.tar.gz
22 Source1:    %{name}.manifest
23
24 BuildArch:   noarch
25 ExcludeArch: aarch64
26 AutoReqProv: no
27
28 BuildRequires: dotnet-build-tools
29 Requires(post): /usr/bin/vconftool
30
31 %description
32 %{summary}
33
34 %package nuget
35 Summary:   NuGet package for %{name}
36 Group:     Development/Libraries
37 AutoReqProv: no
38
39 %description nuget
40 NuGet package for %{name}
41
42 %package tools
43 Summary:   Tools for TizenFX
44 Group:     Development/Libraries
45 AutoReqProv: no
46
47 %description tools
48 Tools for TizenFX
49
50 %package dummy
51 Summary:   not used package
52 Group:     Development/Libraries
53 AutoReqProv: no
54
55 %description dummy
56 not used package
57
58 %package full
59 Summary:   All Tizen .NET assemblies
60 Group:     Development/Libraries
61 Requires:  %{name} = %{version}-%{release}
62 AutoReqProv: no
63
64 %description full
65 All Tizen .NET assemblies
66
67 %package debug
68 Summary:   All .pdb files of Tizen .NET
69 Group:     Development/Libraries
70 AutoReqProv: no
71
72 %description debug
73 All .pdb files of Tizen .NET
74
75 %package common
76 Summary:   Tizen .NET assemblies for Common profile
77 Group:     Development/Libraries
78 Requires:  %{name} = %{version}-%{release}
79 AutoReqProv: no
80
81 %description common
82 Tizen .NET assemblies for Common profile
83
84 %package mobile
85 Summary:   Tizen .NET assemblies for Mobile profile
86 Group:     Development/Libraries
87 Requires:  %{name} = %{version}-%{release}
88 AutoReqProv: no
89
90 %description mobile
91 Tizen .NET assemblies for Mobile profile
92
93 %package mobile-emul
94 Summary:   Tizen .NET assemblies for Emulator of Mobile profile
95 Group:     Development/Libraries
96 Requires:  %{name} = %{version}-%{release}
97 AutoReqProv: no
98
99 %description mobile-emul
100 Tizen .NET assemblies for Emulator of Mobile profile
101
102 %package tv
103 Summary:   Tizen .NET assemblies for TV profile
104 Group:     Development/Libraries
105 Requires:  %{name} = %{version}-%{release}
106 AutoReqProv: no
107
108 %description tv
109 Tizen .NET assemblies for TV profile
110
111 %package wearable
112 Summary:   Tizen .NET assemblies for Wearable profile
113 Group:     Development/Libraries
114 Requires:  %{name} = %{version}-%{release}
115 AutoReqProv: no
116
117 %description wearable
118 Tizen .NET assemblies for Wearable profile
119
120 %prep
121 %setup -q
122 cp %{SOURCE1} .
123
124 %build
125 %{?asan:export ASAN_OPTIONS=use_sigaltstack=false:allow_user_segv_handler=true:handle_sigfpe=false:`cat /ASAN_OPTIONS`}
126
127 %define _tizenfx_bin_path Artifacts
128
129 rm -fr %{_tizenfx_bin_path}
130 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
131
132 %define build_cmd ./tools/scripts/retry.sh ./tools/scripts/timeout.sh -t 600 ./build.sh
133 %{build_cmd} --full
134 %{build_cmd} --pack %{TIZEN_NET_NUGET_VERSION}
135
136 GetFileList() {
137   PROFILE=$1
138   cat packaging/PlatformFileList.txt | grep -E "#$PROFILE[[:space:]]|#$PROFILE$" | cut -d# -f1 | sed "s#^#%{DOTNET_ASSEMBLY_PATH}/#"
139   for f in $(cat packaging/PlatformFileList.txt | grep -v -E "#$PROFILE[[:space:]]|#$PROFILE$" | cut -d# -f1); do
140     if [ -f %{_tizenfx_bin_path}/bin/dummy/$f ]; then
141       echo "%{DOTNET_ASSEMBLY_PATH}/ref/$f"
142     fi
143   done
144 }
145
146 GetFileList common > common.filelist
147 GetFileList mobile > mobile.filelist
148 GetFileList mobile-emul > mobile-emul.filelist
149 GetFileList tv > tv.filelist
150 GetFileList wearable > wearable.filelist
151
152 %install
153 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_PATH}
154 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH}
155 mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH}
156 mkdir -p %{buildroot}%{DOTNET_NUGET_SOURCE}
157 mkdir -p %{buildroot}%{DOTNET_TOOLS_PATH}
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 install -p -m 644 packaging/*.nupkg %{buildroot}%{DOTNET_NUGET_SOURCE}
179
180 # Install Tools
181 install -p -m 644 tools/bin/* %{buildroot}%{DOTNET_TOOLS_PATH}
182
183 %post
184 /usr/bin/vconftool set -t int db/dotnet/tizen_api_version %{TIZEN_NET_API_VERSION} -f
185 /usr/bin/vconftool set -t string db/dotnet/tizen_api_path %{DOTNET_ASSEMBLY_PATH} -f
186 /usr/bin/vconftool set -t string db/dotnet/tizen_rid_version %{TIZEN_NET_RUNTIME_IDENTIFIERS} -f
187
188 %files
189 %license LICENSE
190 %license LICENSE.MIT
191
192 %files nuget
193 %{DOTNET_NUGET_SOURCE}/*.nupkg
194
195 %files tools
196 %manifest %{name}.manifest
197 %{DOTNET_TOOLS_PATH}/*
198
199 %files dummy
200
201 %files full
202 %manifest %{name}.manifest
203 %attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.dll
204 %attr(644,root,root) %{DOTNET_ASSEMBLY_DUMMY_PATH}/*.dll
205 %attr(644,root,root) %{DOTNET_ASSEMBLY_RES_PATH}/*
206
207 %files debug
208 %attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.pdb
209
210 %files common -f common.filelist
211 %manifest %{name}.manifest
212
213 %files mobile -f mobile.filelist
214 %manifest %{name}.manifest
215
216 %files mobile-emul -f mobile-emul.filelist
217 %manifest %{name}.manifest
218
219 %files tv -f tv.filelist
220 %manifest %{name}.manifest
221
222 %files wearable -f wearable.filelist
223 %manifest %{name}.manifest