2010-06-09 23:48:51 +02:00
|
|
|
{ stdenv, fetchurl, withoutInitTools ? false }:
|
|
|
|
|
|
|
|
let version = "2.88dsf"; in
|
2004-02-16 15:09:55 +01:00
|
|
|
|
2004-03-29 19:23:01 +02:00
|
|
|
stdenv.mkDerivation {
|
2010-06-09 23:48:51 +02:00
|
|
|
name = (if withoutInitTools then "sysvtools" else "sysvinit") + "-" + version;
|
|
|
|
|
2004-02-16 15:09:55 +01:00
|
|
|
src = fetchurl {
|
2010-08-21 18:58:18 +02:00
|
|
|
url = "mirror://savannah/sysvinit/sysvinit-${version}.tar.bz2";
|
2010-06-09 23:48:51 +02:00
|
|
|
sha256 = "068mvzaz808a673zigyaqb63xc8bndh2klk16zi5c83rw70wifv0";
|
|
|
|
};
|
|
|
|
|
2010-11-26 15:34:29 +01:00
|
|
|
prePatch = ''
|
|
|
|
# Patch some minimal hard references, so halt/shutdown work
|
2010-11-26 21:08:14 +01:00
|
|
|
sed -i -e "s,/sbin/,$out/sbin/," src/halt.c src/init.c src/paths.h
|
2010-11-26 15:34:29 +01:00
|
|
|
'';
|
2010-06-09 23:48:51 +02:00
|
|
|
|
|
|
|
makeFlags = "SULOGINLIBS=-lcrypt ROOT=$(out) MANDIR=/share/man";
|
|
|
|
|
2010-11-23 21:47:23 +01:00
|
|
|
crossAttrs = {
|
|
|
|
makeFlags = "SULOGINLIBS=-lcrypt ROOT=$(out) MANDIR=/share/man CC=${stdenv.cross.config}-gcc";
|
|
|
|
};
|
|
|
|
|
2010-06-09 23:48:51 +02:00
|
|
|
preInstall =
|
|
|
|
''
|
|
|
|
substituteInPlace src/Makefile --replace /usr /
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = stdenv.lib.optionalString withoutInitTools
|
|
|
|
''
|
|
|
|
mv $out/sbin/killall5 $out/bin
|
|
|
|
ln -sf killall5 $out/bin/pidof
|
|
|
|
rm -rf $out/sbin
|
|
|
|
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')
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://www.nongnu.org/sysvinit/;
|
|
|
|
description = "Utilities related to booting and shutdown";
|
2004-02-16 15:09:55 +01:00
|
|
|
};
|
|
|
|
}
|