Blame SPECS/dotnet.spec

3c81b8
%{?scl:%scl_package dotnet}
3c81b8
%{!?scl:%global pkg_name %{name}}
3c81b8
3c81b8
# lldb doesn't like our nice debug information
3c81b8
%undefine _include_minidebuginfo
3c81b8
%global _find_debuginfo_dwz_opts %{nil}
3c81b8
d2b5c0
%global sdk_version 2.1.105
d2b5c0
%global runtime_version 2.0.7
3c81b8
3c81b8
# Do not provide internal .so as standard libraries
3c81b8
%global __provides_exclude_from ^(%{_libdir}/dotnet/.*\\.so|%{_libdir}/dotnetcore/sdk/%{sdk_version}/.*\\.so|%{_libdir}/dotnetcore/shared/Microsoft.NETCore.App/%{runtime_version}/.*)$
3c81b8
3c81b8
# Do not generate requires for libraries provided by this own package
3c81b8
%global __requires_exclude ^(libmscordaccore.so\\(\\)\\(64bit\\)|libmscordaccore.so\\(V1.0\\)\\(64bit\\))$
3c81b8
3c81b8
Name:           %{?scl_prefix}dotnet
64c9a7
Version:        %{runtime_version}
d2b5c0
Release:        2%{?dist}
3c81b8
Summary:        .NET Core is a general-purpose cross platform development platform
3c81b8
Group:          Development/Languages
3c81b8
License:        ASL 2.0 and MIT
3c81b8
URL:            https://www.microsoft.com/net/core
3c81b8
64c9a7
Source0:        dotnet-%{runtime_version}.tar.gz
64c9a7
Source1:        check_debug_symbols.py
3c81b8
3c81b8
Patch0:         coreclr-werror.patch
3c81b8
Patch1:         coreclr-sequential-build.patch
64c9a7
Patch2:         do-not-strip-debuginfo.patch
64c9a7
Patch3:         corefx-not-portable.patch
64c9a7
Patch4:         corefx-debuginfo.patch
64c9a7
64c9a7
Patch5:         templates-publish-without-manifest.patch
3c81b8
3c81b8
ExclusiveArch:  x86_64
3c81b8
3c81b8
BuildRequires:  %{?scl_prefix}clang
3c81b8
BuildRequires:  cmake
3c81b8
BuildRequires:  hostname
3c81b8
BuildRequires:  krb5-devel
3c81b8
BuildRequires:  %{?scl_prefix}libcurl-devel
3c81b8
BuildRequires:  libicu-devel
3c81b8
BuildRequires:  libuuid-devel
3c81b8
BuildRequires:  libunwind-devel
3c81b8
BuildRequires:  %{?scl_prefix}lldb-devel
3c81b8
BuildRequires:  %{?scl_prefix}llvm
3c81b8
BuildRequires:  %{?scl_prefix}lttng-ust-devel
3c81b8
BuildRequires:  openssl-devel
3c81b8
BuildRequires:  python2
64c9a7
BuildRequires:  unzip
3c81b8
BuildRequires:  %{?scl_prefix}userspace-rcu-devel
64c9a7
BuildRequires:  zip
3c81b8
BuildRequires:  zlib-devel
3c81b8
64c9a7
# For the sake of compatibility, we default to the older SDK
3c81b8
Requires:       %{?scl_prefix}dotnet-sdk-2.0
3c81b8
3c81b8
%description
3c81b8
.NET Core is a fast, lightweight and modular platform for creating
3c81b8
cross platform applications that work on Linux, Mac and Windows.
3c81b8
3c81b8
It particularly focuses on creating console applications, web
3c81b8
applications and micro-services.
3c81b8
3c81b8
%package -n %{?scl_prefix}dotnet-host
3c81b8
3c81b8
Summary:        Component that runs .NET Core applications or starts the SDK
3c81b8
%{?scl:Requires: %scl_runtime}
3c81b8
3c81b8
%description -n %{?scl_prefix}dotnet-host
3c81b8
The .NET Core host is a small application that finds the right SDK to invoke
3c81b8
or the right framework to run a .NET Core application.
3c81b8
3c81b8
.NET Core is a fast, lightweight and modular platform for creating
3c81b8
cross platform applications that work on Linux, Mac and Windows.
3c81b8
3c81b8
It particularly focuses on creating console applications, web
3c81b8
applications and micro-services.
3c81b8
3c81b8
%package -n %{?scl_prefix}dotnet-runtime-2.0
3c81b8
3c81b8
Summary:        Runtime for .NET Core applications
3c81b8
3c81b8
Requires:       %{?scl_prefix}dotnet-host
3c81b8
Requires:       %{?scl_prefix}libcurl%{?_isa}
5ae8b0
# These libraries are dlopen'ed and not picked up automatically
3c81b8
Requires:       libicu
5ae8b0
Requires:       openssl-libs
3c81b8
3c81b8
%{?scl:Requires: %scl_runtime}
3c81b8
3c81b8
%description -n %{?scl_prefix}dotnet-runtime-2.0
3c81b8
The .NET Core 2.0 runtime package contains a runtime conforming to
3c81b8
.NET Standard 2.0, including a set of framework libraries and a
3c81b8
Just-In-Time compiling Virtual Machine for high performance.
3c81b8
3c81b8
.NET Core is a fast, lightweight and modular platform for creating
3c81b8
cross platform applications that work on Linux, Mac and Windows.
3c81b8
3c81b8
It particularly focuses on creating console applications, web
3c81b8
applications and micro-services.
3c81b8
64c9a7
%package -n %{?scl_prefix}dotnet-sdk-2.1
64c9a7
64c9a7
Version:        %{sdk_version}
3c81b8
3c81b8
Summary:        A software development kit for developing .NET Core applications
64c9a7
64c9a7
# SDK 2.1 requires runtime 2.0
3c81b8
Requires:       %{?scl_prefix}dotnet-runtime-2.0
3c81b8
64c9a7
%description -n %{?scl_prefix}dotnet-sdk-2.1
64c9a7
The .NET Core 2.1 SDK provides a number of command line tools to build
3c81b8
.NET Core applications. It includes compilers for C\#, VB.NET and F\#.
3c81b8
3c81b8
.NET Core is a fast, lightweight and modular platform for creating
3c81b8
cross platform applications that work on Linux, Mac and Windows.
3c81b8
3c81b8
It particularly focuses on creating console applications, web
3c81b8
applications and micro-services.
3c81b8
3c81b8
3c81b8
%prep
8c39e1
%setup -q -n dotnet-%{runtime_version}
3c81b8
3c81b8
%patch0 -p1
3c81b8
%patch1 -p1
3c81b8
%patch2 -p1
3c81b8
%patch3 -p1
5ae8b0
%patch4 -p1
64c9a7
64c9a7
# The templates are "pre-built" into a nuget package. Lets extract, patch, and
64c9a7
# compile the nuget package back into it.
64c9a7
mkdir templates
64c9a7
pushd templates
64c9a7
unzip ../prebuilt/nuget-packages/microsoft.dotnet.web.projecttemplates.2.0.1.0.0-beta2-20170810-304.nupkg
64c9a7
rm ../prebuilt/nuget-packages/microsoft.dotnet.web.projecttemplates.2.0.1.0.0-beta2-20170810-304.nupkg
5ae8b0
%patch5 -p1
64c9a7
zip -r ../prebuilt/nuget-packages/microsoft.dotnet.web.projecttemplates.2.0.1.0.0-beta2-20170810-304.nupkg .
64c9a7
popd
3c81b8
3c81b8
# Increase build verbosity
64c9a7
sed -i -e "s|flp:Verbosity=normal|flp:Verbosity=diag|" src/coreclr/build.sh
d2b5c0
sed -i -e "s|/flp:v=normal|/flp:v=diag|" src/corefx/config.json
3c81b8
3c81b8
# Change text printed when SDK is not installed
8c39e1
sed -i -e "s|http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409|yum install %{?scl_prefix}dotnet-sdk-2.1|" src/core-setup/src/corehost/common/utils.h
3c81b8
64c9a7
%if 0%{?centos} > 6
ee11a7
# Replace RHEL rid with CentOS rid
ee11a7
sed -i -e 's|<FixRid>rhel.7.4-|<FixRid>centos.%{centos}-|g' targets/core-setup.props
ee11a7
sed -i -e 's|<FixRid>rhel.7.4-|<FixRid>centos.%{centos}-|g' targets/cli.props
d2b5c0
sed -i -e 's|rhel.7.4-x64|centos.%{centos}-x64|' targets/roslyn.props
d2b5c0
sed -i -e 's|rhel.7-x64|centos.%{centos}-x64|' build.proj
d2b5c0
sed -i -e 's|rhel.7.4-x64|centos.%{centos}-x64|' src/cli/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj
ee11a7
%endif
ee11a7
3c81b8
%build
3c81b8
%{?scl:scl enable %scl - << \EOF}
3c81b8
set -xe
3c81b8
3c81b8
export CMAKE_PREFIX_PATH="%{_prefix}"
d2b5c0
VERBOSE=1 ./build.sh /clp:v=diag || ./build.sh /clp:v=diag
3c81b8
3c81b8
%{?scl:EOF}
3c81b8
3c81b8
%install
3c81b8
install -dm 755 $RPM_BUILD_ROOT/%{_libdir}/%{pkg_name}/
3c81b8
# for debugging
3c81b8
find bin/x64/Release/
64c9a7
tar xf bin/x64/Release/dotnet-sdk-%{sdk_version}-*-x64.tar.gz -C $RPM_BUILD_ROOT/%{_libdir}/%{pkg_name}/
3c81b8
3c81b8
install -dm 755 $RPM_BUILD_ROOT/%{_root_datadir}/bash-completion/completions
3c81b8
# dynamic completion needs the file to be named the same as the base command
3c81b8
install src/cli/scripts/register-completions.bash $RPM_BUILD_ROOT/%{_root_datadir}/bash-completion/completions/dotnet
3c81b8
3c81b8
# TODO: this doesn't get picked up/used by zsh
3c81b8
install -dm 755 $RPM_BUILD_ROOT/%{_root_datadir}/zsh/site-functions
3c81b8
install src/cli/scripts/register-completions.zsh $RPM_BUILD_ROOT/%{_root_datadir}/zsh/site-functions/%{name}
3c81b8
3c81b8
# for debugging
3c81b8
find $RPM_BUILD_ROOT/%{_libdir}/%{pkg_name}/
3c81b8
3c81b8
# Upstream license files produced from build are bogus
3c81b8
# See: https://github.com/dotnet/core-setup/issues/676
3c81b8
rm $RPM_BUILD_ROOT/%{_libdir}/dotnet/LICENSE.txt
3c81b8
rm $RPM_BUILD_ROOT/%{_libdir}/dotnet/ThirdPartyNotices.txt
3c81b8
3c81b8
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
3c81b8
ln -s %{_libdir}/%{pkg_name}/dotnet $RPM_BUILD_ROOT/%{_bindir}/
3c81b8
3c81b8
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1/
3c81b8
find -type f -iname 'dotnet*\.1' -exec cp {} $RPM_BUILD_ROOT/%{_mandir}/man1/ \;
3c81b8
64c9a7
echo "Testing build results for debug symbols..."
64c9a7
python %{SOURCE1} %{buildroot}%{_libdir}/dotnet/
64c9a7
3c81b8
%files
3c81b8
# empty package useful for dependencies
3c81b8
3c81b8
%files -n %{?scl_prefix}dotnet-host
3c81b8
#%doc LICENSE.txt
3c81b8
#%doc THIRD-PARTY-NOTICES.txt
3c81b8
%dir %{_libdir}/%{pkg_name}
3c81b8
%{_libdir}/%{pkg_name}/dotnet
3c81b8
%{_libdir}/%{pkg_name}/host
3c81b8
%{_bindir}/dotnet
3c81b8
%{_mandir}/man1/dotnet.1*
3c81b8
3c81b8
%files -n %{?scl_prefix}dotnet-runtime-2.0
3c81b8
#%doc LICENSE.TXT
3c81b8
#%doc THIRD-PARTY-NOTICES.TXT
3c81b8
%dir %{_libdir}/%{pkg_name}/shared
3c81b8
%dir %{_libdir}/%{pkg_name}/shared/Microsoft.NETCore.App
3c81b8
%{_libdir}/%{pkg_name}/shared/Microsoft.NETCore.App/%{runtime_version}
3c81b8
64c9a7
%files -n %{?scl_prefix}dotnet-sdk-2.1
3c81b8
#%doc LICENSE.TXT
3c81b8
#%doc THIRD-PARTY-NOTICES.TXT
3c81b8
%dir %{_libdir}/%{pkg_name}/sdk
3c81b8
%{_libdir}/%{pkg_name}/sdk/%{sdk_version}
3c81b8
%{_mandir}/man1/dotnet-*.1.*
3c81b8
# shell completions are currently only picked up from %{_root_datadir}
3c81b8
%dir %{_root_datadir}/bash-completion
3c81b8
%dir %{_root_datadir}/bash-completion/completions
3c81b8
%{_root_datadir}/bash-completion/completions/dotnet
3c81b8
%dir %{_root_datadir}/zsh
3c81b8
%dir %{_root_datadir}/zsh/site-functions
3c81b8
%{_root_datadir}/zsh/site-functions/%{name}
3c81b8
3c81b8
%changelog
d2b5c0
* Mon Apr 23 2018 Omair Majid <omajid@redhat.com> - 2.0.7-2
d2b5c0
- Fix build for CentOS
d2b5c0
d2b5c0
* Fri Apr 20 2018 Omair Majid <omajid@redhat.com> - 2.0.7-1
d2b5c0
- Update to .NET Core 2.0.7
d2b5c0
8c39e1
* Fri Mar 2 2018 Omair Majid <omajid@redhat.com> - 2.0.6-1
8c39e1
- Update to .NET Core 2.0.6
8c39e1
64c9a7
* Thu Feb 8 2018 Omair Majid <omajid@redhat.com> - 2.0.5-1
64c9a7
- Update to .NET Core 2.0.5
64c9a7
64c9a7
* Mon Dec 11 2017 Omair Majid <omajid@redhat.com> - 2.0.3-6
64c9a7
- Add fixes to build on CentOS
64c9a7
64c9a7
* Fri Dec 01 2017 Andrew Slice <andrew.slice@redhat.com> - 2.0.3-5
64c9a7
- Add a test script to sanity check debug and symbol info.
ee11a7
5ae8b0
* Fri Nov 10 2017 Omair Majid <omajid@redhat.com> - 2.0.3-4
5ae8b0
- Make corefx build non-portable, which was how it was in 2.0.0
5ae8b0
5ae8b0
* Thu Nov 9 2017 Omair Majid <omajid@redhat.com> - 2.0.3-3
5ae8b0
- Do not strip debuginfo
5ae8b0
5ae8b0
* Thu Nov 9 2017 Omair Majid <omajid@redhat.com> - 2.0.3-2
5ae8b0
- Add explicit requires for libssl
5ae8b0
5ae8b0
* Tue Oct 31 2017 Omair Majid <omajid@redhat.com> - 2.0.3-1
5ae8b0
- Update to .NET Core 2.0.3
5ae8b0
5ae8b0
* Sat Oct 28 2017 Omair Majid <omajid@redhat.com> - 2.0.3-0.1
5ae8b0
- Update to new drop for .NET Core 2.0.3
5ae8b0
3c81b8
* Sat Aug 12 2017 Omair Majid <omajid@redhat.com> - 2.0.0-4
3c81b8
- Update to new .NET Core drop
3c81b8
3c81b8
* Thu Aug 10 2017 Omair Majid <omajid@redhat.com> - 2.0.0-4
3c81b8
- Update to new .NET Core drop
3c81b8
3c81b8
* Thu Aug 10 2017 Omair Majid <omajid@redhat.com> - 2.0.0-3
3c81b8
- Update to new .NET Core drop
3c81b8
3c81b8
* Fri Aug 04 2017 Omair Majid <omajid@redhat.com> - 2.0.0-2
3c81b8
- Update to new .NET Core drop
3c81b8
3c81b8
* Wed Aug 02 2017 Omair Majid <omajid@redhat.com> - 2.0.0-1
3c81b8
- Update to final .NET Core 2.0 release
3c81b8
3c81b8
* Wed Jul 19 2017 Omair Majid <omajid@redhat.com> - 2.0.0-0.10
3c81b8
- Modify templates to not use the ASP.NET runtime store
3c81b8
3c81b8
* Wed Jul 19 2017 Omair Majid <omajid@redhat> - 2.0.0-0.9
3c81b8
- Use non-scl cmake to build
3c81b8
3c81b8
* Fri Jun 23 2017 Omair Majid <omajid@redhat.com> - 2.0.0-0.8
3c81b8
- Update to newer SDK drop
3c81b8
- Add requires on libicu
3c81b8
3c81b8
* Tue Jun 20 2017 Omair Majid <omajid@redhat.com> - 2.0.0-0.7
3c81b8
- Move more stuff to prep section
3c81b8
- Install shell completion
3c81b8
3c81b8
* Wed Jun 14 2017 Omair Majid <omajid@redhat.com> - 2.0.0-0.6
3c81b8
- Do not print first-run message on every dotnet invocation
3c81b8
3c81b8
* Fri Jun 9 2017 Omair Majid <omajid@redhat.com> - 2.0-0.5
3c81b8
- Update to latest source drop
3c81b8
3c81b8
* Thu Jun 8 2017 Omair Majid <omajid@redhat.com> - 2.0-0.4
3c81b8
- Minor spec file fixes
3c81b8
- Do not depend on git
3c81b8
3c81b8
* Wed Jun 7 2017 Omair Majid <omajid@redhat.com> - 2.0.0-0.3
3c81b8
- Update to latest source drop.
3c81b8
3c81b8
* Fri Jun 2 2017 Omair Majid <omajid@redhat.com> - 2.0.0-0.2
3c81b8
- Add a meta-package for simply installing all of .NET Core
3c81b8
3c81b8
* Thu May 25 2017 Omair Majid <omajid@redhat.com> - 2.0.0-0.1
3c81b8
- Initial package for .NET Core 2.0
3c81b8