Welcome to mirror list, hosted at ThFree Co, Russian Federation.

nuget.py « MacSDK « packaging - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3518177d7be40f1080a2562cbc5f8a166d757146 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import fileinput


class NuGetBinary (Package):

    def __init__(self):
        Package.__init__(self, name='NuGet', version='6.3.1', sources=[
                         'https://dist.nuget.org/win-x86-commandline/v%{version}/nuget.exe'])

    def build(self):
        pass

    def install(self):
        source = os.path.join(self.workspace, 'nuget.exe')
        target = os.path.join(self.staged_prefix, 'lib/mono/nuget/nuget.exe')
        ensure_dir(os.path.dirname(target))
        shutil.move(source, target)

        launcher = os.path.join(self.staged_prefix, "bin/nuget")
        ensure_dir(os.path.dirname(launcher))
        with open(launcher, "w") as output:
            output.write("#!/bin/sh\n")
            output.write(
                'exec {0}/bin/mono $MONO_OPTIONS {1} "$@"\n'.format(self.staged_prefix, target))
        os.chmod(launcher, 0o755)
NuGetBinary()