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