Name: dotnet-build-tools
Summary: Tools for building C# API projects
-Version: 1.0.9
+Version: 1.0.10
Release: 1
Group: Development/Libraries
License: MIT and Apache-2.0
URL: https://www.tizen.org
Source0: %{name}-%{version}.tar.gz
+Source1: macros.dotnet-build-tools
AutoReqProv: no
%else
Requires: corefx-managed-ref
%endif
+
Requires: mono-compat
+Requires: mono-devel
+Requires: mono-compiler
%description
Build target files (.Targets) and Tools (including NuGet.exe) for building
mkdir -p %{buildroot}/nuget
install -p -m 644 LocalPackages/*.nupkg %{buildroot}/nuget
+# RPM Macros
+install -D -p -m 0644 %{S:1} %{buildroot}%{_sysconfdir}/rpm/macros.dotnet-build-tools
+
%files
%license LICENSE.Mono.Cecil LICENSE.NuGet
+%config(noreplace) %{_sysconfdir}/rpm/macros.dotnet-build-tools
%{_bindir}/*
%{NuGetDir}/*
%{XBuildDir}/*
--- /dev/null
+# Macro definitions for CSAPI Build
+
+%_dotnet_build_conf %{lua:if tonumber(rpm.expand("0%{?tizen_build_devel_mode}")) == 1 then print "Debug" else print "Release" end}
+
+%dotnet_assembly_path %{!?dotnet_assembly_path:/opt/usr/share/dotnet.tizen/framework}
+%_mono_assembly_path /opt/usr/lib/assembly
+
+%dotnet_assembly_files %{dotnet_assembly_path}/*.dll
+
+%_nuget_package \
+%package nuget\
+Summary: NuGet package for %{name}\
+Group: Development/Libraries\
+%description nuget\
+NuGet package for %{name}\
+%files nuget\
+/nuget/*.nupkg\
+%{nil}
+
+%_mono_package \
+%package mono\
+Summary: %{name} for Mono Runtime\
+Group: Development/Libraries\
+%description mono\
+%{name} for Mono Runtime\
+%files mono\
+%manifest %{name}.manifest\
+%%license LICENSE\
+%attr(644,root,root) %{_mono_assembly_path}/*.dll\
+%{nil}
+
+%dotnet_subpackages \
+%_nuget_package \
+%_mono_package \
+%{nil}
+
+%dotnet_build() \
+find %{1}/*.project.json -print0 | xargs -n1 -0 nuget restore \
+find %{1}/*.csproj -print0 | xargs -n1 -0 xbuild /p:Configuration=%{_dotnet_build_conf} \
+%{nil}
+
+%dotnet_pack() \
+nuget pack %{1}/%{1}.nuspec -Version %{?2}%{!?2:%{version}} -Properties Configuration=%{_dotnet_build_conf} \
+%{nil}
+
+%dotnet_install() \
+%if 0%{?_with_corefx} \
+mkdir -p %{buildroot}%{dotnet_assembly_path} \
+mkdir -p %{buildroot}%{_mono_assembly_path} \
+mkdir -p %{buildroot}/nuget \
+install -p -m 644 %{1}/bin/%{_dotnet_build_conf}/%{1}.dll %{buildroot}%{dotnet_assembly_path} \
+%else \
+ install -p -m 644 %{1}/bin/%{_dotnet_build_conf}/Net45/%{1}.dll %{buildroot}%{dotnet_assembly_path} \
+%endif \
+install -p -m 644 %{1}/bin/%{_dotnet_build_conf}/Net45/%{1}.dll %{buildroot}%{_mono_assembly_path} \
+install -p -m 644 %{1}*.nupkg %{buildroot}/nuget \
+%{nil}
+