···1+{ lib, stdenv, fetchFromGitHub, pkg-config
2+, linux-pam, libxcrypt
3+}:
4+5+stdenv.mkDerivation rec {
6+ pname = "tcb";
7+ version = "1.2";
8+9+ src = fetchFromGitHub {
10+ owner = "openwall";
11+ repo = pname;
12+ rev = "070cf4aa784de13c52788ac22ff611d7cbca0854";
13+ sha256 = "sha256-Sp5u7iTEZZnAqKQXoPO8eWpSkZeBzQqZI82wRQmgU9A=";
14+ };
15+16+ outputs = [ "out" "bin" "dev" "man" ];
17+18+ nativeBuildInputs = [ pkg-config ];
19+20+ buildInputs = [ linux-pam libxcrypt ];
21+22+ patches = [ ./fix-makefiles.patch ];
23+24+ postPatch = ''
25+ substituteInPlace Make.defs \
26+ --replace "PREFIX = /usr" "PREFIX = $out" \
27+ --replace "SBINDIR = /sbin" "SBINDIR = $bin/bin" \
28+ --replace "INCLUDEDIR = \$(PREFIX)/include" "INCLUDEDIR = $dev/include"
29+ '';
30+31+ meta = with lib; {
32+ description = "Alternative password shadowing scheme";
33+ longDescription = ''
34+ The tcb package contains core components of our tcb suite implementing the alternative
35+ password shadowing scheme on Openwall GNU Linux (Owl). It is being made available
36+ separately from Owl primarily for use by other distributions.
37+38+ The package consists of three components: pam_tcb, libnss_tcb, and libtcb.
39+40+ pam_tcb is a PAM module which supersedes pam_unix. It also implements the tcb password
41+ shadowing scheme. The tcb scheme allows many core system utilities (passwd(1) being
42+ the primary example) to operate with little privilege. libnss_tcb is the accompanying
43+ NSS module. libtcb contains code shared by the PAM and NSS modules and is also used
44+ by user management tools on Owl due to our shadow suite patches.
45+ '';
46+ homepage = "https://www.openwall.com/tcb/";
47+ license = licenses.bsd3;
48+ platforms = platforms.linux;
49+ maintainers = with maintainers; [ izorkin ];
50+ };
51+}