Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchurl, pcre, libxcrypt }: 2 3stdenv.mkDerivation { 4 pname = "leafnode"; 5 version = "2.0.0.alpha20121101a.12"; 6 7 src = fetchurl { 8 url = "http://home.pages.de/~mandree/leafnode/beta/leafnode-2.0.0.alpha20121101a.tar.bz2"; 9 sha256 = "096w4gxj08m3vwmyv4sxpmbl8dn6mzqfmrhc32jgyca6qzlrdin8"; 10 }; 11 12 configureFlags = [ "--enable-runas-user=nobody" ]; 13 14 prePatch = '' 15 substituteInPlace Makefile.in --replace 02770 0770 16 ''; 17 18 preConfigure = '' 19 # configure uses id to check environment; we don't want this check 20 sed -re 's/^ID[=].*/ID="echo whatever"/' -i configure 21 ''; 22 23 postConfigure = '' 24 # The is_validfqdn is far too restrictive, and only allows 25 # Internet-facing servers to run. In order to run leafnode via 26 # localhost only, we need to disable this check. 27 sed -i validatefqdn.c -e 's/int is_validfqdn(const char \*f) {/int is_validfqdn(const char *f) { return 1;/;' 28 ''; 29 30 buildInputs = [ pcre libxcrypt ]; 31 32 meta = { 33 homepage = "http://leafnode.sourceforge.net/"; 34 description = "Implementation of a store & forward NNTP proxy"; 35 license = lib.licenses.mit; 36 platforms = lib.platforms.unix; 37 }; 38}