1{
2 lib,
3 stdenv,
4 fetchurl,
5 pcre,
6 libxcrypt,
7}:
8
9stdenv.mkDerivation (finalAttrs: {
10 pname = "leafnode";
11 version = "2.0.0.alpha20140727b";
12
13 src = fetchurl {
14 url = "http://krusty.dt.e-technik.tu-dortmund.de/~ma/leafnode/beta/leafnode-${finalAttrs.version}.tar.bz2";
15 sha256 = "sha256-NOuiy7uHG3JMjV3UAtHDWK6yG6QmvrVljhVe0NdGEHU=";
16 };
17
18 configureFlags = [ "--enable-runas-user=nobody" ];
19
20 prePatch = ''
21 substituteInPlace Makefile.in --replace 02770 0770
22 '';
23
24 # configure uses id to check environment; we don't want this check
25 preConfigure = ''
26 sed -re 's/^ID[=].*/ID="echo whatever"/' -i configure
27 '';
28
29 # The is_validfqdn is far too restrictive, and only allows
30 # Internet-facing servers to run. In order to run leafnode via
31 # localhost only, we need to disable this check.
32 postConfigure = ''
33 sed -i validatefqdn.c -e 's/int is_validfqdn(const char \*f) {/int is_validfqdn(const char *f) { return 1;/;'
34 '';
35
36 buildInputs = [
37 pcre
38 libxcrypt
39 ];
40
41 meta = {
42 homepage = "https://leafnode.sourceforge.io/index.shtml";
43 description = "Implementation of a store & forward NNTP proxy, under development";
44 license = lib.licenses.mit;
45 platforms = lib.platforms.unix;
46 maintainers = [ ];
47 };
48})