1{ lib
2, stdenv
3, fetchFromGitLab
4, openldap
5, libkrb5
6, libxslt
7, autoreconfHook
8, pkg-config
9, cyrus_sasl
10, util-linux
11, xmlto
12, docbook_xsl
13, docbook_xml_dtd_43
14}:
15
16stdenv.mkDerivation rec {
17 pname = "adcli";
18 version = "0.9.2";
19
20 src = fetchFromGitLab {
21 domain = "gitlab.freedesktop.org";
22 owner = "realmd";
23 repo = pname;
24 rev = version;
25 sha256 = "sha256-dipNKlIdc1DpXLg/YJjUxZlNoMFy+rt8Y/+AfWFA4dE=";
26 };
27
28 nativeBuildInputs = [
29 autoreconfHook
30 pkg-config
31 docbook_xsl
32 util-linux
33 xmlto
34 ];
35
36 buildInputs = [
37 openldap
38 libkrb5
39 libxslt
40 cyrus_sasl
41 ];
42
43 configureFlags = [ "--disable-debug" ];
44
45 postPatch = ''
46 substituteInPlace tools/Makefile.am \
47 --replace 'sbin_PROGRAMS' 'bin_PROGRAMS'
48
49 substituteInPlace doc/Makefile.am \
50 --replace 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl' \
51 '${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl'
52
53 function patch_docbook() {
54 substituteInPlace $1 \
55 --replace "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" \
56 "${docbook_xml_dtd_43}/xml/dtd/docbook/docbookx.dtd"
57 }
58 patch_docbook doc/adcli.xml
59 patch_docbook doc/adcli-devel.xml
60 patch_docbook doc/adcli-docs.xml
61 '';
62
63 meta = with lib; {
64 homepage = "https://www.freedesktop.org/software/realmd/adcli/adcli.html";
65 description = "A helper library and tools for Active Directory client operations.";
66 mainProgram = "adcli";
67 license = licenses.lgpl21Only;
68 maintainers = with maintainers; [ SohamG anthonyroussel ];
69 platforms = platforms.linux;
70 };
71}