13 inetutils, # for telnet
20 # we cannot use resholve.mkDerivation yet - the scripts are too hairy, although it might be possible
21 # to do them bit by bit
32 # The installer executes ping to figure out how to call it and then sets the full path to the
33 # binary. This script "handles" it by pretending everything is OK and has very much not been
35 wrappedPing = writeShellScriptBin "ping" ''
36 for b in /run/wrappers/bin/ping /usr/bin/ping /usr/local/bin/ping; do
42 # we are inside the installer. Pretend everything is OK so the installer will set the path to
43 # this wrapper as the ping program
47 # executables that need additional directories on their PATHs
49 hlogin = [ (placeholder "out") ];
50 ulogin = [ (placeholder "out") ];
57 stdenv.mkDerivation (finalAttrs: {
61 src = fetchFromGitHub {
64 rev = "v" + replaceStrings [ "." ] [ "_" ] finalAttrs.version;
65 hash = "sha256-TAeOSwdDhP06OSV0en/hMVF3qWVwJUsiqt97rdgtAzE=";
71 substituteInPlace configure.ac \
72 --replace 'm4_esyscmd(configure.vers package_name),' ${finalAttrs.pname}, \
73 --replace 'm4_esyscmd(configure.vers package_version),' ${finalAttrs.version},
75 substituteInPlace etc/rancid.conf.sample.in \
76 --replace @ENV_PATH@ ${
91 for f in bin/*.in; do \
92 if grep -q /usr/bin/tail $f ; then
93 substituteInPlace $f --replace /usr/bin/tail ${coreutils}/bin/tail
97 substituteInPlace bin/par.c \
98 --replace '"sh"' '"${runtimeShell}"'
100 substituteInPlace bin/rancid-run.in \
101 --replace '>$LOGDIR/$GROUP.`date +%Y%m%d.%H%M%S` 2>&1' ' ' \
102 --replace 'perl ' '${getExe perl} ' \
103 --replace 'sh ' '${runtimeShell} ' \
104 --replace '"control_rancid ' '"${placeholder "out"}/bin/control_rancid ' \
106 substituteInPlace bin/control_rancid.in \
107 --replace "'rancid-fe " "'${placeholder "out"}/bin/rancid-fe "
110 enableParallelBuilding = true;
112 nativeBuildInputs = [
126 postInstall = concatStringsSep "\n" (
127 mapAttrsToList (n: v: ''
128 mkdir -p $out/libexec
129 mv $out/bin/${n} $out/libexec/
130 makeWrapper $out/libexec/${n} $out/bin/${n} \
131 --prefix PATH : ${makeBinPath v}
136 description = "Really Awesome New Cisco confIg Differ";
138 RANCID monitors a device's configuration, including software and hardware
139 and uses a VCS to maintain history of changes.
141 homepage = "https://shrubbery.net/rancid/";
142 license = licenses.bsd3;
143 maintainers = with maintainers; [ peterhoeg ];
144 platforms = platforms.linux;