Skip to content

Instantly share code, notes, and snippets.

@tpokorra tpokorra/msbuild.spec
Last active Mar 31, 2017

What would you like to do?
msbuild spec file for RPM package
# Note: this only works if you are able to modify /etc/os-release!
# for some reason, we cannot build on CentOS7, but only if we pretend to be Ubuntu 16.04!
Name: msbuild
Version: 15.1
Release: 1%{?dist}
Summary: The Microsoft Build Engine is a platform for building applications.
License: MIT
BuildRequires: mono-devel
BuildRequires: libunwind-devel
BuildRequires: libicu-devel = 50.1.2
Provides: mono(Microsoft.CodeAnalysis) =
Provides: mono(Microsoft.CodeAnalysis.CSharp) =
Provides: mono(Microsoft.Win32.Primitives) =
Provides: mono(Newtonsoft.Json) =
Provides: mono(System.Collections) =
Provides: mono(System.Collections.Concurrent) =
Provides: mono(System.Collections.Concurrent) =
Provides: mono(System.Diagnostics.Debug) =
Provides: mono(System.Diagnostics.Tracing) =
Provides: mono(System.Diagnostics.Tracing) =
Provides: mono(System.Dynamic.Runtime) =
Provides: mono(System.Globalization) =
Provides: mono(System.Globalization.Calendars) =
Provides: mono(System.IO) =
Provides: mono(System.IO) =
Provides: mono(System.IO.Compression) =
Provides: mono(System.IO.FileSystem) =
Provides: mono(System.IO.FileSystem.Primitives) =
Provides: mono(System.Linq) =
Provides: mono(System.Linq.Expressions) =
Provides: mono(System.Linq.Expressions) =
Provides: mono(System.Net.Http) =
Provides: mono(System.ObjectModel) =
Provides: mono(System.Reflection) =
Provides: mono(System.Reflection) =
Provides: mono(System.Reflection.Emit) =
Provides: mono(System.Reflection.Emit.ILGeneration) =
Provides: mono(System.Reflection.Emit.Lightweight) =
Provides: mono(System.Reflection.Metadata) =
Provides: mono(System.Reflection.TypeExtensions) =
Provides: mono(System.Runtime) =
Provides: mono(System.Runtime) =
Provides: mono(System.Runtime.Extensions) =
Provides: mono(System.Runtime.Extensions) =
Provides: mono(System.Runtime.InteropServices) =
Provides: mono(System.Runtime.InteropServices) =
Provides: mono(System.Runtime.Serialization.Primitives) =
Provides: mono(System.Security.Claims) =
Provides: mono(System.Security.Cryptography.Algorithms) =
Provides: mono(System.Security.Cryptography.Algorithms) =
Provides: mono(System.Text.Encoding) =
Provides: mono(System.Text.Encoding.Extensions) =
Provides: mono(System.Text.RegularExpressions) =
Provides: mono(System.Text.RegularExpressions) =
Provides: mono(System.Threading) =
Provides: mono(System.Threading.Tasks) =
Provides: mono(System.Xml.ReaderWriter) =
Provides: mono(System.Xml.XDocument) =
Provides: mono(System.Xml.XPath) =
Provides: mono(System.Xml.XPath.XmlDocument) =
Provides: mono(System.Xml.XmlDocument) =
Provides: mono(mscorlib) =
Provides: mono(System.Private.CoreLib) =
The Microsoft Build 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.
%setup -q -n %{name}-c9-osx-release
sed -i 's/get_current_linux_name() {/get_current_linux_name() { echo "centos"; return 0;/g'
sed -i 's/<AutoGenerateBindingRedirects>false/<AutoGenerateBindingRedirects>true/g' src/XMakeCommandLine/MSBuild.csproj
sed -i 's/ID="centos"/ID="ubuntu"/g' /etc/os-release
sed -i 's/VERSION_ID="7"/VERSION_ID="16.04"/g' /etc/os-release
./ --scope Compile --host Mono --target Mono || exit -1
sed -i 's/ID="ubuntu"/ID="centos"/g' /etc/os-release
sed -i 's/VERSION_ID="16.04"/VERSION_ID="7"/g' /etc/os-release
DESTDIR=%{buildroot} ./ /usr
mkdir %{buildroot}/msbuild-bin
mv %{buildroot}/usr/bin/* %{buildroot}/msbuild-bin
mv %{buildroot}/msbuild-bin %{buildroot}/usr/bin/
cp bin/Bootstrap/*.dll %{buildroot}/usr/bin/msbuild-bin
cp Tools/*.dll %{buildroot}/usr/bin/msbuild-bin
cp Tools/dotnetcli/shared/Microsoft.NETCore.App/1.0.1/mscorlib.dll %{buildroot}/usr/bin/msbuild-bin
echo '#!/bin/bash' > %{buildroot}/usr/bin/msbuild
echo 'cd /usr/bin/msbuild-bin && msbuild $@' >> %{buildroot}/usr/bin/msbuild
chmod a+x %{buildroot}/usr/bin/msbuild
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
# TODO license or copyright
* Mon Mar 27 2017 Timotheus Pokorra <> - 15.1-1
- initial package for msbuild
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.