@@ -1,27 +1,30 @@
1{ stdenv, buildPackages, fetchurl, which, autoconf, automake, flex
1{ stdenv, buildPackages, fetchurl, which, autoconf, automake, flex
2−, yacc , glibc, perl, kerberos, libxslt, docbook_xsl
2+, yacc , glibc, perl, kerberos, libxslt, docbook_xsl, file
3−, docbook_xml_dtd_43 , libtool_2, removeReferencesTo
3+, docbook_xml_dtd_43, libtool_2
4+, withDevdoc ? false, doxygen, dblatex # Extra developer documentation
4−, ncurses # Extra ncurses utilities. Only needed for debugging.
5+, ncurses # Extra ncurses utilities. Needed for debugging and monitoring.
5, tsmbac ? null # Tivoli Storage Manager Backup Client from IBM
6, tsmbac ? null # Tivoli Storage Manager Backup Client from IBM
8with (import ./srcs.nix { inherit fetchurl; });
9with (import ./srcs.nix { inherit fetchurl; });
11+ inherit (stdenv.lib) optional optionalString optionals;
10−stdenv.mkDerivation {
13+in stdenv.mkDerivation {
11 pname = "openafs";
14 pname = "openafs";
12 inherit version srcs;
15 inherit version srcs;
14 depsBuildBuild = [ buildPackages.stdenv.cc ];
17 depsBuildBuild = [ buildPackages.stdenv.cc ];
15 nativeBuildInputs = [ autoconf automake flex libxslt libtool_2 perl
18 nativeBuildInputs = [ autoconf automake flex libxslt libtool_2 perl
16− removeReferencesTo which yacc ];
19+ which yacc ] ++ optionals withDevdoc [ doxygen dblatex ];
18 buildInputs = [ kerberos ncurses ];
21 buildInputs = [ kerberos ncurses ];
20− patches = [ ./bosserver.patch ./cross-build.patch ] ++ stdenv.lib.optional (tsmbac != null) ./tsmbac.patch;
23+ patches = [ ./bosserver.patch ./cross-build.patch ] ++ optional (tsmbac != null) ./tsmbac.patch;
22− outputs = [ "out" "dev" "man" "doc" "server" ];
25+ outputs = [ "out" "dev" "man" "doc" ] ++ optional withDevdoc "devdoc";
24− enableParallelBuilding = true;
27+ enableParallelBuilding = false;
26 setOutputFlags = false;
29 setOutputFlags = false;
@@ -44,19 +47,19 @@ stdenv.mkDerivation {
45 ./regen.sh
48 ./regen.sh
47 configureFlagsArray=(
51 configureFlagsArray=(
48 "--with-gssapi"
52 "--with-gssapi"
49 "--sysconfdir=/etc"
53 "--sysconfdir=/etc"
50 "--localstatedir=/var"
54 "--localstatedir=/var"
51 "--disable-kernel-module"
55 "--disable-kernel-module"
52 "--disable-fuse-client"
56 "--disable-fuse-client"
53− "--with-html-xsl=${docbook_xsl}/share/xml/docbook-xsl/html/chunk.xsl"
57+ "--with-docbook-stylesheets=${docbook_xsl}/share/xml/docbook-xsl"
54− ${stdenv.lib.optionalString (tsmbac != null) "--enable-tivoli-tsm"}
58+ ${optionalString (tsmbac != null) "--enable-tivoli-tsm"}
55− ${stdenv.lib.optionalString (ncurses == null) "--disable-gtx"}
59+ ${optionalString (ncurses == null) "--disable-gtx"}
56 "--disable-linux-d_splice-alias-extra-iput"
60 "--disable-linux-d_splice-alias-extra-iput"
57− "--libexecdir=$server/libexec"
59− '' + stdenv.lib.optionalString (tsmbac != null) ''
62+ '' + optionalString (tsmbac != null) ''
60 export XBSA_CFLAGS="-Dxbsa -DNEW_XBSA -I${tsmbac}/lib64/sample -DXBSA_TSMLIB=\\\"${tsmbac}/lib64/libApiTSM64.so\\\""
63 export XBSA_CFLAGS="-Dxbsa -DNEW_XBSA -I${tsmbac}/lib64/sample -DXBSA_TSMLIB=\\\"${tsmbac}/lib64/libApiTSM64.so\\\""
61 export XBSA_XLIBS="-ldl"
64 export XBSA_XLIBS="-ldl"
@@ -67,24 +70,28 @@ stdenv.mkDerivation {
67 for d in doc/xml/{AdminGuide,QuickStartUnix,UserGuide}; do
70 for d in doc/xml/{AdminGuide,QuickStartUnix,UserGuide}; do
68 make -C "''${d}" index.html
71 make -C "''${d}" index.html
73+ '' + optionalString withDevdoc ''
72 postInstall = ''
77 postInstall = ''
73 mkdir -p $doc/share/doc/openafs/{AdminGuide,QuickStartUnix,UserGuide}
78 mkdir -p $doc/share/doc/openafs/{AdminGuide,QuickStartUnix,UserGuide}
74− cp -r doc/{pdf,protocol,txt} README LICENSE $doc/share/doc/openafs
79+ cp -r doc/txt README LICENSE $doc/share/doc/openafs
75 for d in AdminGuide QuickStartUnix UserGuide ; do
80 for d in AdminGuide QuickStartUnix UserGuide ; do
76 cp "doc/xml/''${d}"/*.html "$doc/share/doc/openafs/''${d}"
81 cp "doc/xml/''${d}"/*.html "$doc/share/doc/openafs/''${d}"
79 rm -r $out/lib/openafs
84 rm -r $out/lib/openafs
85+ '' + optionalString withDevdoc ''
86+ mkdir -p $devdoc/share/devhelp/openafs/doxygen
87+ cp -r doc/{pdf,protocol} $devdoc/share/devhelp/openafs
88+ cp -r doc/doxygen/output/html $devdoc/share/devhelp/openafs/doxygen
82 # Avoid references to $TMPDIR by removing it and let patchelf cleanup the
91 # Avoid references to $TMPDIR by removing it and let patchelf cleanup the
83 # binaries.
92 # binaries.
84 preFixup = ''
93 preFixup = ''
85 rm -rf "$(pwd)" && mkdir "$(pwd)"
94 rm -rf "$(pwd)" && mkdir "$(pwd)"
87− find $out -type f -exec remove-references-to -t $server '{}' '+'
90 meta = with stdenv.lib; {
97 meta = with stdenv.lib; {