%{?scl:%scl_package dotnetcore}
%{!?scl:%global pkg_name %{name}}
# there are no build id notes in these binaries
# dont abort finding-debuginfo because of that
%undefine _missing_build_ids_terminate_build
# lldb doesn't like our nice debug information
%undefine _include_minidebuginfo
%global _find_debuginfo_dwz_opts %{nil}
%global cli_version 1.0.0-preview2-003156
%global runtime_version 1.0.3
# Do not provide internal .so as standard libraries
%global __provides_exclude_from ^(%{_libdir}/dotnetcore/.*\\.so|%{_libdir}/dotnetcore/sdk/%{cli_version}/.*\\.so|%{_libdir}/dotnetcore/shared/Microsoft.NETCore.App/%{runtime_version}/.*)$
# Do not scan some files for which we have no dependencies
%global __requires_exclude_from ^(%{_libdir}/dotnetcore/shared/Microsoft.NETCore.App/%{runtime_version}/libcoreclrtraceptprovider.so|%{_libdir}/dotnetcore/shared/Microsoft.NETCore.App/%{runtime_version}/libsosplugin.so)$
# Do not generate requires for libraries provided by this own package
%global __requires_exclude ^(libmscordaccore.so\\(\\)\\(64bit\\)|libmscordaccore.so\\(V1.0\\)\\(64bit\\))$
Name: %{?scl_prefix}dotnetcore
Version: 1.0.3
Release: 3%{?dist}
Summary: .NET Core 1.0
Group: Development/Languages
License: ASL 2.0 and MIT
URL: http://www.microsoft.com/net
# Built on a developer's laptop, from source
Source0: dotnet-dev-rhel-x64.%{cli_version}.tar.gz
Source1: manpages.%{cli_version}.tar.gz
Source2: https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/LICENSE
Requires: %{?scl_prefix}libcurl%{?_isa}
Requires: %{?scl_prefix}libuv%{?_isa}
%{?scl:Requires: %scl_runtime}
%description
.NET Core Framework 1.0 and .NET Core Runtime 1.0
%prep
%setup -q -c -n %{pkg_name}-%{version}
tar xvf %{SOURCE1}
# Upstream build produces a bogus LICENSE
# https://github.com/dotnet/core-setup/issues/676
rm LICENSE.txt
cp %{SOURCE2} LICENSE
%build
# Nothing to build; this is already a binary in a tarball
# Remove things with dependencies that are not ready yet
# Requires lttng
# find -iname libcoreclrtraceptprovider.so -delete
# Requires lldb
# find -iname libsosplugin.so -delete
# Replace libuv with our own version. Note, there's also another copy of this
# same libuv, bundled, in the nuget package archive.
rm shared/Microsoft.NETCore.App/%{runtime_version}/libuv.so
ln -s %{_libdir}/libuv.so.1 shared/Microsoft.NETCore.App/%{runtime_version}/libuv.so
%install
install -dm 755 $RPM_BUILD_ROOT/%{_libdir}/%{pkg_name}/
cp -a dotnet sdk host shared $RPM_BUILD_ROOT/%{_libdir}/%{pkg_name}/
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
ln -s %{_libdir}/%{pkg_name}/dotnet $RPM_BUILD_ROOT/%{_bindir}/
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1/
find -type f -iname 'dotnet*\.1' -exec cp {} $RPM_BUILD_ROOT/%{_mandir}/man1/ \;
%files
%doc LICENSE
%doc ThirdPartyNotices.txt
%{_libdir}/%{pkg_name}
%{_bindir}/*
%{_mandir}/man1/dotnet*.1*
%changelog
* Tue Dec 06 2016 Omair Majid <omajid@redhat.com> - 1.0.3-3
- Update to latest build
* Mon Dec 05 2016 Omair Majid <omajid@redhat.com> - 1.0.3-2
- Remove .cs files from nuget archive
- Resolves: RHBZ 1384151
* Sat Nov 26 2016 Omair Majid <omajid@redhat.com> - 1.0.3-1
- Update to 1.0.3
* Tue Sep 20 2016 Omair Majid <omajid@redhat.com> - 1.0.1-2
- Add man pages
* Mon Sep 19 2016 Omair Majid <omajid@redhat.com> - 1.0.1-1
- Update to 1.0.1
- Resolves: RHBZ 1361254
- Resolves: RHBZ 1372033
* Wed Jun 22 2016 Omair Majid <omajid@redhat.com> - 1.0.0-7
- Update to newer build.
- Fixes https://github.com/NuGet/Home/issues/3010
* Mon Jun 20 2016 Severin Gehwolf <sgehwolf@redhat.com> - 1.0.0-6
- Reinstate libuv runtime requirement.
* Fri Jun 17 2016 Omair Majid <omajid@redhat.com> - 1.0.0-5
- Update with new build. This one includes a libuv built from source.
* Fri Jun 17 2016 Omair Majid <omajid@redhat.com> - 1.0.0-4
- Update source.
- Fix filtering of provides and requires
- Don't use the scl-wide libuv.so. There's a bundled copy included.
* Fri Jun 17 2016 Omair Majid <omajid@redhat.com> - 1.0.0-3
- Update requires filtering for self-provided library
* Fri Jun 17 2016 Omair Majid <omajid@redhat.com> - 1.0.0-2
- Update requires filtering for self-provided library
* Thu Jun 16 2016 Omair Majid <omajid@redhat.com> - 1.0.0-1
- First build of .NET Core 1.0
* Fri May 27 2016 Omair Majid <omajid@redhat.com> - 1.0.0-0.9.rc2
- Don't generate requires for self-provided library
* Fri May 27 2016 Omair Majid <omajid@redhat.com> - 1.0.0-0.8.rc2
- Do not rpm-provide internal implementation libraries
* Tue May 17 2016 Omair Majid <omajid@redhat.com> - 1.0.0-0.7.rc2
- Strip binaries and produce debug packages
* Mon May 16 2016 Omair Majid <omajid@redhat.com> - 1.0.0-0.6.preview1
- Build using new upstream tarball with fixed LICENSE.
* Mon May 16 2016 Omair Majid <omajid@redhat.com> - 1.0.0-0.5.preview1
- Include license file
* Thu May 12 2016 Omair Majid <omajid@redhat.com> - 1.0.0-0.4.preview1
- Update to latest preview build
* Wed May 11 2016 Omair Majid <omajid@redhat.com> - 1.0.0-0.3.preview1
- Update to latest build
* Thu Apr 28 2016 Omair Majid <omajid@redhat.com> - 1.0.0-0.2.20160428
- Update to the latest nightly build
* Thu Apr 21 2016 Omair Majid <omajid@redhat.com> - 1.0.0-0.2.20160421
- Update to latest nightly build
* Wed Apr 20 2016 Omair Majid <omajid@redhat.com> - 1.0.0-0.2.20160407
- Explicitly require customized libcurl
* Mon Apr 18 2016 Omair Majid <omajid@redhat.com> - 1.0.0-0.1.20160407
- Rename package
* Thu Apr 07 2016 Omair Majid <omajid@redhat.com> - 1.0.0-0.1.20160407
- Update to latest nightly
* Wed Apr 06 2016 Omair Majid <omajid@redhat.com> - 1.0.0-0.1.20160406
- Update to latest nightly
* Mon Apr 04 2016 Omair Majid <omajid@redhat.com> - 1.0.0-0.1.20160404
- Update to newer drop
* Fri Mar 11 2016 Omair Majid <omajid@redhat.com> - 1.0.0-0.1.20160229
- Initial package