Blame SPECS/dotnet.spec

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