From: WonYoung Choi Date: Mon, 12 Dec 2016 05:58:58 +0000 (+0900) Subject: Add RPM Macros X-Git-Tag: accepted/tizen/mobile/20161214.052222~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5cf2f0291a0e04a3f2f1851c9497392bf89f49e;p=platform%2Fcore%2Fdotnet%2Fbuild-tools.git Add RPM Macros Change-Id: Icfc3d25ad9bf0c30641eefa728e899248f8134cb --- diff --git a/packaging/dotnet-build-tools.spec b/packaging/dotnet-build-tools.spec index 4027e40..8070323 100644 --- a/packaging/dotnet-build-tools.spec +++ b/packaging/dotnet-build-tools.spec @@ -1,11 +1,12 @@ 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 @@ -14,7 +15,10 @@ Requires: corefx-managed-ref-noarch %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 @@ -55,8 +59,12 @@ install -p -m 644 NuGet.BuildTasks/ImportBeforeAfter/Microsoft.NuGet.ImportAfter 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}/* diff --git a/packaging/macros.dotnet-build-tools b/packaging/macros.dotnet-build-tools new file mode 100644 index 0000000..f279f31 --- /dev/null +++ b/packaging/macros.dotnet-build-tools @@ -0,0 +1,58 @@ +# 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} +