about summary refs log tree commit diff
path: root/nixpkgs/pkgs/os-specific/linux/sysvinit/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/os-specific/linux/sysvinit/default.nix
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/sysvinit/default.nix')
-rw-r--r--nixpkgs/pkgs/os-specific/linux/sysvinit/default.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/sysvinit/default.nix b/nixpkgs/pkgs/os-specific/linux/sysvinit/default.nix
new file mode 100644
index 000000000000..7f84e1cc9b41
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/sysvinit/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchurl, withoutInitTools ? false }:
+
+let version = "2.89"; in
+
+stdenv.mkDerivation {
+  name = (if withoutInitTools then "sysvtools" else "sysvinit") + "-" + version;
+
+  src = fetchurl {
+    url = "mirror://savannah/sysvinit/sysvinit-${version}.tar.bz2";
+    sha256 = "0rdw5lgg2rpcfdmq90br388qr01w89vsqmpvrqcqjqsmxk9zw3c2";
+  };
+
+  prePatch = ''
+    # Patch some minimal hard references, so halt/shutdown work
+    sed -i -e "s,/sbin/,$out/sbin/," src/halt.c src/init.c src/paths.h
+  '';
+
+  makeFlags = [ "SULOGINLIBS=-lcrypt" "ROOT=$(out)" "MANDIR=/share/man" ];
+
+  preInstall =
+    ''
+      substituteInPlace src/Makefile --replace /usr /
+    '';
+
+  postInstall = ''
+    mv $out/sbin/killall5 $out/bin
+    ln -sf killall5 $out/bin/pidof
+  ''
+    + stdenv.lib.optionalString withoutInitTools
+    ''
+      shopt -s extglob
+      rm -rf $out/sbin/!(sulogin)
+      rm -rf $out/include
+      rm -rf $out/share/man/man5
+      rm $(for i in $out/share/man/man8/*; do echo $i; done | grep -v 'pidof\|killall5')
+      rm $out/bin/wall $out/share/man/man1/wall.1
+    '';
+
+  meta = {
+    homepage = https://www.nongnu.org/sysvinit/;
+    description = "Utilities related to booting and shutdown";
+    platforms = stdenv.lib.platforms.linux;
+    license = stdenv.lib.licenses.gpl2Plus;
+  };
+}