amazon-ec2-net-utils: init at 2.5.4 (#355111)

authored by Arne Keller and committed by GitHub 2a3c023c 79cf6580

+120
+120
pkgs/by-name/am/amazon-ec2-net-utils/package.nix
···
··· 1 + { 2 + lib, 3 + stdenv, 4 + bash, 5 + coreutils, 6 + curl, 7 + fetchFromGitHub, 8 + gnugrep, 9 + gnused, 10 + installShellFiles, 11 + iproute2, 12 + makeWrapper, 13 + nix-update-script, 14 + systemd, 15 + util-linux, 16 + }: 17 + 18 + stdenv.mkDerivation rec { 19 + pname = "amazon-ec2-net-utils"; 20 + version = "2.5.4"; 21 + 22 + src = fetchFromGitHub { 23 + owner = "amazonlinux"; 24 + repo = "amazon-ec2-net-utils"; 25 + tag = "v${version}"; 26 + hash = "sha256-uHYEavdBggdXBYUSDFvajRVLxcRge/kiu60c1a4SPRw="; 27 + }; 28 + 29 + strictDeps = true; 30 + 31 + nativeBuildInputs = [ 32 + installShellFiles 33 + makeWrapper 34 + ]; 35 + 36 + buildInputs = [ 37 + bash 38 + ]; 39 + 40 + # See https://github.com/amazonlinux/amazon-ec2-net-utils/blob/v2.5.4/GNUmakefile#L26-L37. 41 + installPhase = '' 42 + runHook preInstall 43 + 44 + mkdir $out 45 + 46 + for file in bin/*.sh; do 47 + install -D -m 755 "$file" $out/bin/$(basename --suffix ".sh" "$file") 48 + substituteInPlace $out/bin/$(basename --suffix ".sh" "$file") \ 49 + --replace-fail AMAZON_EC2_NET_UTILS_LIBDIR $out/share/amazon-ec2-net-utils 50 + done 51 + 52 + substituteInPlace $out/bin/setup-policy-routes \ 53 + --replace-fail /lib/systemd ${systemd}/lib/systemd 54 + 55 + wrapProgram $out/bin/setup-policy-routes \ 56 + --prefix PATH : ${ 57 + lib.makeBinPath [ 58 + coreutils 59 + # bin/setup-policy-roots.sh sources lib/lib.sh which needs these. 60 + # 61 + # lib/lib.sh isn't executable so we can't use it with wrapProgram. 62 + curl 63 + gnugrep 64 + gnused 65 + iproute2 66 + systemd 67 + util-linux 68 + ] 69 + } 70 + 71 + for file in lib/*.sh; do 72 + install -D -m 644 -t $out/share/amazon-ec2-net-utils "$file" 73 + done 74 + 75 + substituteInPlace $out/share/amazon-ec2-net-utils/lib.sh \ 76 + --replace-fail /usr/lib/systemd $out/lib/systemd 77 + 78 + for file in udev/*.rules; do 79 + install -D -m 644 -t $out/lib/udev/rules.d "$file" 80 + done 81 + 82 + substituteInPlace $out/lib/udev/rules.d/99-vpc-policy-routes.rules \ 83 + --replace-fail /usr/bin/systemctl ${lib.getExe' systemd "systemctl"} 84 + 85 + for file in systemd/network/*.network; do 86 + install -D -m 644 -t $out/lib/systemd/network "$file" 87 + done 88 + 89 + for file in systemd/system/*.{service,timer}; do 90 + install -D -m 644 -t $out/lib/systemd/system "$file" 91 + done 92 + 93 + substituteInPlace $out/lib/systemd/system/policy-routes@.service \ 94 + --replace-fail /usr/bin/setup-policy-routes $out/bin/setup-policy-routes 95 + 96 + substituteInPlace $out/lib/systemd/system/refresh-policy-routes@.service \ 97 + --replace-fail /usr/bin/setup-policy-routes $out/bin/setup-policy-routes 98 + 99 + installManPage doc/*.8 100 + 101 + runHook postInstall 102 + ''; 103 + 104 + outputs = [ 105 + "out" 106 + "man" 107 + ]; 108 + 109 + passthru = { 110 + updateScript = nix-update-script { }; 111 + }; 112 + 113 + meta = { 114 + description = "Contains a set of utilities for managing elastic network interfaces on Amazon EC2"; 115 + homepage = "https://github.com/amazonlinux/amazon-ec2-net-utils"; 116 + license = lib.licenses.asl20; 117 + platforms = lib.platforms.linux; 118 + maintainers = with lib.maintainers; [ sielicki ]; 119 + }; 120 + }