12 , inetutils # for telnet
19 # we cannot use resholve.mkDerivation yet - the scripts are too hairy, although it might be possible
20 # to do them bit by bit
24 concatStringsSep getExe makeBinPath mapAttrsToList replaceStrings;
26 # The installer executes ping to figure out how to call it and then sets the full path to the
27 # binary. This script "handles" it by pretending everything is OK and has very much not been
29 wrappedPing = writeShellScriptBin "ping" ''
30 for b in /run/wrappers/bin/ping /usr/bin/ping /usr/local/bin/ping; do
36 # we are inside the installer. Pretend everything is OK so the installer will set the path to
37 # this wrapper as the ping program
41 # executables that need additional directories on their PATHs
43 hlogin = [ (placeholder "out") ];
44 ulogin = [ (placeholder "out") ];
51 stdenv.mkDerivation (finalAttrs: {
55 src = fetchFromGitHub {
58 rev = "v" + replaceStrings [ "." ] [ "_" ] finalAttrs.version;
59 hash = "sha256-TAeOSwdDhP06OSV0en/hMVF3qWVwJUsiqt97rdgtAzE=";
65 substituteInPlace configure.ac \
66 --replace 'm4_esyscmd(configure.vers package_name),' ${finalAttrs.pname}, \
67 --replace 'm4_esyscmd(configure.vers package_version),' ${finalAttrs.version},
69 substituteInPlace etc/rancid.conf.sample.in \
70 --replace @ENV_PATH@ ${makeBinPath [ "/run/wrappers" (placeholder "out") coreutils git gnugrep gnused openssh perl runtimeShell telnet' ]}
72 for f in bin/*.in; do \
73 if grep -q /usr/bin/tail $f ; then
74 substituteInPlace $f --replace /usr/bin/tail ${coreutils}/bin/tail
78 substituteInPlace bin/par.c \
79 --replace '"sh"' '"${runtimeShell}"'
81 substituteInPlace bin/rancid-run.in \
82 --replace '>$LOGDIR/$GROUP.`date +%Y%m%d.%H%M%S` 2>&1' ' ' \
83 --replace 'perl ' '${getExe perl} ' \
84 --replace 'sh ' '${runtimeShell} ' \
85 --replace '"control_rancid ' '"${placeholder "out"}/bin/control_rancid ' \
87 substituteInPlace bin/control_rancid.in \
88 --replace "'rancid-fe " "'${placeholder "out"}/bin/rancid-fe "
91 enableParallelBuilding = true;
93 nativeBuildInputs = [ autoreconfHook libtool makeBinaryWrapper wrappedPing ];
95 buildInputs = [ expect openssh perl telnet' ];
97 postInstall = concatStringsSep "\n" (mapAttrsToList
100 mv $out/bin/${n} $out/libexec/
101 makeWrapper $out/libexec/${n} $out/bin/${n} \
102 --prefix PATH : ${makeBinPath v}
107 description = "Really Awesome New Cisco confIg Differ";
109 RANCID monitors a device's configuration, including software and hardware
110 and uses a VCS to maintain history of changes.
112 homepage = "https://shrubbery.net/rancid/";
113 license = licenses.bsd3;
114 maintainers = with maintainers; [ peterhoeg ];
115 platforms = platforms.linux;