Blame SPECS/dotnet.spec

133fb8
%{?scl:%scl_package dotnet}
133fb8
%{!?scl:%global pkg_name %{name}}
133fb8
133fb8
# lldb doesn't like our nice debug information
133fb8
%undefine _include_minidebuginfo
133fb8
%global _find_debuginfo_dwz_opts %{nil}
133fb8
133fb8
# Avoid provides/requires from private libraries
133fb8
%global privlibs             libhostfxr
133fb8
%global privlibs %{privlibs}|libclrjit
133fb8
%global privlibs %{privlibs}|libcoreclr
133fb8
%global privlibs %{privlibs}|libcoreclrtraceptprovider
133fb8
%global privlibs %{privlibs}|libdbgshim
133fb8
%global privlibs %{privlibs}|libhostpolicy
133fb8
%global privlibs %{privlibs}|libmscordaccore
133fb8
%global privlibs %{privlibs}|libmscordbi
133fb8
%global privlibs %{privlibs}|libsos
133fb8
%global privlibs %{privlibs}|libsosplugin
133fb8
%global __provides_exclude ^(%{privlibs})\\.so
133fb8
133fb8
# Remove private libraries and the automatically generated dependency
133fb8
# on system libcurl package. We require the %%{?scl_prefix}libcurl package
133fb8
%global __requires_exclude ^(%{privlibs}|libcurl)\\.so
133fb8
133fb8
# Filter flags not supported by clang/dotnet:
133fb8
#  -fcf-protection is not supported by clang
133fb8
#  -specs= is not supported by clang
133fb8
%global dotnet_cflags %(echo %optflags | sed -e 's/-fcf-protection//' | sed -re 's/-specs=[^ ]*//g')
133fb8
%global dotnet_ldflags %(echo %{__global_ldflags} | sed -re 's/-specs=[^ ]*//g')
133fb8
b6ac95
%global host_version 2.2.8
b6ac95
%global runtime_version 2.2.8
b6ac95
%global sdk_version 2.2.110
133fb8
133fb8
Name:           %{?scl_prefix}dotnet
133fb8
Version:        %{sdk_version}
b6ac95
Release:        2%{?dist}
133fb8
Group:          Development/Languages
133fb8
Summary:        .NET Core CLI tools and runtime
133fb8
License:        MIT and ASL 2.0 and BSD
133fb8
URL:            https://github.com/dotnet/
133fb8
133fb8
# The source is generated on a RHEL box via:
133fb8
# - git clone https://github.com/dotnet/source-build
133fb8
# - git checkout v%%{sdk_version}
133fb8
# - set environment variables + tweak sources to build
133fb8
# - ./build-source-tarball.sh dotnet-%%{sdk_version}
133fb8
# - tar cvzf dotnet-%%{sdk_version}.tar.gz dotnet-%%{sdk_version}
133fb8
c3bec3
Source0:        dotnet-v%{runtime_version}.tar.gz
133fb8
Source1:        check-debug-symbols.py
144a66
Source2:        https://raw.githubusercontent.com/dotnet/cli/53f485c23cc467c62f80252696b8ec51ce8b4564/scripts/register-completions.bash
133fb8
133fb8
Patch100:       corefx-32956-alpn.patch
133fb8
Patch101:       corefx-optflags-support.patch
133fb8
133fb8
Patch200:       coreclr-21084-llvm-home.patch
133fb8
133fb8
Patch300:       core-setup-4510-commit-id.patch
133fb8
133fb8
ExclusiveArch:  x86_64
133fb8
133fb8
BuildRequires:  llvm-toolset-7-clang
133fb8
BuildRequires:  cmake
133fb8
BuildRequires:  git
133fb8
BuildRequires:  hostname
133fb8
BuildRequires:  krb5-devel
133fb8
BuildRequires:  %{?scl_prefix}libcurl-devel
133fb8
BuildRequires:  libicu-devel
133fb8
BuildRequires:  libunwind-devel
133fb8
BuildRequires:  llvm-toolset-7-lldb-devel
133fb8
BuildRequires:  llvm-toolset-7-llvm
133fb8
BuildRequires:  %{?scl_prefix}lttng-ust-devel
133fb8
BuildRequires:  openssl-devel
133fb8
BuildRequires:  python2
133fb8
BuildRequires:  zlib-devel
133fb8
133fb8
Requires:       %{name}-sdk-2.2%{?_isa}
133fb8
133fb8
%description
133fb8
.NET Core is a fast, lightweight and modular platform for creating
133fb8
cross platform applications that work on Linux, macOS and Windows.
133fb8
133fb8
It particularly focuses on creating console applications, web
133fb8
applications and micro-services.
133fb8
133fb8
.NET Core contains a runtime conforming to .NET Standards a set of
133fb8
framework libraries, an SDK containing compilers and a 'dotnet'
133fb8
application to drive everything.
133fb8
133fb8
%package host
133fb8
133fb8
Version:        %{runtime_version}
133fb8
Summary:        .NET command line launcher
133fb8
133fb8
%description host
133fb8
The .NET Core host is a command line program that runs a standalone
133fb8
.NET core application or launches the SDK.
133fb8
133fb8
.NET Core is a fast, lightweight and modular platform for creating
133fb8
cross platform applications that work on Linux, Mac and Windows.
133fb8
133fb8
It particularly focuses on creating console applications, web
133fb8
applications and micro-services.
133fb8
133fb8
%package host-fxr-2.2
133fb8
133fb8
Version:        %{host_version}
133fb8
Summary:        .NET Core command line host resolver
133fb8
133fb8
# Theoretically any version of the host should work
133fb8
Requires:       %{name}-host%{?_isa}
133fb8
133fb8
%description host-fxr-2.2
133fb8
The .NET Core host resolver contains the logic to resolve and select
133fb8
the right version of the .NET Core SDK or runtime to use.
133fb8
133fb8
.NET Core is a fast, lightweight and modular platform for creating
133fb8
cross platform applications that work on Linux, Mac and Windows.
133fb8
133fb8
It particularly focuses on creating console applications, web
133fb8
applications and micro-services.
133fb8
133fb8
%package runtime-2.2
133fb8
133fb8
Version:        %{runtime_version}
133fb8
Summary:        NET Core 2.2 runtime
133fb8
133fb8
Requires:       %{name}-host-fxr-2.2%{?_isa}
133fb8
133fb8
# libicu is dlopen()ed
133fb8
Requires:       libicu
133fb8
# libcurl is dlopen()ed
133fb8
Requires:       %{?scl_prefix}libcurl
133fb8
133fb8
%description runtime-2.2
133fb8
The .NET Core runtime contains everything needed to run .NET Core applications.
133fb8
It includes a high performance Virtual Machine as well as the framework
133fb8
libraries used by .NET Core applications.
133fb8
133fb8
.NET Core is a fast, lightweight and modular platform for creating
133fb8
cross platform applications that work on Linux, Mac and Windows.
133fb8
133fb8
It particularly focuses on creating console applications, web
133fb8
applications and micro-services.
133fb8
133fb8
%package sdk-2.2
133fb8
133fb8
Version:        %{sdk_version}
133fb8
Summary:        .NET Core 2.2 Software Development Kit
133fb8
133fb8
Requires:       %{name}-sdk-2.2.1xx%{?_isa}
133fb8
133fb8
%description sdk-2.2
133fb8
The .NET Core SDK is a collection of command line applications to
133fb8
create, build, publish and run .NET Core applications.
133fb8
133fb8
.NET Core is a fast, lightweight and modular platform for creating
133fb8
cross platform applications that work on Linux, Mac and Windows.
133fb8
133fb8
It particularly focuses on creating console applications, web
133fb8
applications and micro-services.
133fb8
133fb8
%package sdk-2.2.1xx
133fb8
133fb8
Version:        %{sdk_version}
133fb8
Summary:        .NET Core 2.2.1xx Software Development Kit
133fb8
133fb8
Requires:       %{name}-runtime-2.2%{?_isa}
133fb8
133fb8
%description sdk-2.2.1xx
133fb8
The .NET Core SDK is a collection of command line applications to
133fb8
create, build, publish and run .NET Core applications.
133fb8
133fb8
.NET Core is a fast, lightweight and modular platform for creating
133fb8
cross platform applications that work on Linux, Mac and Windows.
133fb8
133fb8
It particularly focuses on creating console applications, web
133fb8
applications and micro-services.
133fb8
133fb8
%prep
c3bec3
%setup -q -n %{pkg_name}-v%{runtime_version}
133fb8
133fb8
# Disable warnings
133fb8
sed -i 's|skiptests|skiptests ignorewarnings|' repos/coreclr.proj
133fb8
133fb8
# Fix bad hardcoded path in build
133fb8
sed -i 's|/usr/share/dotnet|%{_libdir}/%{pkg_name}|' src/core-setup/src/corehost/common/pal.unix.cpp
133fb8
133fb8
pushd src/corefx
133fb8
%patch100 -p1
133fb8
%patch101 -p1
133fb8
popd
133fb8
133fb8
pushd src/coreclr
133fb8
%patch200 -p1
133fb8
popd
133fb8
133fb8
pushd src/core-setup
133fb8
%patch300 -p1
133fb8
popd
133fb8
133fb8
%build
133fb8
%{?scl:scl enable %scl llvm-toolset-7 - << \EOF}
133fb8
set -xe
133fb8
133fb8
export CFLAGS="%{dotnet_cflags}"
133fb8
export CXXFLAGS="%{dotnet_cflags}"
133fb8
export LDFLAGS="%{dotnet_ldflags}"
133fb8
133fb8
export LIBRARY_PATH="%{_libdir}"
133fb8
export LLVM_HOME=/opt/rh/llvm-toolset-7/root/usr 
133fb8
export CMAKE_PREFIX_PATH="%{_prefix}"
133fb8
133fb8
VERBOSE=1 ./build.sh \
133fb8
  /v:diag \
133fb8
  /p:MinimalConsoleLogOutput=false \
133fb8
  /p:ContinueOnPrebuiltBaselineError=true
133fb8
133fb8
%{?scl:EOF}
133fb8
133fb8
%install
133fb8
install -d -m 0755 %{buildroot}%{_libdir}/%{pkg_name}/
133fb8
ls bin/x64/Release
133fb8
tar vxf bin/x64/Release/dotnet-sdk-%{sdk_version}-*.tar.gz -C %{buildroot}%{_libdir}/%{pkg_name}/
133fb8
133fb8
# Fix permissions on files
133fb8
find %{buildroot}%{_libdir}/%{pkg_name}/ -type f -name '*.props' -exec chmod -x {} \;
133fb8
find %{buildroot}%{_libdir}/%{pkg_name}/ -type f -name '*.targets' -exec chmod -x {} \;
133fb8
find %{buildroot}%{_libdir}/%{pkg_name}/ -type f -name '*.dll' -exec chmod -x {} \;
133fb8
find %{buildroot}%{_libdir}/%{pkg_name}/ -type f -name '*.pubxml' -exec chmod -x {} \;
133fb8
144a66
install -dm 755 %{buildroot}/%{_root_datadir}/bash-completion/completions
133fb8
# dynamic completion needs the file to be named the same as the base command
144a66
install %{SOURCE2} %{buildroot}/%{_root_datadir}/bash-completion/completions/dotnet
133fb8
133fb8
# TODO: the zsh completion script needs to be ported to use #compdef
133fb8
#install -dm 755 %%{buildroot}/%%{_datadir}/zsh/site-functions
133fb8
#install src/cli/scripts/register-completions.zsh %%{buildroot}/%%{_datadir}/zsh/site-functions/_dotnet
133fb8
133fb8
install -d -m 0755 %{buildroot}%{_bindir}
133fb8
ln -s %{_libdir}/%{pkg_name}/dotnet %{buildroot}%{_bindir}/
133fb8
133fb8
install -d -m 0755 %{buildroot}%{_mandir}/man1/
133fb8
find -iname 'dotnet*.1' -type f -exec cp {} %{buildroot}%{_mandir}/man1/ \;
133fb8
133fb8
# Check debug symbols in all elf objects. This is not in %%check
133fb8
# because native binaries are stripped by rpm-build after %%install.
133fb8
# So we need to do this check earlier.
133fb8
echo "Testing build results for debug symbols..."
133fb8
%{SOURCE1} -v %{buildroot}%{_libdir}/%{pkg_name}/
133fb8
133fb8
%check
133fb8
%{buildroot}%{_libdir}/%{pkg_name}/dotnet --info
133fb8
133fb8
%files
133fb8
# empty package useful for dependencies
133fb8
133fb8
%files host
133fb8
%dir %{_libdir}/%{pkg_name}
133fb8
%{_libdir}/%{pkg_name}/dotnet
133fb8
%{_libdir}/%{pkg_name}/host
133fb8
%{_bindir}/dotnet
133fb8
%doc %{_libdir}/%{pkg_name}/LICENSE.txt
133fb8
%doc %{_libdir}/%{pkg_name}/ThirdPartyNotices.txt
133fb8
%doc %{_mandir}/man1/dotnet*.1.gz
133fb8
# shell completions are currently only picked up from %%{_root_datadir}
144a66
%dir %{_root_datadir}/bash-completion
144a66
%dir %{_root_datadir}/bash-completion/completions
144a66
%{_root_datadir}/bash-completion/completions/dotnet
133fb8
133fb8
%files host-fxr-2.2
133fb8
%dir %{_libdir}/%{pkg_name}/host/fxr
133fb8
%{_libdir}/%{pkg_name}/host/fxr/%{host_version}
133fb8
133fb8
%files runtime-2.2
133fb8
%dir %{_libdir}/%{pkg_name}/shared
133fb8
%dir %{_libdir}/%{pkg_name}/shared/Microsoft.NETCore.App
133fb8
%{_libdir}/%{pkg_name}/shared/Microsoft.NETCore.App/%{runtime_version}
133fb8
133fb8
%files sdk-2.2
133fb8
# empty package useful for dependencies
133fb8
133fb8
%files sdk-2.2.1xx
133fb8
%dir %{_libdir}/%{pkg_name}/sdk
133fb8
%{_libdir}/%{pkg_name}/sdk/%{sdk_version}
133fb8
133fb8
%changelog
b6ac95
* Thu Nov 07 2019 Radka Janekova <rjanekov@redhat.com> - 2.2.110-2
b6ac95
- Update to rebuild .NET Core Runtime 2.2.8 and SDK 2.2.110
b6ac95
- Resolves: RHBZ#1767563
b6ac95
b6ac95
* Thu Oct 31 2019 Omair Majid <omajid@redhat.com> - 2.2.110-1
b6ac95
- Update to .NET Core Runtime 2.2.8 and SDK 2.2.110
b6ac95
- Resolves: RHBZ#1767563
b6ac95
67193b
* Thu Aug 29 2019 Omair Majid <omajid@redhat.com> - 2.2.109-1
67193b
- Update to .NET Core Runtime 2.2.7 and SDK 2.2.109
67193b
- Resolves: RHBZ#1744260
67193b
7e72bd
* Thu Jul 11 2019 Omair Majid <omajid@redhat.com> - 2.2.108-2
7e72bd
- Fix strerror linkage issue identified by tests
7e72bd
- Resolves: RHBZ#1728895
7e72bd
7e72bd
* Wed Jul 10 2019 Omair Majid <omajid@redhat.com> - 2.2.108-1
7e72bd
- Update to .NET Core Runtime 2.2.6 and SDK 2.2.108
7e72bd
- Resolves: RHBZ#1728895
7e72bd
144a66
* Wed May 01 2019 Omair Majid <omajid@redhat.com> - 2.2.107-2
144a66
- Enable bash completion using the latest upstream completion file
144a66
- Resolves: RHBZ#1654863
144a66
144a66
* Tue Apr 30 2019 Omair Majid <omajid@redhat.com> - 2.2.107-1
144a66
- Update to .NET Core Runtime 2.2.5 and SDK 2.2.107
144a66
- Resolves: RHBZ#1704934
144a66
5301a8
* Mon Apr 08 2019 Omair Majid <omajid@redhat.com> - 2.2.106-2
5301a8
- Update to .NET Core Runtime 2.2.4 and SDK 2.2.106
5301a8
- Resolves: RHBZ#1696779
5301a8
5301a8
* Fri Apr 05 2019 Omair Majid <omajid@redhat.com> - 2.2.203-1
5301a8
- Update to .NET Core Runtime 2.2.4 and SDK 2.2.203
5301a8
- Resolves: RHBZ#1696779
5301a8
c3bec3
* Tue Mar 05 2019 Omair Majid <omajid@redhat.com> - 2.2.105-1
c3bec3
- Update to .NET Core Runtime 2.2.3 and SDK 2.2.105
c3bec3
- Resolves: RHBZ#1685718
c3bec3
c3bec3
* Wed Jan 30 2019 Omair Majid <omajid@redhat.com> - 2.2.104-2
c3bec3
- Update to .NET Core Runtime 2.2.2 and SDK 2.2.104
c3bec3
- Resolves: RHBZ#1671056
c3bec3
6ec455
* Tue Jan 15 2019 Omair Majid <omajid@redhat.com> - 2.2.103-2
6ec455
- Update to .NET Core SDK 2.2.103
6ec455
- Resolves: RHBZ#1666465
6ec455
8af491
* Tue Dec 18 2018 Omair Majid <omajid@redhat.com> - 2.2.102-1
c3bec3
- Update to .NET Core Runtime 2.2.1 and SDK 2.2.102
8af491
- Resolves: RHBZ#1660223
8af491
133fb8
* Thu Nov 29 2018 Omair Majid <omajid@redhat.com> - 2.2.100-5
133fb8
- Remove bash completion to fix parallel installation with .NET Core 2.1
133fb8
- Resolves: RHBZ#1649584
133fb8
133fb8
* Wed Nov 21 2018 Omair Majid <omajid@redhat.com> - 2.2.100-4
133fb8
- Fix dependency on host-fxr-2.2
133fb8
- Resolves: RHBZ#1649584
133fb8
133fb8
* Wed Nov 21 2018 Omair Majid <omajid@redhat.com> - 2.2.100-3
133fb8
- Fix configure check in the presence of distro-supplied cflags/ldflags
133fb8
- Fixes ALPN support
133fb8
- Resolves: RHBZ#1649584
133fb8
133fb8
* Tue Nov 20 2018 Omair Majid <omajid@redhat.com> - 2.2.100-2
133fb8
- Increase build verbosity
133fb8
- Resolves: RHBZ#1649584
133fb8
133fb8
* Mon Nov 19 2018 Omair Majid <omajid@redhat.com> - 2.2.100-1
133fb8
- New package.
133fb8
- Resolves: RHBZ#1649584