restore() {
local TARGET=$1; shift
- if [[ $TARGET == *".sln" ]]; then
- nuget_retry restore $TARGET $@
- elif [[ $TARGET == *".project.json" ]]; then
- nuget_retry restore $TARGET $@
- else
+ if [ -d $TARGET ]; then
local PROJFILES=$(find $TARGET -name "*.project.json")
for P in $PROJFILES; do
nuget_retry restore $P $@
done
+ elif [ -f $TARGET ]; then
+ nuget_retry restore $TARGET $@
+ else
+ echo "Invalid nuget restore target."
+ exit 1
fi
}
%_dotnet_build_conf %{lua:if tonumber(rpm.expand("0%{?tizen_build_devel_mode}")) == 1 then print "Debug" else print "Release" end}
+%dotnet_nuget_source /nuget
+
%_nuget_package \
%package nuget\
Summary: NuGet package for %{name}\
%{nil}
%dotnet_restore() \
-dotnet-build restore %{1} \
+dotnet-build restore %{1} %{?2} %{?3} %{?4} %{?5} %{?6} \
%{nil}
%dotnet_build() \
dotnet-build pack %{1} %{2} %{_dotnet_build_conf} %{?3} %{?4} %{?5} %{?6} %{?7} \
%{nil}
-%dotnet_install() \
+%dotnet_install_assembly() \
mkdir -p %{buildroot}%{_dotnet_assembly_path} \
mkdir -p %{buildroot}%{_mono_assembly_path} \
+install -p -m 644 "%{1}/bin/%{_dotnet_build_conf}/%{1}.dll" %{buildroot}%{_dotnet_assembly_path} \
+%if 0%{?_mono_subrpm} \
+[ -f "%{1}/bin/%{_dotnet_build_conf}/Net45/%{1}.dll" ] && install -p -m 644 "%{1}/bin/%{_dotnet_build_conf}/Net45/%{1}.dll" %{buildroot}%{_mono_assembly_path} \
+%endif \
+%{nil}
+
+%dotnet_install_nuget() \
mkdir -p %{buildroot}/nuget \
+install -p -m 644 %{1}*.nupkg %{buildroot}/nuget \
+%{nil}
+
+%dotnet_install() \
+mkdir -p %{buildroot}%{_dotnet_assembly_path} \
+mkdir -p %{buildroot}%{_mono_assembly_path} \
install -p -m 644 "%{1}/bin/%{_dotnet_build_conf}/%{1}.dll" %{buildroot}%{_dotnet_assembly_path} \
%if 0%{?_mono_subrpm} \
[ -f "%{1}/bin/%{_dotnet_build_conf}/Net45/%{1}.dll" ] && install -p -m 644 "%{1}/bin/%{_dotnet_build_conf}/Net45/%{1}.dll" %{buildroot}%{_mono_assembly_path} \
%endif \
+mkdir -p %{buildroot}/nuget \
install -p -m 644 %{1}*.nupkg %{buildroot}/nuget \
%{nil}