git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #126641 from lovesegfault/389-ds-base-2.0.5
commit47ee68c9e1d4609024f550eb3df5ea68c1a88e70 authorSandro <sandro.jaeckel@gmail.com> dateThu 17 Jun 2021, 01:36 (5 years ago) parent29affb1c97b3d8
1 file changed+120−32
pkgs/servers/ldap/389/default.nix+120−32
pkgs/servers/ldap/389/default.nix+120−32
@@ -1,32 +1,107 @@
1−{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, pkg-config, doxygen, perl, pam, nspr, nss, openldap
2−, db, cyrus_sasl, svrcore, icu, net-snmp, libkrb5, pcre, perlPackages, libevent, openssl, python3
1+{ stdenv
2+, autoreconfHook
3+, fetchFromGitHub
4+, lib
5+
6+, bzip2
7+, cmocka
8+, cracklib
9+, cyrus_sasl
10+, db
11+, doxygen
12+, icu
13+, libevent
14+, libkrb5
15+, lm_sensors
16+, net-snmp
17+, nspr
18+, nss
19+, openldap
20+, openssl
21+, pcre
22+, perl
23+, perlPackages
24+, pkg-config
25+, python3
26+, svrcore
27+, zlib
28+
29+, enablePamPassthru ? true
30+, pam
31+
32+, enableCockpit ? true
33+, rsync
34+
35+, enableDna ? true
36+, enableLdapi ? true
37+, enableAutobind ? false
38+, enableAutoDnSuffix ? false
39+, enableBitwise ? true
40+, enableAcctPolicy ? true
41+, enablePosixWinsync ? true
342}:
443
544stdenv.mkDerivation rec {
645 pname = "389-ds-base";
7− version = "1.3.9.1";
46+ version = "2.0.5";
847
9− src = fetchurl {
10− url = "https://releases.pagure.org/${pname}/${pname}-${version}.tar.bz2";
11− sha256 = "141iv1phgk1lw74sfjj3v7wy6qs0q56lvclwv2p0hqn1wg8ic4q6";
48+ src = fetchFromGitHub {
49+ owner = "389ds";
50+ repo = pname;
51+ rev = "${pname}-${version}";
52+ sha256 = "sha256-H0G8py4sB+2CSZKyCIb2TCIXOpnPx7udWUEK4Tg5TD8=";
1253 };
1354
1455 nativeBuildInputs = [ autoreconfHook pkg-config doxygen ];
56+
1557 buildInputs = [
16− perl pam nspr nss openldap db cyrus_sasl svrcore icu
17− net-snmp libkrb5 pcre libevent openssl python3
18− ] ++ (with perlPackages; [ MozillaLdap NetAddrIP DBFile ]);
19−
20− patches = [
21− (fetchpatch {
22− name = "389-ds-nss.patch";
23− url = "https://aur.archlinux.org/cgit/aur.git/plain/nss.patch?h=389-ds-base&id=b80ed52cc65ff9b1d72f8ebc54dbd462b12f6be9";
24− sha256 = "07z7jl9z4gzhk3k6qyfn558xl76js8041llyr5n99h20ckkbwagk";
25− })
26− ];
58+ bzip2
59+ cracklib
60+ cyrus_sasl
61+ db
62+ icu
63+ libevent
64+ libkrb5
65+ lm_sensors
66+ net-snmp
67+ nspr
68+ nss
69+ openldap
70+ openssl
71+ pcre
72+ perl
73+ python3
74+ svrcore
75+ zlib
76+
77+ # tests
78+ cmocka
79+ libevent
80+
81+ # lib389
82+ (python3.withPackages (ps: with ps; [
83+ setuptools
84+ ldap
85+ six
86+ pyasn1
87+ pyasn1-modules
88+ dateutil
89+ argcomplete
90+ libselinux
91+ ]))
92+
93+ # logconv.pl
94+ perlPackages.DBFile
95+ perlPackages.ArchiveTar
96+ ]
97+ ++ lib.optional enableCockpit rsync
98+ ++ lib.optional enablePamPassthru pam;
99+
27100 postPatch = ''
28101 substituteInPlace Makefile.am \
29102 --replace 's,@perlpath\@,$(perldir),g' 's,@perlpath\@,$(perldir) $(PERLPATH),g'
103+
104+ patchShebangs ./buildnum.py ./ldap/servers/slapd/mkDBErrStrs.py
30105 '';
31106
32107 preConfigure = ''
@@ -38,21 +113,37 @@ stdenv.mkDerivation rec {
38113 export PERLPATH
39114 '';
40115
41− configureFlags = [
42− "--sysconfdir=/etc"
43− "--localstatedir=/var"
44− "--with-openldap"
45− "--with-db"
46− "--with-db-inc=${db.dev}/include"
47− "--with-db-lib=${db.out}/lib"
48− "--with-sasl=${cyrus_sasl.dev}"
49− "--with-netsnmp=yes"
50− "--with-netsnmp-inc=${lib.getDev net-snmp}/include"
51− "--with-netsnmp-lib=${lib.getLib net-snmp}/lib"
52− ];
116+ configureFlags =
117+ let
118+ mkEnable = cond: name: if cond then "--enable-${name}" else "--disable-${name}";
119+ in
120+ [
121+ "--enable-cmocka"
122+ "--localstatedir=/var"
123+ "--sysconfdir=/etc"
124+ "--with-db-inc=${db.dev}/include"
125+ "--with-db-lib=${db.out}/lib"
126+ "--with-db=yes"
127+ "--with-netsnmp-inc=${lib.getDev net-snmp}/include"
128+ "--with-netsnmp-lib=${lib.getLib net-snmp}/lib"
129+ "--with-netsnmp=yes"
130+ "--with-openldap"
131+
132+ "${mkEnable enableCockpit "cockpit"}"
133+ "${mkEnable enablePamPassthru "pam-passthru"}"
134+ "${mkEnable enableDna "dna"}"
135+ "${mkEnable enableLdapi "ldapi"}"
136+ "${mkEnable enableAutobind "autobind"}"
137+ "${mkEnable enableAutoDnSuffix "auto-dn-suffix"}"
138+ "${mkEnable enableBitwise "bitwise"}"
139+ "${mkEnable enableAcctPolicy "acctpolicy"}"
140+ "${mkEnable enablePosixWinsync "posix-winsync"}"
141+ ];
53142
54143 enableParallelBuilding = true;
55144
145+ doCheck = true;
146+
56147 installFlags = [
57148 "sysconfdir=${placeholder "out"}/etc"
58149 "localstatedir=${placeholder "TMPDIR"}"
@@ -65,8 +156,5 @@ stdenv.mkDerivation rec {
65156 description = "Enterprise-class Open Source LDAP server for Linux";
66157 license = licenses.gpl3Plus;
67158 platforms = platforms.linux;
68− knownVulnerabilities = [
69− "CVE-2021-3514" # https://nvd.nist.gov/vuln/detail/CVE-2021-3514
70− ];
71159 };
72160}