Blame SPECS/dotnet.spec

beadc4
# Do *NOT* try and build this locally (using rhpkg or any other tool) if one of
beadc4
# the parent directories is a git repository. This build uses git-apply during
beadc4
# the upstream build process. git-apply will simply skip all patches since none
beadc4
# of the patches affect the build subdirectory.
beadc4
#
beadc4
# Use `rhpkg local --builddir ../dotnet-build` or something similar to work
beadc4
# around this.
beadc4
6b77c8
%{?scl:%scl_package dotnet}
6b77c8
%{!?scl:%global pkg_name %{name}}
6b77c8
6b77c8
# lldb doesn't like our nice debug information
6b77c8
%undefine _include_minidebuginfo
6b77c8
%global _find_debuginfo_dwz_opts %{nil}
6b77c8
6b77c8
# Avoid provides/requires from private libraries
6b77c8
%global privlibs             libhostfxr
6b77c8
%global privlibs %{privlibs}|libclrjit
6b77c8
%global privlibs %{privlibs}|libcoreclr
6b77c8
%global privlibs %{privlibs}|libcoreclrtraceptprovider
6b77c8
%global privlibs %{privlibs}|libdbgshim
6b77c8
%global privlibs %{privlibs}|libhostpolicy
6b77c8
%global privlibs %{privlibs}|libmscordaccore
6b77c8
%global privlibs %{privlibs}|libmscordbi
6b77c8
%global privlibs %{privlibs}|libsos
6b77c8
%global privlibs %{privlibs}|libsosplugin
6b77c8
%global __provides_exclude ^(%{privlibs})\\.so
6b77c8
6b77c8
# Remove private libraries and the automatically generated dependency
6b77c8
# on system libcurl package. We require the %%{?scl_prefix}libcurl package
6b77c8
%global __requires_exclude ^(%{privlibs}|libcurl)\\.so
6b77c8
022899
%global runtime_version 2.1.18
022899
%global sdk_version 2.1.514
6b77c8
6b77c8
Name:           %{?scl_prefix}dotnet
6b77c8
Version:        %{sdk_version}
022899
Release:        2%{?dist}
6b77c8
Group:          Development/Languages
6b77c8
Summary:        .NET Core CLI tools and runtime
6b77c8
License:        MIT and ASL 2.0 and BSD
6b77c8
URL:            https://github.com/dotnet/
6b77c8
6b77c8
# The source is generated on a RHEL box via:
a7243c
# ./build-dotnet-tarball v%%{sdk_version}
ed07d0
0d9a87
Source0:        dotnet-v%{sdk_version}-SDK.tar.gz
6b77c8
Source1:        check-debug-symbols.py
aeda09
Source2:        https://raw.githubusercontent.com/dotnet/cli/53f485c23cc467c62f80252696b8ec51ce8b4564/scripts/register-completions.bash
6b77c8
6a5430
Patch100:       corefx-32956-alpn.patch
6a5430
6a5430
Patch300:       core-setup-4510-commit-id.patch
62dc5f
6b77c8
ExclusiveArch:  x86_64
6b77c8
6b77c8
BuildRequires:  llvm-toolset-7-clang
6b77c8
BuildRequires:  cmake
ed07d0
BuildRequires:  git
6b77c8
BuildRequires:  hostname
6b77c8
BuildRequires:  krb5-devel
6b77c8
BuildRequires:  %{?scl_prefix}libcurl-devel
6b77c8
BuildRequires:  libicu-devel
6b77c8
BuildRequires:  libunwind-devel
6b77c8
BuildRequires:  llvm-toolset-7-lldb-devel
6b77c8
BuildRequires:  llvm-toolset-7-llvm
6b77c8
BuildRequires:  %{?scl_prefix}lttng-ust-devel
6b77c8
BuildRequires:  openssl-devel
6b77c8
BuildRequires:  python2
6b77c8
BuildRequires:  zlib-devel
6b77c8
6b77c8
Requires:       %{name}-sdk-2.1%{?_isa}
6b77c8
6b77c8
%description
6b77c8
.NET Core is a fast, lightweight and modular platform for creating
6b77c8
cross platform applications that work on Linux, macOS and Windows.
6b77c8
6b77c8
It particularly focuses on creating console applications, web
6b77c8
applications and micro-services.
6b77c8
6b77c8
.NET Core contains a runtime conforming to .NET Standards a set of
6b77c8
framework libraries, an SDK containing compilers and a 'dotnet'
6b77c8
application to drive everything.
6b77c8
6b77c8
%package host
6b77c8
ed07d0
Version:        %{runtime_version}
6b77c8
Summary:        .NET command line launcher
6b77c8
6b77c8
%description host
6b77c8
The .NET Core host is a command line program that runs a standalone
6b77c8
.NET core application or launches the SDK.
6b77c8
6b77c8
.NET Core is a fast, lightweight and modular platform for creating
6b77c8
cross platform applications that work on Linux, Mac and Windows.
6b77c8
6b77c8
It particularly focuses on creating console applications, web
6b77c8
applications and micro-services.
6b77c8
6b77c8
%package runtime-2.1
6b77c8
ed07d0
Version:        %{runtime_version}
ed07d0
Summary:        NET Core 2.1 runtime
ed07d0
6b77c8
# Theoretically any version of the host should work
ed07d0
Requires:       %{name}-host%{?_isa}
6b77c8
6b77c8
# libicu is dlopen()ed
6b77c8
Requires:       libicu
6b77c8
# libcurl is dlopen()ed
6b77c8
Requires:       %{?scl_prefix}libcurl
6b77c8
6b77c8
%description runtime-2.1
6b77c8
The .NET Core runtime contains everything needed to run .NET Core applications.
6b77c8
It includes a high performance Virtual Machine as well as the framework
6b77c8
libraries used by .NET Core applications.
6b77c8
6b77c8
.NET Core is a fast, lightweight and modular platform for creating
6b77c8
cross platform applications that work on Linux, Mac and Windows.
6b77c8
6b77c8
It particularly focuses on creating console applications, web
6b77c8
applications and micro-services.
6b77c8
6b77c8
%package sdk-2.1
6b77c8
6b77c8
Version:        %{sdk_version}
6b77c8
Summary:        .NET Core 2.1 Software Development Kit
6b77c8
62dc5f
Requires:       %{name}-sdk-2.1.5xx%{?_isa}
ed07d0
ed07d0
%description sdk-2.1
ed07d0
The .NET Core SDK is a collection of command line applications to
ed07d0
create, build, publish and run .NET Core applications.
ed07d0
ed07d0
.NET Core is a fast, lightweight and modular platform for creating
ed07d0
cross platform applications that work on Linux, Mac and Windows.
ed07d0
ed07d0
It particularly focuses on creating console applications, web
ed07d0
applications and micro-services.
ed07d0
62dc5f
%package sdk-2.1.5xx
ed07d0
ed07d0
Version:        %{sdk_version}
62dc5f
Summary:        .NET Core 2.1.5xx Software Development Kit
6b77c8
6b77c8
Requires:       %{name}-runtime-2.1%{?_isa}
6b77c8
62dc5f
%description sdk-2.1.5xx
6b77c8
The .NET Core SDK is a collection of command line applications to
6b77c8
create, build, publish and run .NET Core applications.
6b77c8
6b77c8
.NET Core is a fast, lightweight and modular platform for creating
6b77c8
cross platform applications that work on Linux, Mac and Windows.
6b77c8
6b77c8
It particularly focuses on creating console applications, web
6b77c8
applications and micro-services.
6b77c8
6b77c8
%prep
0d9a87
%setup -q -n %{pkg_name}-v%{sdk_version}-SDK
6b77c8
8e2aee
# See https://github.com/dotnet/source-build/pull/669
8e2aee
rm -rf Tools/configuration/configuration.props
8e2aee
6b77c8
# Disable warnings
6b77c8
sed -i 's|skiptests|skiptests ignorewarnings|' repos/coreclr.proj
6b77c8
6b77c8
# Fix bad hardcoded path in build
6b77c8
sed -i 's|/usr/share/dotnet|%{_libdir}/%{pkg_name}|' src/core-setup/src/corehost/common/pal.unix.cpp
6b77c8
62dc5f
pushd src/corefx
62dc5f
%patch100 -p1
62dc5f
popd
62dc5f
62dc5f
pushd src/core-setup
62dc5f
%patch300 -p1
62dc5f
popd
62dc5f
6b77c8
%build
6b77c8
%{?scl:scl enable %scl llvm-toolset-7 - << \EOF}
6b77c8
set -xe
6b77c8
6b77c8
export LIBRARY_PATH="%{_libdir}"
6b77c8
export LLVM_HOME=/opt/rh/llvm-toolset-7/root/usr 
6b77c8
export CMAKE_PREFIX_PATH="%{_prefix}"
6b77c8
4ba3cf
VERBOSE=1 ./build.sh \
4ba3cf
  /v:diag \
4ba3cf
  /p:MinimalConsoleLogOutput=false \
4ba3cf
  /p:ContinueOnPrebuiltBaselineError=true
6b77c8
6b77c8
%{?scl:EOF}
6b77c8
6b77c8
%install
6b77c8
install -d -m 0755 %{buildroot}%{_libdir}/%{pkg_name}/
6b77c8
ls bin/x64/Release
6b77c8
tar xf bin/x64/Release/dotnet-sdk-%{sdk_version}-*.tar.gz -C %{buildroot}%{_libdir}/%{pkg_name}/
6b77c8
6b77c8
# Fix permissions on files
6b77c8
find %{buildroot}%{_libdir}/%{pkg_name}/ -type f -name '*.props' -exec chmod -x {} \;
6b77c8
find %{buildroot}%{_libdir}/%{pkg_name}/ -type f -name '*.targets' -exec chmod -x {} \;
6b77c8
find %{buildroot}%{_libdir}/%{pkg_name}/ -type f -name '*.dll' -exec chmod -x {} \;
6b77c8
find %{buildroot}%{_libdir}/%{pkg_name}/ -type f -name '*.pubxml' -exec chmod -x {} \;
6b77c8
6b77c8
install -dm 755 %{buildroot}/%{_root_datadir}/bash-completion/completions
6b77c8
# dynamic completion needs the file to be named the same as the base command
aeda09
install %{SOURCE2} %{buildroot}/%{_root_datadir}/bash-completion/completions/dotnet
6b77c8
6b77c8
# TODO: the zsh completion script needs to be ported to use #compdef
6b77c8
#install -dm 755 %%{buildroot}/%%{_datadir}/zsh/site-functions
6b77c8
#install src/cli/scripts/register-completions.zsh %%{buildroot}/%%{_datadir}/zsh/site-functions/_dotnet
6b77c8
6b77c8
install -d -m 0755 %{buildroot}%{_bindir}
6b77c8
ln -s %{_libdir}/%{pkg_name}/dotnet %{buildroot}%{_bindir}/
6b77c8
6b77c8
install -d -m 0755 %{buildroot}%{_mandir}/man1/
6b77c8
find -iname 'dotnet*.1' -type f -exec cp {} %{buildroot}%{_mandir}/man1/ \;
6b77c8
6b77c8
# Check debug symbols in all elf objects. This is not in %%check
6b77c8
# because native binaries are stripped by rpm-build after %%install.
6b77c8
# So we need to do this check earlier.
6b77c8
echo "Testing build results for debug symbols..."
6b77c8
%{SOURCE1} -v %{buildroot}%{_libdir}/%{pkg_name}/
6b77c8
6b77c8
%check
6b77c8
%{buildroot}%{_libdir}/%{pkg_name}/dotnet --info
6b77c8
6b77c8
%files
6b77c8
# empty package useful for dependencies
6b77c8
6b77c8
%files host
6b77c8
%dir %{_libdir}/%{pkg_name}
6b77c8
%{_libdir}/%{pkg_name}/dotnet
6b77c8
%{_libdir}/%{pkg_name}/host
6b77c8
%{_bindir}/dotnet
6b77c8
%doc %{_libdir}/%{pkg_name}/LICENSE.txt
6b77c8
%doc %{_libdir}/%{pkg_name}/ThirdPartyNotices.txt
ed07d0
%doc %{_mandir}/man1/dotnet*.1.gz
ed07d0
# shell completions are currently only picked up from %%{_root_datadir}
ed07d0
%dir %{_root_datadir}/bash-completion
ed07d0
%dir %{_root_datadir}/bash-completion/completions
ed07d0
%{_root_datadir}/bash-completion/completions/dotnet
6b77c8
6b77c8
%files runtime-2.1
6b77c8
%dir %{_libdir}/%{pkg_name}/shared
6b77c8
%dir %{_libdir}/%{pkg_name}/shared/Microsoft.NETCore.App
6b77c8
%{_libdir}/%{pkg_name}/shared/Microsoft.NETCore.App/%{runtime_version}
6b77c8
6b77c8
%files sdk-2.1
ed07d0
# empty package useful for dependencies
ed07d0
62dc5f
%files sdk-2.1.5xx
6b77c8
%dir %{_libdir}/%{pkg_name}/sdk
6b77c8
%{_libdir}/%{pkg_name}/sdk/%{sdk_version}
6b77c8
6b77c8
%changelog
022899
* Wed May 06 2020 Omair Majid <omajid@redhat.com> - 2.1.514-2
022899
- Update to new release tarball
022899
- Resolves: RHBZ#1828391
022899
022899
* Mon Apr 27 2020 Omair Majid <omajid@redhat.com> - 2.1.514-1
022899
- Update to .NET Core SDK 2.1.514 and Runtime 2.1.18
022899
- Resolves: RHBZ#1828391
022899
022899
* Tue Mar 24 2020 Omair Majid <omajid@redhat.com> - 2.1.513-1
512839
- Update to .NET Core SDK 2.1.513 and Runtime 2.1.17
512839
- Resolves: RHBZ#1815639
512839
0d9a87
* Tue Mar 10 2020 Omair Majid <omajid@redhat.com> - 2.1.512-1
0d9a87
- Update to .NET Core SDK 2.1.512 and Runtime 2.1.16
0d9a87
- Resolves: RHBZ#1799067
0d9a87
a7243c
* Mon Dec 23 2019 Omair Majid <omajid@redhat.com> - 2.1.511-1
a7243c
- Update to .NET Core Runtime 2.1.15 and SDK 2.1.511
a7243c
- Resolves: RHBZ#1786178
a7243c
3db37c
* Thu Nov 07 2019 Radka Janekova <rjanekov@redhat.com> - 2.1.510-2
3db37c
- Update to rebuild .NET Core Runtime 2.1.14 and SDK 2.1.510
3db37c
- Resolves: RHBZ#1767628
3db37c
3db37c
* Thu Oct 31 2019 Omair Majid <omajid@redhat.com> - 2.1.510-1
3db37c
- Update to .NET Core Runtime 2.1.14 and SDK 2.1.510
3db37c
- Resolves: RHBZ#1767628
3db37c
80759a
* Thu Aug 29 2019 Omair Majid <omajid@redhat.com> - 2.1.509-1
80759a
- Update to .NET Core Runtime 2.1.13 and SDK 2.1.509
80759a
- Resolves: RHBZ#1743290
80759a
058c71
* Wed Jul 10 2019 Omair Majid <omajid@redhat.com> - 2.1.508-1
058c71
- Update to .NET Core Runtime 2.1.12 and SDK 2.1.508
058c71
- Resolves: RHBZ#1728839
058c71
aeda09
* Wed May 01 2019 Omair Majid <omajid@redhat.com> - 2.1.507-2
aeda09
- Use the latest upstream completion file for bash completion
aeda09
- Resolves: RHBZ#1705259
aeda09
aeda09
* Wed May 01 2019 Omair Majid <omajid@redhat.com> - 2.1.507-1
aeda09
- Update to .NET Core Runtime 2.1.11 and SDK 2.1.507
aeda09
- Resolves: RHBZ#1705147
aeda09
d3d407
* Tue Apr 02 2019 Omair Majid <omajid@redhat.com> - 2.1.506-1
d3d407
- Update to .NET Core Runtime 2.1.10 and SDK 2.1.506
d3d407
798db1
* Wed Mar 06 2019 Omair Majid <omajid@redhat.com> - 2.1.505-1
798db1
- Update to .NET Core Runtime 2.1.9 and SDK 2.1.505
798db1
- Resolves: RHBZ#1685720
798db1
798db1
* Tue Jan 29 2019 Omair Majid <omajid@redhat.com> - 2.1.504-1
798db1
- Update to .NET Core Runtime 2.1.8 and SDK 2.1.504
798db1
- Resolves: RHBZ#1670648
798db1
ae1e3a
* Thu Dec 13 2018 Omair Majid <omajid@redhat.com> - 2.1.503-1
ae1e3a
- Update to .NET Core Runtime 2.1.7 and SDK 2.1.503
ae1e3a
- Resolves: RHBZ#1659216
ae1e3a
6a5430
* Wed Nov 14 2018 Omair Majid <omajid@redhat.com> - 2.1.500-5
6a5430
- Fix extract out of directory
6a5430
- Resolves: CVE-2018-8416
6a5430
- Resolves: rhbz#1649693
6a5430
62dc5f
* Fri Nov 09 2018 Omair Majid <omajid@redhat.com> - 2.1.500-3
62dc5f
- Fix linking alpn support by linking to OpenSSL correctly
62dc5f
- Fix commit ids in dotnet --info
62dc5f
- Resolves: rhbz#1643978
62dc5f
- Resolves: rhbz#1648425
62dc5f
62dc5f
* Thu Nov 08 2018 Omair Majid <omajid@redhat.com> - 2.1.500-2
62dc5f
- Update to rebuild of .NET Core Runtime 2.1.5 and SDK 2.1.500
62dc5f
- Resolves: rhbz#1646697
62dc5f
62dc5f
* Mon Nov 05 2018 Omair Majid <omajid@redhat.com> - 2.1.500-1
62dc5f
- Update to .NET Core Runtime 2.1.5 and SDK 2.1.500
62dc5f
- Resolves: rhbz#1646697
62dc5f
4ba3cf
* Mon Oct 01 2018 Omair Majid <omajid@redhat.com> - 2.1.403-1
4ba3cf
- Update to .NET Core Runtime 2.1.5 and SDK 2.1.403
4ba3cf
- Resolves: rhbz#1634169
4ba3cf
9fb373
* Fri Sep 07 2018 Omair Majid <omajid@redhat.com> - 2.1.402-2
9fb373
- Update to new build of .NET Core Runtime 2.1.4 and SDK 2.1.402
9fb373
- Resolves: RHBZ#1625403
9fb373
9fb373
* Tue Sep 04 2018 Omair Majid <omajid@redhat.com> - 2.1.402-1
9fb373
- Update to .NET Core Runtime 2.1.4 and SDK 2.1.402
9fb373
- Fix OOM error in containers
9fb373
- Resolves: RHBZ#1621889
9fb373
8e2aee
* Wed Aug 08 2018 Omair Majid <omajid@redhat.com> - 2.1.401-1
8e2aee
- Update to .NET Core Runtime 2.1.3 and SDK 2.1.401
8e2aee
beadc4
* Wed Jul 4 2018 Omair Majid <omajid@redhat.com> - 2.1.302-1
beadc4
- Update to .NET Core Runtime 2.1.2 and SDK 2.1.302
beadc4
ed07d0
* Wed Jun 20 2018 Omair Majid <omajid@redhat.com> - 2.1.301-5
ed07d0
- Add sdk-2.1.3xx subpackage
ed07d0
ed07d0
* Tue Jun 19 2018 Omair Majid <omajid@redhat.com> - 2.1.301-4
ed07d0
- Rebuild to pick up new lttng-ust
ed07d0
ed07d0
* Tue Jun 19 2018 Omair Majid <omajid@redhat.com> - 2.1.301-3
ed07d0
- Add workaround for unreadable system certificates
ed07d0
- Resolves: rhbz#1588099
ed07d0
ed07d0
* Tue Jun 19 2018 Omair Majid <omajid@redhat.com> - 2.1.301-2
ed07d0
- Add updated man pages
ed07d0
- Resolves: rhbz#1584790
ed07d0
ed07d0
* Thu Jun 14 2018 Omair Majid <omajid@redhat.com> - 2.1.301-1
ed07d0
- Update to .NET Core SDK 2.1.301
ed07d0
6b77c8
* Wed May 30 2018 Omair Majid <omajid@redhat.com> - 2.1.300-7
6b77c8
- Explicitly require a modified libcurl
6b77c8
6b77c8
* Tue May 29 2018 Omair Majid <omajid@redhat.com> - 2.1.300-6
6b77c8
- Install bash completions in %%{_root_datadir}
6b77c8
6b77c8
* Mon May 28 2018 Omair Majid <omajid@redhat.com> - 2.1.300-5
6b77c8
- Add provides for dotnet-sdk-2.1.3xx
6b77c8
6b77c8
* Mon May 28 2018 Omair Majid <omajid@redhat.com> - 2.1.300-4
6b77c8
- Remove patch for ASP.NET Core templates. No longer needed for 2.1.
6b77c8
6b77c8
* Fri May 25 2018 Omair Majid <omajid@redhat.com> - 2.1.300-3
6b77c8
- Remove net46 symlink
6b77c8
6b77c8
* Thu May 24 2018 Omair Majid <omajid@redhat.com> - 2.1.300-2
6b77c8
- Rebuild to pick up updated dependencies
6b77c8
6b77c8
* Thu May 24 2018 Omair Majid <omajid@redhat.com> - 2.1.300-1
6b77c8
- New package. Import from Fedora (DotNet SIG package).