--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <packageSources>
+ <add key="local" value="/nuget" />
+ </packageSources>
+ <config>
+ <add key="globalPackagesFolder" value="/tmp/nuget/packages" />
+ </config>
+</configuration>
+
%install
# nuget
mkdir -p %{buildroot}%{_bindir}
-install -p -m 755 tools/nuget.exe %{buildroot}%{_bindir}
+install -p -m 755 nuget/NuGet.exe %{buildroot}%{_bindir}
+install -p -m 644 nuget/NuGet.Config %{buildroot}
+ln -s %{_bindir}/NuGet.exe %{buildroot}%{_bindir}/nuget.exe
+
+# local nuget packages
+mkdir -p %{buildroot}/nuget
+install -p -m 644 local/*.nupkg %{buildroot}/nuget
# dotnet-gbs
mkdir -p %{buildroot}%{_datadir}/dotnet-gbs
-install -p -m 755 tools/dotnet-gbs/dotnet-gbs.py %{buildroot}%{_datadir}/dotnet-gbs
+install -p -m 755 tools/dotnet-gbs.py %{buildroot}%{_datadir}/dotnet-gbs
ln -s %{_datadir}/dotnet-gbs/dotnet-gbs.py %{buildroot}/%{_bindir}/dotnet-gbs
# Targets
%files
%license LICENSE
+/NuGet.Config
%{_bindir}/*
%{TargetDir}/*
%{_datadir}/dotnet-gbs/*
+/nuget/*.nupkg
--- /dev/null
+#!/usr/bin/env python
+
+import sys
+import os
+import argparse
+import subprocess
+import xml.etree.ElementTree as ET
+
+NUGET_EXE = "/usr/bin/nuget.exe"
+
+def cmd_pack2(args):
+ nuspec = args.targets[0]
+ tmpfile = nuspec + ".autogenerated.nuspec"
+ if os.path.isfile(nuspec):
+ elPackage = ET.parse(nuspec).getroot()
+ elFiles = elPackage.find("files")
+ if elFiles is None:
+ elFiles = ET.Element("files")
+ for root, dirnames, filenames in os.walk(args.PackageFiles):
+ for file in filenames:
+ if file.endswith(".dll"):
+ fw = os.path.basename(root)
+ elFile = ET.Element("file", {"src": os.path.join(fw, file), "target": "lib/" + fw})
+ elFiles.append(elFile)
+ elPackage.append(elFiles)
+ tree = ET.ElementTree(elPackage)
+ tree.write(tmpfile, encoding = "utf-8", xml_declaration = True)
+ cmd = ["mono", NUGET_EXE, "pack", tmpfile,
+ "-BasePath", args.PackageFiles, "-Version", args.PackageVersion]
+ print " ".join(cmd)
+ subprocess.check_call(cmd)
+
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+ parser.add_argument("command", choices=["pack"])
+ parser.add_argument("targets", nargs='+')
+ parser.add_argument("--PackageVersion")
+ parser.add_argument("--PackageFiles")
+
+ args = parser.parse_args()
+
+ if args.command == "pack":
+ cmd_pack2(args)
+ else:
+ exit(1)
+++ /dev/null
-#!/usr/bin/env python
-
-import sys
-import os
-import argparse
-import subprocess
-import xml.etree.ElementTree as ET
-
-NUGET_EXE = "/usr/bin/nuget.exe"
-
-def cmd_pack2(args):
- nuspec = args.targets[0]
- tmpfile = nuspec + ".autogenerated.nuspec"
- if os.path.isfile(nuspec):
- elPackage = ET.parse(nuspec).getroot()
- elFiles = elPackage.find("files")
- if elFiles is None:
- elFiles = ET.Element("files")
- for root, dirnames, filenames in os.walk(args.PackageFiles):
- for file in filenames:
- if file.endswith(".dll"):
- fw = os.path.basename(root)
- elFile = ET.Element("file", {"src": os.path.join(fw, file), "target": "lib/" + fw})
- elFiles.append(elFile)
- elPackage.append(elFiles)
- tree = ET.ElementTree(elPackage)
- tree.write(tmpfile, encoding = "utf-8", xml_declaration = True)
- cmd = ["mono", NUGET_EXE, "pack", tmpfile,
- "-BasePath", args.PackageFiles, "-Version", args.PackageVersion]
- print " ".join(cmd)
- subprocess.check_call(cmd)
-
-
-if __name__ == "__main__":
- parser = argparse.ArgumentParser()
- parser.add_argument("command", choices=["pack"])
- parser.add_argument("targets", nargs='+')
- parser.add_argument("--PackageVersion")
- parser.add_argument("--PackageFiles")
-
- args = parser.parse_args()
-
- if args.command == "pack":
- cmd_pack2(args)
- else:
- exit(1)