dotnet.spec 17 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Avoid provides/requires from private libraries
%global privlibs             libhostfxr
%global privlibs %{privlibs}|libclrjit
%global privlibs %{privlibs}|libcoreclr
%global privlibs %{privlibs}|libcoreclrtraceptprovider
%global privlibs %{privlibs}|libdbgshim
%global privlibs %{privlibs}|libhostpolicy
%global privlibs %{privlibs}|libmscordaccore
%global privlibs %{privlibs}|libmscordbi
%global privlibs %{privlibs}|libsos
%global privlibs %{privlibs}|libsosplugin
%global __provides_exclude ^(%{privlibs})\\.so
%global __requires_exclude ^(%{privlibs})\\.so

# Filter flags not supported by clang/dotnet:
#  -fcf-protection is not supported by clang
#  -fstack-clash-protection is not supported by clang
#  -specs= is not supported by clang
#  -fpie is added manually instead of via -specs
%global dotnet_cflags %(echo %optflags | sed -e 's/-fcf-protection//' | sed -e 's/-fstack-clash-protection//' | sed -re 's/-specs=[^ ]*//g')
%global dotnet_ldflags %(echo %{__global_ldflags} | sed -re 's/-specs=[^ ]*//g')

%if 0%{?fedora}
%global use_bundled_libunwind 0
%else
%global use_bundled_libunwind 1
%endif

%global simple_name dotnet

31
32
33
%global host_version 2.1.28
%global runtime_version 2.1.28
%global sdk_version 2.1.524
34

35
36
37
38
39
40
Name:                 dotnet
Version:              %{sdk_version}
Release:              1%{?dist}.rocky
Summary:              .NET Core CLI tools and runtime
License:              MIT and ASL 2.0 and BSD
URL:                  https://github.com/dotnet/
41
42
43
44

# The source is generated on a RHEL box via:
# ./build-dotnet-tarball v%%{sdk_version}-SDK

45
46
47
Source0:              dotnet-v%{sdk_version}-SDK.tar.gz
Source1:              check-debug-symbols.py
Source2:              dotnet.sh
48

49
50
Patch10:              corefx-optflags-support.patch
Patch11:              corefx-32956-alpn.patch
51
# This patch is generally applied at tarball-build time, except when we dont build the tarball
52
Patch12:              build-corefx-disable-werror.patch
53

54
55
Patch100:             coreclr-pie.patch
Patch101:             coreclr-libunwind-fno-common.patch
56

57
58
Patch300:             core-setup-4510-commit-id.patch
Patch301:             core-setup-pie.patch
59

60
61
Patch400:             cli-telemetry-optout.patch
Patch401:             core-rocky-rid.patch
62

63
ExclusiveArch:        x86_64
64

65
66
BuildRequires:        clang
BuildRequires:        cmake
67
68
69
# Bootstrap SDK needs OpenSSL 1.0 to run, but we can build and then
# run with either OpenSSL 1.0 or 1.1
%if 0%{?fedora} >= 26 || 0%{?rhel} >= 8
70
BuildRequires:        compat-openssl10
71
%endif
72
73
74
75
76
77
BuildRequires:        git
BuildRequires:        glibc-langpack-en
BuildRequires:        hostname
BuildRequires:        krb5-devel
BuildRequires:        libcurl-devel
BuildRequires:        libicu-devel
78
%if ! %{use_bundled_libunwind}
79
BuildRequires:        libunwind-devel
80
%endif
81
82
83
84
85
86
87
88
BuildRequires:        lldb-devel
BuildRequires:        llvm
BuildRequires:        lttng-ust-devel
BuildRequires:        make
BuildRequires:        openssl-devel
BuildRequires:        python3
BuildRequires:        strace
BuildRequires:        zlib-devel
89

90
Requires:             %{simple_name}-sdk-2.1%{?_isa} >= %{sdk_version}-%{release}
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105

%description
.NET Core is a fast, lightweight and modular platform for creating
cross platform applications that work on Linux, macOS and Windows.

It particularly focuses on creating console applications, web
applications and micro-services.

.NET Core contains a runtime conforming to .NET Standards a set of
framework libraries, an SDK containing compilers and a 'dotnet'
application to drive everything.


%package -n %{simple_name}-host

106
107
Version:              %{host_version}
Summary:              .NET command line launcher
108
109
110
111
112
113
114
115
116
117
118
119
120
121

%description -n %{simple_name}-host
The .NET Core host is a command line program that runs a standalone
.NET core application or launches the SDK.

.NET Core is a fast, lightweight and modular platform for creating
cross platform applications that work on Linux, Mac and Windows.

It particularly focuses on creating console applications, web
applications and micro-services.


%package -n %{simple_name}-host-fxr-2.1

122
123
Version:              %{host_version}
Summary:              .NET Core command line host resolver
124
125
126

# Theoretically any version of the host should work. But lets aim for the one
# provided by this package, or from a newer version of .NET Core
127
Requires:             %{simple_name}-host%{?_isa} >= %{host_version}-%{release}
128
129
130
131
132
133
134
135
136
137
138
139
140

%description -n %{simple_name}-host-fxr-2.1
The .NET Core host resolver contains logic to resolve and select the
right version of the .NET Core SDK or runtime to use.

.NET Core is a fast, lightweight and modular platform for creating
cross platform applications that work on Linux, Mac and Windows.

It particularly focuses on creating console applications, web
applications and micro-services.

%package -n %{simple_name}-runtime-2.1

141
142
Version:              %{runtime_version}
Summary:              NET Core 2.1 runtime
143

144
Requires:             %{simple_name}-host-fxr-2.1%{?_isa} >= %{host_version}-%{release}
145
146

# libicu is dlopen()ed
147
Requires:             libicu
148
149
150
151
152
153
154
155
156
157
158
159
160
161

%description -n %{simple_name}-runtime-2.1
The .NET Core runtime contains everything needed to run .NET Core applications.
It includes a high performance Virtual Machine as well as the framework
libraries used by .NET Core applications.

.NET Core is a fast, lightweight and modular platform for creating
cross platform applications that work on Linux, Mac and Windows.

It particularly focuses on creating console applications, web
applications and micro-services.

%package -n %{simple_name}-sdk-2.1

162
163
Version:              %{sdk_version}
Summary:              .NET Core 2.1 Software Development Kit
164

165
Requires:             %{simple_name}-sdk-2.1.5xx%{?_isa} >= %{sdk_version}-%{release}
166
167
168
169
170
171
172
173
174
175
176
177
178

%description -n %{simple_name}-sdk-2.1
The .NET Core SDK is a collection of command line applications to
create, build, publish and run .NET Core applications.

.NET Core is a fast, lightweight and modular platform for creating
cross platform applications that work on Linux, Mac and Windows.

It particularly focuses on creating console applications, web
applications and micro-services.

%package -n %{simple_name}-sdk-2.1.5xx

179
180
Version:              %{sdk_version}
Summary:              .NET Core 2.1.5xx Software Development Kit
181

182
Requires:             %{simple_name}-runtime-2.1%{?_isa} >= %{runtime_version}-%{release}
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234

%description -n %{simple_name}-sdk-2.1.5xx
The .NET Core SDK is a collection of command line applications to
create, build, publish and run .NET Core applications.

.NET Core is a fast, lightweight and modular platform for creating
cross platform applications that work on Linux, Mac and Windows.

It particularly focuses on creating console applications, web
applications and micro-services.


%prep
%setup -q -n %{simple_name}-v%{sdk_version}-SDK

pushd src/corefx
%patch10 -p1
%patch11 -p1
%patch12 -p1
popd

pushd src/coreclr
%patch100 -p1
%patch101 -p1
popd

pushd src/core-setup
%patch300 -p1
%patch301 -p1
popd

pushd src/cli
%patch400 -p1
popd

# Fix bad hardcoded path in build
sed -i 's|/usr/share/dotnet|%{_libdir}/%{simple_name}|' src/core-setup/src/corehost/common/pal.unix.cpp

# Disable warnings
sed -i 's|skiptests|skiptests ignorewarnings|' repos/coreclr.proj

# If CLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE is missing, add it back
grep CLR_CMAKE_USE_SYSTEM_LIBUNWIND repos/coreclr.proj || \
    sed -i 's|\$(BuildArguments) </BuildArguments>|$(BuildArguments) cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE</BuildArguments>|' repos/coreclr.proj

%if %{use_bundled_libunwind}
# Use bundled libunwind
sed -i 's|-DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE|-DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=FALSE|' repos/coreclr.proj
%endif

cat source-build-info.txt

235
%patch401 -p1
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321

%build
export DOTNET_CLI_TELEMETRY_OPTOUT=1

export LLVM_HOME=/opt/rh/llvm-toolset-6.0/root/usr
export CMAKE_INCLUDE_PATH="/opt/rh/llvm-toolset-6.0/root/usr/include"

export CFLAGS="%{dotnet_cflags}"
export CXXFLAGS="%{dotnet_cflags}"
export LDFLAGS="%{dotnet_ldflags}"

test -f Tools/ilasm/ilasm

Tools/dotnetcli/dotnet --info

VERBOSE=1 ./build.sh \
  /v:n \
  /p:MinimalConsoleLogOutput=false \
  /p:ContinueOnPrebuiltBaselineError=true


%install
install -d -m 0755 %{buildroot}%{_libdir}/%{simple_name}/
ls bin/x64/Release
tar xf bin/x64/Release/dotnet-sdk-%{sdk_version}-*.tar.gz -C %{buildroot}%{_libdir}/%{simple_name}/

# Fix permissions on files
find %{buildroot}%{_libdir}/%{simple_name}/ -type f -name '*.props' -exec chmod -x {} \;
find %{buildroot}%{_libdir}/%{simple_name}/ -type f -name '*.targets' -exec chmod -x {} \;
find %{buildroot}%{_libdir}/%{simple_name}/ -type f -name '*.dll' -exec chmod -x {} \;
find %{buildroot}%{_libdir}/%{simple_name}/ -type f -name '*.pubxml' -exec chmod -x {} \;

# Provided by dotnet-host from another SRPM
# Add ~/.dotnet/tools to $PATH for all users
#install -dm 0755 %%{buildroot}%%{_sysconfdir}/profile.d/
#install %%{SOURCE2} %%{buildroot}%%{_sysconfdir}/profile.d/

# Provided by dotnet-host from another SRPM
#install -dm 755 %%{buildroot}/%%{_datadir}/bash-completion/completions
# dynamic completion needs the file to be named the same as the base command
#install src/cli/scripts/register-completions.bash %%{buildroot}/%%{_datadir}/bash-completion/completions/dotnet

# TODO: the zsh completion script needs to be ported to use #compdef
#install -dm 755 %%{buildroot}/%%{_datadir}/zsh/site-functions
#install src/cli/scripts/register-completions.zsh %%{buildroot}/%%{_datadir}/zsh/site-functions/_dotnet

# Provided by dotnet-host from another SRPM
#install -d -m 0755 %%{buildroot}%%{_bindir}
#ln -s %%{_libdir}/%%{simple_name}/dotnet %%{buildroot}%%{_bindir}/

# Provided by dotnet-host from another SRPM
#install -d -m 0755 %%{buildroot}%%{_mandir}/man1/
#find -iname 'dotnet*.1' -type f -exec cp {} %%{buildroot}%%{_mandir}/man1/ \;

# Check debug symbols in all elf objects. This is not in %%check
# because native binaries are stripped by rpm-build after %%install.
# So we need to do this check earlier.
echo "Testing build results for debug symbols..."
%{SOURCE1} -v %{buildroot}%{_libdir}/%{simple_name}/

# Self-check
%{buildroot}%{_libdir}/%{simple_name}/dotnet --info

# Provided by dotnet-host from another SRPM
rm %{buildroot}%{_libdir}/%{simple_name}/LICENSE.txt
rm %{buildroot}%{_libdir}/%{simple_name}/ThirdPartyNotices.txt
rm %{buildroot}%{_libdir}/%{simple_name}/dotnet


%files -n %{simple_name}-host-fxr-2.1
%dir %{_libdir}/%{simple_name}/host/fxr
%{_libdir}/%{simple_name}/host/fxr/%{host_version}

%files -n %{simple_name}-runtime-2.1
%dir %{_libdir}/%{simple_name}/shared
%dir %{_libdir}/%{simple_name}/shared/Microsoft.NETCore.App
%{_libdir}/%{simple_name}/shared/Microsoft.NETCore.App/%{runtime_version}

%files -n %{simple_name}-sdk-2.1
# empty package useful for dependencies

%files -n %{simple_name}-sdk-2.1.5xx
%dir %{_libdir}/%{simple_name}/sdk
%{_libdir}/%{simple_name}/sdk/%{sdk_version}

%changelog
322
* Fri May 28 2021 Michael L. Young <elgueromexicano@gmail.com> - 2.1.524-1.rocky
323
324
- Add Rocky Runtime ID

325
326
327
328
* Tue Apr 27 2021 Omair Majid <omajid@redhat.com> - 2.1.524-1
- Update to .NET SDK 2.1.524 and Runtime 2.1.28
- Resolves: RHBZ#1953766

Rocky Automation's avatar
Rocky Automation committed
329
330
331
332
333
* Thu Apr 08 2021 Omair Majid <omajid@redhat.com> - 2.1.523-1
- Update to .NET Core SDK 2.1.523 and Runtime 2.1.27
- Resolves: RHBZ#1947454

* Tue Mar 09 2021 Omair Majid <omajid@redhat.com> - 2.1.522-2
334
- Update to .NET Core SDK 2.1.522 and Runtime 2.1.26
Rocky Automation's avatar
Rocky Automation committed
335
- Resolves: RHBZ#1933334
336

Rocky Automation's avatar
Rocky Automation committed
337
* Wed Feb 10 2021 Omair Majid <omajid@redhat.com> - 2.1.521-2
338
- Update to .NET Core SDK 2.1.521 and Runtime 2.1.25
Rocky Automation's avatar
Rocky Automation committed
339
- Resolves: RHBZ#1921939
340

Rocky Automation's avatar
Rocky Automation committed
341
* Tue Jan 12 14:41:40 EST 2021 Omair Majid <omajid@redhat.com> - 2.1.520-1
342
- Update to .NET Core SDK 2.1.520 and Runtime 2.1.24
Rocky Automation's avatar
Rocky Automation committed
343
344
345
346
347
- Resolves: RHBZ#1905575

* Tue Oct 06 2020 Omair Majid <omajid@redhat.com> - 2.1.519-2
- Bump release
- Resolves: RHBZ#1884080
348
349
350

* Thu Oct 01 2020 Omair Majid <omajid@redhat.com> - 2.1.519-1
- Update to .NET Core SDK 2.1.519 and Runtime 2.1.23
Rocky Automation's avatar
Rocky Automation committed
351
352
- Drop patches merged upstream
- Resolves: RHBZ#1884080
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511

* Fri Sep 04 2020 Omair Majid <omajid@redhat.com> - 2.1.518-1
- Update to .NET Core SDK 2.1.518 and Runtime 2.1.22
- Resolves: RHBZ#1874064

* Mon Aug 17 2020 Omair Majid <omajid@redhat.com> - 2.1.517-1
- Update to .NET Core SDK 2.1.517 and Runtime 2.1.21
- Resolves: RHBZ#1866119

* Fri Jul 17 2020 Omair Majid <omajid@redhat.com> - 2.1.516-1
- Update to .NET Core SDK 2.1.516 and Runtime 2.1.20
- Resolves: RHBZ#1851971
- Resolves: RHBZ#1856937

* Thu Jun 11 2020 Omair Majid <omajid@redhat.com> - 2.1.515-2
- Update to .NET Core SDK 2.1.515 and Runtime 2.1.19
- Resolves: RHBZ#1843672

* Mon Jun 01 2020 Omair Majid <omajid@redhat.com> - 2.1.514-3
- Update to .NET Core SDK 2.1.514 and Runtime 2.1.18
- Resolves: RHBZ#1828392

* Mon Mar 23 2020 Omair Majid <omajid@redhat.com> - 2.1.513-2
- Update to .NET Core SDK 2.1.513 and Runtime 2.1.17
- Resolves: RHBZ#1815640

* Sat Mar 07 2020 Omair Majid <omajid@redhat.com> - 2.1.512-1
- Update to .NET Core Runtime 2.1.16 and SDK 2.1.512
- Resolves: RHBZ#1799068

* Fri Jan 17 2020 Omair Majid <omajid@redhat.com> - 2.1.511-2
- Update to .NET Core Runtime 2.1.15 and SDK 2.1.511
- Resolves: RHBZ#1786190

* Thu Aug 29 2019 Omair Majid <omajid@redhat.com> - 2.1.509-2
- Update to .NET Core Runtime 2.1.13 and SDK 2.1.509
- Resolves: RHBZ#1742959

* Thu Aug 15 2019 Omair Majid <omajid@redhat.com> - 2.1.508-3
- Remove dotnet and dotnet host packages
- Resolves: RHBZ#1740879

* Tue Aug 13 2019 Omair Majid <omajid@redhat.com> - 2.1.508-2
- Bump release
- Resolves: RHBZ#1740308

* Thu Jul 11 2019 Omair Majid <omajid@redhat.com> - 2.1.508-1
- Update to .NET Core Runtime 2.1.12 and SDK 2.1.508
- Resolves: RHBZ#1728823

* Wed Jun 12 2019 Omair Majid <omajid@redhat.com> - 2.1.507-4
- Bump version
- Related: RHBZ#1712158

* Mon May 20 2019 Omair Majid <omajid@redhat.com> - 2.1.507-2
- Link against strerror_r correctly
- Resolves: RHBZ#1712158

* Thu May 02 2019 Omair Majid <omajid@redhat.com> - 2.1.507-1
- Update to .NET Core Runtime 2.1.11 and SDK 2.1.507
- Resolves: RHBZ#1705284

* Wed Apr 17 2019 Omair Majid <omajid@redhat.com> - 2.1.506-2
- Switch away from SCL dependencies for clang/llvm/lldb
- Resolves: RHBZ#1700908

* Tue Apr 09 2019 Omair Majid <omajid@redhat.com> - 2.1.506-1
- Update to .NET Core Runtime 2.1.10 and SDK 2.1.506
- Resolves: RHBZ#1696371

* Fri Feb 22 2019 Omair Majid <omajid@redhat.com> - 2.1.504-1
- Update to .NET Core Runtime 2.1.8 and SDK 2.1.504
- Sync with Fedora copr spec file
- Resolves: RHBZ#1646713

* Fri Oct 12 2018 Omair Majid <omajid@redhat.com> - 2.1.403-4
- Disable telemetry via code, not just environment variable
- Resolves: rhbz#1638093

* Thu Oct 11 2018 Omair Majid <omajid@redhat.com> - 2.1.403-3
- Disable telemetry by default
- Resolves: rhbz#1638093

* Wed Oct 10 2018 Omair Majid <omajid@redhat.com> - 2.1.403-2
- Target the latest ASP.NET Core version instead of 2.1.1
- Resolves: rhbz#1636585

* Thu Oct 04 2018 Omair Majid <omajid@redhat.com> - 2.1.403-1
- Update to .NET Core Runtime 2.1.5 and SDK 2.1.403
- Resolves: rhbz#1634182

* Mon Oct 01 2018 Omair Majid <omajid@redhat.com> - 2.1.402-5
- Backport fix to correct order of SSL_CERT_FILE and SSL_CERT_DIR lookup
- Resolves: rhbz#1633742

* Thu Sep 27 2018 Omair Majid <omajid@redhat.com> - 2.1.402-4
- Add ~/.dotnet/tools to $PATH to make it easier to use dotnet tools
- Resolves: rhbz#1630439

* Tue Sep 25 2018 Omair Majid <omajid@redhat.com> - 2.1.402-3
- Update .NET Core Runtime 2.1.4 and SDK 2.1.402
- Resolves: rhbz#1628997

* Tue Sep 11 2018 Omair Majid <omajid@redhat.com> - 2.1.401-3
- Use standard flags to build .NET Core
- Resolves: rhbz#1624105

* Tue Sep 11 2018 Omair Majid <omajid@redhat.com> - 2.1.401-2
- Bundle libunwind
- Resolves: rhbz#1626285

* Fri Aug 17 2018 Omair Majid <omajid@redhat.com> - 2.1.401-1
- Update .NET Core Runtime 2.1.3 and SDK 2.1.401
- Drop upstreamed patches

* Mon Aug 06 2018 Omair Majid <omajid@redhat.com> - 2.1.302-1
- Initial build.
- Un-SCLized the package.

* Wed Jul 4 2018 Omair Majid <omajid@redhat.com> - 2.1.302-1
- Update to .NET Core Runtime 2.1.2 and SDK 2.1.302

* Wed Jun 20 2018 Omair Majid <omajid@redhat.com> - 2.1.301-5
- Add sdk-2.1.3xx subpackage

* Tue Jun 19 2018 Omair Majid <omajid@redhat.com> - 2.1.301-4
- Rebuild to pick up new lttng-ust

* Tue Jun 19 2018 Omair Majid <omajid@redhat.com> - 2.1.301-3
- Add workaround for unreadable system certificates
- Resolves: rhbz#1588099

* Tue Jun 19 2018 Omair Majid <omajid@redhat.com> - 2.1.301-2
- Add updated man pages
- Resolves: rhbz#1584790

* Thu Jun 14 2018 Omair Majid <omajid@redhat.com> - 2.1.301-1
- Update to .NET Core SDK 2.1.301

* Wed May 30 2018 Omair Majid <omajid@redhat.com> - 2.1.300-7
- Explicitly require a modified libcurl

* Tue May 29 2018 Omair Majid <omajid@redhat.com> - 2.1.300-6
- Install bash completions in %%{_root_datadir}

* Mon May 28 2018 Omair Majid <omajid@redhat.com> - 2.1.300-5
- Add provides for dotnet-sdk-2.1.3xx

* Mon May 28 2018 Omair Majid <omajid@redhat.com> - 2.1.300-4
- Remove patch for ASP.NET Core templates. No longer needed for 2.1.

* Fri May 25 2018 Omair Majid <omajid@redhat.com> - 2.1.300-3
- Remove net46 symlink

* Thu May 24 2018 Omair Majid <omajid@redhat.com> - 2.1.300-2
- Rebuild to pick up updated dependencies

* Thu May 24 2018 Omair Majid <omajid@redhat.com> - 2.1.300-1
- New package. Import from Fedora (DotNet SIG package).