2021-01-15 10:19:50 +01:00
|
|
|
{ lib, stdenv, fetchurl }:
|
2017-05-06 19:35:11 +02:00
|
|
|
|
2021-01-15 10:19:50 +01:00
|
|
|
with lib;
|
2017-05-06 19:35:11 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "socklog";
|
2017-05-06 19:35:11 +02:00
|
|
|
version = "2.1.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://smarden.org/socklog/socklog-${version}.tar.gz";
|
|
|
|
sha256 = "0mdlmhiq2j2fip7c4l669ams85yc3c1s1d89am7dl170grw9m1ma";
|
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "admin/socklog-${version}";
|
|
|
|
|
|
|
|
outputs = [ "out" "man" "doc" ];
|
|
|
|
|
2017-05-11 20:34:34 +02:00
|
|
|
postPatch = ''
|
2017-09-13 18:21:31 +02:00
|
|
|
# Fails to run as user without supplementary groups
|
2017-09-13 18:03:51 +02:00
|
|
|
echo "int main() { return 0; }" >src/chkshsgr.c
|
2017-09-13 18:21:31 +02:00
|
|
|
|
|
|
|
# Fixup implicit function declarations
|
|
|
|
sed -i src/pathexec_run.c -e '1i#include <unistd.h>'
|
|
|
|
sed -i src/prot.c -e '1i#include <unistd.h>' -e '2i#include <grp.h>'
|
|
|
|
sed -i src/seek_set.c -e '1i#include <unistd.h>'
|
2017-05-11 20:34:34 +02:00
|
|
|
'';
|
|
|
|
|
2017-05-06 19:35:11 +02:00
|
|
|
configurePhase = ''
|
|
|
|
echo "$NIX_CC/bin/cc $NIX_CFLAGS_COMPILE" >src/conf-cc
|
|
|
|
echo "$NIX_CC/bin/cc -s" >src/conf-ld
|
|
|
|
'';
|
|
|
|
|
2021-01-24 10:19:10 +01:00
|
|
|
buildPhase = "package/compile";
|
2017-05-06 19:35:11 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mv command"/"* $out/bin
|
|
|
|
|
|
|
|
for i in {1,8} ; do
|
|
|
|
mkdir -p $man/share/man/man$i
|
|
|
|
mv man"/"*.$i $man/share/man/man$i
|
|
|
|
done
|
|
|
|
|
2017-07-10 13:47:52 +02:00
|
|
|
mkdir -p $doc/share/doc/socklog/html
|
|
|
|
mv doc/*.html $doc/share/doc/socklog/html/
|
2017-05-06 19:35:11 +02:00
|
|
|
'';
|
|
|
|
|
2021-01-24 10:19:10 +01:00
|
|
|
checkPhase = "package/check";
|
2017-05-06 19:35:11 +02:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
meta = {
|
2022-05-28 15:22:26 +02:00
|
|
|
broken = stdenv.isDarwin;
|
2017-05-06 19:35:11 +02:00
|
|
|
description = "System and kernel logging services";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://smarden.org/socklog/";
|
2017-05-06 19:35:11 +02:00
|
|
|
license = licenses.publicDomain;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.joachifm ];
|
|
|
|
};
|
|
|
|
}
|