1 { lib, stdenv, fetchurl }:
3 stdenv.mkDerivation rec {
8 url = "https://cr.yp.to/ucspi-tcp/ucspi-tcp-${version}.tar.gz";
9 sha256 = "171yl9kfm8w7l17dfxild99mbf877a9k5zg8yysgb1j8nz51a1ja";
12 # Plain upstream tarball doesn't build, get patches from Debian
15 url = "http://ftp.de.debian.org/debian/pool/main/u/ucspi-tcp/ucspi-tcp_0.88-3.diff.gz";
16 sha256 = "0mzmhz8hjkrs0khmkzs5i0s1kgmgaqz07h493bd5jj5fm5njxln6";
21 # Apply Debian patches
23 for fname in debian/diff/*.diff; do
24 echo "Applying patch $fname"
29 # The build system is weird; 'make install' doesn't install anything, instead
30 # it builds an executable called ./install (from C code) which installs
31 # binaries to the directory given on line 1 in ./conf-home.
33 # Also, assume getgroups and setgroups work, instead of doing a build time
34 # test that breaks on NixOS (I think because nixbld users lack CAP_SETGID
37 echo "$out" > conf-home
39 echo "main() { return 0; }" > chkshsgr.c
44 mkdir -p "$out/share/man/man1"
46 # run the newly built installer
49 # Install Debian man pages (upstream has none)
50 cp debian/ucspi-tcp-man/*.1 "$out/share/man/man1"
54 description = "Command-line tools for building TCP client-server applications";
56 tcpserver waits for incoming connections and, for each connection, runs a
57 program of your choice. Your program receives environment variables
58 showing the local and remote host names, IP addresses, and port numbers.
60 tcpserver offers a concurrency limit to protect you from running out of
61 processes and memory. When you are handling 40 (by default) simultaneous
62 connections, tcpserver smoothly defers acceptance of new connections.
64 tcpserver also provides TCP access control features, similar to
65 tcp-wrappers/tcpd's hosts.allow but much faster. Its access control rules
66 are compiled into a hashed format with cdb, so it can easily deal with
67 thousands of different hosts.
69 This package includes a recordio tool that monitors all the input and
72 tcpclient makes a TCP connection and runs a program of your choice. It
73 sets up the same environment variables as tcpserver.
75 This package includes several sample clients built on top of tcpclient:
76 who@, date@, finger@, http@, tcpcat, and mconnect.
78 tcpserver and tcpclient conform to UCSPI, the UNIX Client-Server Program
79 Interface, using the TCP protocol. UCSPI tools are available for several
82 homepage = "http://cr.yp.to/ucspi-tcp.html";
83 license = licenses.publicDomain;
84 platforms = platforms.linux;
85 maintainers = [ maintainers.bjornfor ];