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
9fb373
%global sdk_version 2.1.402
9fb373
%global runtime_version 2.1.4
6b77c8
6b77c8
Name:           %{?scl_prefix}dotnet
6b77c8
Version:        %{sdk_version}
9fb373
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:
6b77c8
# - git clone https://github.com/dotnet/source-build
ed07d0
# - git checkout v%%{sdk_version}
6b77c8
# - set environment variables + tweak sources to build
ed07d0
# - ./build-source-tarball.sh dotnet-%%{sdk_version}
ed07d0
# - tar cvzf dotnet-%%{sdk_version}.tar.gz dotnet-%%{sdk_version}
ed07d0
beadc4
Source0:        dotnet-%{runtime_version}.tar.gz
6b77c8
Source1:        check-debug-symbols.py
6b77c8
9fb373
Patch1:         19650-cgroup-oom.patch
9fb373
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
8e2aee
Requires:       %{name}-sdk-2.1.4xx%{?_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
8e2aee
%package sdk-2.1.4xx
ed07d0
ed07d0
Version:        %{sdk_version}
8e2aee
Summary:        .NET Core 2.1.4xx Software Development Kit
6b77c8
6b77c8
Requires:       %{name}-runtime-2.1%{?_isa}
6b77c8
8e2aee
%description sdk-2.1.4xx
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
beadc4
%setup -q -n %{pkg_name}-%{runtime_version}
6b77c8
9fb373
pushd src/coreclr
9fb373
%patch1 -p1
9fb373
popd
9fb373
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
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
6b77c8
./build.sh /v:diag
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
6b77c8
install src/cli/scripts/register-completions.bash %{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
8e2aee
%files sdk-2.1.4xx
6b77c8
%dir %{_libdir}/%{pkg_name}/sdk
6b77c8
%{_libdir}/%{pkg_name}/sdk/%{sdk_version}
6b77c8
6b77c8
%changelog
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).