1{
2 lib,
3 stdenv,
4 fetchurl,
5}:
6
7stdenv.mkDerivation rec {
8 pname = "sysklogd";
9 version = "1.5.1";
10
11 src = fetchurl {
12 url = "http://www.infodrom.org/projects/sysklogd/download/sysklogd-${version}.tar.gz";
13 sha256 = "00f2wy6f0qng7qzga4iicyzl9j8b7mp6mrpfky5jxj93ms2w2rji";
14 };
15
16 patches = [
17 ./systemd.patch
18 ./union-wait.patch
19 ./fix-includes-for-musl.patch
20 ];
21
22 env.NIX_CFLAGS_COMPILE = "-DSYSV";
23
24 installFlags = [
25 "BINDIR=$(out)/sbin"
26 "MANDIR=$(out)/share/man"
27 "INSTALL=install"
28 ];
29
30 makeFlags = [
31 "CC=${stdenv.cc.targetPrefix}cc"
32 ];
33
34 postPatch = ''
35 # Disable stripping during installation, stripping will be done anyway.
36 # Fixes cross-compilation.
37 substituteInPlace Makefile \
38 --replace "-m 500 -s" "-m 500"
39 '';
40
41 preConfigure = ''
42 sed -e 's@-o \''${MAN_USER} -g \''${MAN_GROUP} -m \''${MAN_PERMS} @@' -i Makefile
43 '';
44
45 preInstall = "mkdir -p $out/share/man/man5/ $out/share/man/man8/ $out/sbin";
46
47 meta = with lib; {
48 description = "System logging daemon";
49 platforms = platforms.linux;
50 license = licenses.gpl2Plus;
51 };
52}