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