File msbuild.spec of Package msbuild

#
# spec file for package msbuild
#

%define pkgsuffix 0.xamarin.2.epel8

Name:           msbuild
Version:        16.5+xamarinxplat.2020.01.10.05.36
Release:        0
License:        MIT
Summary:        Microsoft Build Engine (MSbuild) for Mono
Url:            https://github.com/Microsoft/msbuild
Group:          Development/Languages/Mono
Source1:        https://download.mono-project.com/repo/centos8-stable/m/msbuild/msbuild-%{version}-%{pkgsuffix}.noarch.rpm
Source2:        https://download.mono-project.com/repo/centos8-stable/m/msbuild/msbuild-sdkresolver-%{version}-%{pkgsuffix}.noarch.rpm
BuildRequires:  mono-devel
BuildRequires:  fdupes
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       mono-devel
AutoReqProv:    no
# build package only for platforms that support roslyn
ExclusiveArch:  %ix86 x86_64 %{arm} noarch
BuildArch:      noarch

%description
The Microsoft Build Engine is a platform for building applications.
This engine, which is also known as MSBuild, provides an XML schema
for a project file that controls how the build platform processes
and builds software. Visual Studio uses MSBuild, but MSBuild does
not depend on Visual Studio. By invoking msbuild.exe on your
project or solution file, you can orchestrate and build products
in environments where Visual Studio isn't installed.

This package contains the main msbuild build system

%package sdkresolver
Group:          Development/Languages/Mono
Summary:        Managed portion of helper library for msbuild for .NET Core SDK discovery
Requires:       %{name} = %{version}
AutoReqProv:    no
Recommends:     msbuild-libhostfxr

%description sdkresolver
The Microsoft Build Engine is a platform for building applications.

This package contains the managed portion of the helper library
which will auto-discover the .NET Core SDK on your system

%prep
# nothing to do

%build
# nothing to do

%install
pushd "%{buildroot}"
rpm2cpio %{S:1}| cpio -idmv
rpm2cpio %{S:2}| cpio -idmv
sed -i 's/15.0/Current/' ./usr/bin/msbuild
popd
%fdupes "%{buildroot}"

# Remove conflicts with Mono 6
rm %{buildroot}%{_prefix}/lib/mono/msbuild/15.0
rm %{buildroot}%{_prefix}/lib/mono/xbuild/15.0

%files sdkresolver
%defattr(-,root,root)
%dir %{_prefix}/lib/mono/msbuild/Current/bin/SdkResolvers
%{_prefix}/lib/mono/msbuild/Current/bin/SdkResolvers/*

%files
%defattr(-,root,root)
%{_bindir}/msbuild
%{_prefix}/lib/mono/msbuild/Current
%exclude %{_prefix}/lib/mono/msbuild/Current/bin/SdkResolvers
%{_prefix}/lib/mono/xbuild
%{_mandir}/man1/msbuild.1.*

%changelog
openSUSE Build Service is sponsored by