2021-01-15 06:45:37 -08:00
|
|
|
{ lib, stdenv, fetchurl, withoutInitTools ? false }:
|
2010-06-09 14:48:51 -07:00
|
|
|
|
2020-07-10 21:23:28 -07:00
|
|
|
let version = "2.97"; in
|
2004-02-16 06:09:55 -08:00
|
|
|
|
2004-03-29 09:23:01 -08:00
|
|
|
stdenv.mkDerivation {
|
2010-06-09 14:48:51 -07:00
|
|
|
name = (if withoutInitTools then "sysvtools" else "sysvinit") + "-" + version;
|
2013-01-08 09:11:56 -08:00
|
|
|
|
2004-02-16 06:09:55 -08:00
|
|
|
src = fetchurl {
|
2018-12-03 22:55:04 -08:00
|
|
|
url = "mirror://savannah/sysvinit/sysvinit-${version}.tar.xz";
|
2020-07-10 21:23:28 -07:00
|
|
|
sha256 = "042iyayyh3j28vfbypzn822b73r3nfmyn79f9mixigqrfn2rcn9d";
|
2010-06-09 14:48:51 -07:00
|
|
|
};
|
2013-01-08 09:11:56 -08:00
|
|
|
|
2010-11-26 06:34:29 -08:00
|
|
|
prePatch = ''
|
|
|
|
# Patch some minimal hard references, so halt/shutdown work
|
2010-11-26 12:08:14 -08:00
|
|
|
sed -i -e "s,/sbin/,$out/sbin/," src/halt.c src/init.c src/paths.h
|
2010-11-26 06:34:29 -08:00
|
|
|
'';
|
2010-06-09 14:48:51 -07:00
|
|
|
|
2017-06-28 13:43:18 -07:00
|
|
|
makeFlags = [ "SULOGINLIBS=-lcrypt" "ROOT=$(out)" "MANDIR=/share/man" ];
|
2010-11-23 12:47:23 -08:00
|
|
|
|
2010-06-09 14:48:51 -07:00
|
|
|
preInstall =
|
|
|
|
''
|
|
|
|
substituteInPlace src/Makefile --replace /usr /
|
|
|
|
'';
|
|
|
|
|
2013-05-09 06:15:04 -07:00
|
|
|
postInstall = ''
|
|
|
|
mv $out/sbin/killall5 $out/bin
|
|
|
|
ln -sf killall5 $out/bin/pidof
|
|
|
|
''
|
2021-01-15 06:45:37 -08:00
|
|
|
+ lib.optionalString withoutInitTools
|
2013-01-08 09:11:56 -08:00
|
|
|
''
|
|
|
|
shopt -s extglob
|
|
|
|
rm -rf $out/sbin/!(sulogin)
|
2010-06-09 14:48:51 -07:00
|
|
|
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')
|
2018-08-09 12:25:11 -07:00
|
|
|
rm $out/bin/wall $out/share/man/man1/wall.1
|
2010-06-09 14:48:51 -07:00
|
|
|
'';
|
2013-01-08 09:11:56 -08:00
|
|
|
|
2010-06-09 14:48:51 -07:00
|
|
|
meta = {
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://www.nongnu.org/sysvinit/";
|
2010-06-09 14:48:51 -07:00
|
|
|
description = "Utilities related to booting and shutdown";
|
2021-01-15 06:45:37 -08:00
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
license = lib.licenses.gpl2Plus;
|
2004-02-16 06:09:55 -08:00
|
|
|
};
|
|
|
|
}
|