summary refs log tree commit diff
path: root/pkgs/os-specific/linux/autofs/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/autofs/default.nix')
-rw-r--r--pkgs/os-specific/linux/autofs/default.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/autofs/default.nix b/pkgs/os-specific/linux/autofs/default.nix
new file mode 100644
index 00000000000..3a8aa08d8a3
--- /dev/null
+++ b/pkgs/os-specific/linux/autofs/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, flex, bison, linuxHeaders }:
+
+let
+  version = "5.1.1";
+  name = "autofs-${version}";
+in stdenv.mkDerivation {
+  inherit name;
+
+  src = fetchurl {
+    url = "mirror://kernel/linux/daemons/autofs/v5/${name}.tar.xz";
+    sha256 = "1hr1f11wp538h7r298wpa5khfkhfs8va3p1kdixxhrgkkzpz13z0";
+  };
+
+  preConfigure = ''
+    configureFlags="--disable-move-mount --with-path=$PATH"
+    export MOUNT=/var/run/current-system/sw/bin/mount
+    export UMOUNT=/var/run/current-system/sw/bin/umount
+    export MODPROBE=/var/run/current-system/sw/bin/modprobe
+    # Grrr, rpcgen can't find cpp. (NIXPKGS-48)
+    mkdir rpcgen
+    echo "#! $shell" > rpcgen/rpcgen
+    echo "exec $(type -tp rpcgen) -Y $(dirname $(type -tp cpp)) \"\$@\"" >> rpcgen/rpcgen
+    chmod +x rpcgen/rpcgen
+    export RPCGEN=$(pwd)/rpcgen/rpcgen
+  '';
+
+  installPhase = ''
+    make install SUBDIRS="lib daemon modules man" # all but samples
+    #make install SUBDIRS="samples" # impure!
+  '';
+
+  buildInputs = [ flex bison linuxHeaders ];
+
+  meta = {
+    inherit version;
+    description = "Kernel-based automounter";
+    homepage = http://www.linux-consulting.com/Amd_AutoFS/autofs.html;
+    license = stdenv.lib.licenses.gpl2;
+    executables = [ "automount" ];
+  };
+}