2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, fetchurl, which, autoconf, automake, flex, yacc
|
2018-01-23 18:48:53 +00:00
|
|
|
, glibc, perl, kerberos, libxslt, docbook_xsl, docbook_xml_dtd_43
|
|
|
|
, ncurses # Extra ncurses utilities. Only needed for debugging.
|
|
|
|
, tsmbac ? null # Tivoli Storage Manager Backup Client from IBM
|
|
|
|
}:
|
2009-11-10 16:00:52 +00:00
|
|
|
|
2018-01-23 18:48:53 +00:00
|
|
|
with (import ./srcs.nix { inherit fetchurl; });
|
2015-09-14 19:59:37 +01:00
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "openafs";
|
2018-01-23 18:48:53 +00:00
|
|
|
inherit version srcs;
|
2016-03-26 21:53:41 +00:00
|
|
|
|
2018-01-23 18:48:53 +00:00
|
|
|
nativeBuildInputs = [ autoconf automake flex yacc perl which libxslt ];
|
2015-01-01 16:59:27 +00:00
|
|
|
|
2016-03-26 21:53:41 +00:00
|
|
|
buildInputs = [ ncurses ];
|
2009-11-10 16:00:52 +00:00
|
|
|
|
2018-01-23 18:48:53 +00:00
|
|
|
patches = stdenv.lib.optional (tsmbac != null) ./tsmbac.patch;
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" "man" "doc" ];
|
2016-02-12 02:53:54 +00:00
|
|
|
|
2011-10-13 13:37:15 +01:00
|
|
|
preConfigure = ''
|
2009-11-10 16:00:52 +00:00
|
|
|
|
2011-10-13 13:37:15 +01:00
|
|
|
patchShebangs .
|
|
|
|
for i in `grep -l -R '/usr/\(include\|src\)' .`; do
|
|
|
|
echo "Patch /usr/include and /usr/src in $i"
|
|
|
|
substituteInPlace $i \
|
2015-04-26 18:54:51 +01:00
|
|
|
--replace "/usr/include" "${glibc.dev}/include" \
|
2011-10-13 13:37:15 +01:00
|
|
|
--replace "/usr/src" "$TMP"
|
2009-11-10 16:00:52 +00:00
|
|
|
done
|
|
|
|
|
2018-01-23 18:48:53 +00:00
|
|
|
for i in ./doc/xml/{AdminGuide,QuickStartUnix,UserGuide}/*.xml; do
|
|
|
|
substituteInPlace "''${i}" --replace "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" \
|
|
|
|
"${docbook_xml_dtd_43}/xml/dtd/docbook/docbookx.dtd"
|
|
|
|
done
|
|
|
|
|
2009-11-10 16:00:52 +00:00
|
|
|
./regen.sh
|
|
|
|
|
2015-08-30 04:29:55 +01:00
|
|
|
${stdenv.lib.optionalString (kerberos != null)
|
2017-12-17 13:51:32 +00:00
|
|
|
"export KRB5_CONFIG=${kerberos.dev}/bin/krb5-config"}
|
2009-11-10 16:00:52 +00:00
|
|
|
|
2018-01-23 18:48:53 +00:00
|
|
|
export AFS_SYSKVERS=26
|
|
|
|
|
2011-10-13 13:37:15 +01:00
|
|
|
configureFlagsArray=(
|
2015-01-01 08:07:49 +00:00
|
|
|
${stdenv.lib.optionalString (kerberos != null) "--with-krb5"}
|
2018-01-23 18:48:53 +00:00
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--disable-kernel-module"
|
|
|
|
"--disable-fuse-client"
|
|
|
|
"--with-html-xsl=${docbook_xsl}/share/xml/docbook-xsl/html/chunk.xsl"
|
|
|
|
${stdenv.lib.optionalString (tsmbac != null) "--enable-tivoli-tsm"}
|
|
|
|
${stdenv.lib.optionalString (ncurses == null) "--disable-gtx"}
|
2015-08-30 04:29:55 +01:00
|
|
|
"--disable-linux-d_splice-alias-extra-iput"
|
2011-10-13 13:37:15 +01:00
|
|
|
)
|
2018-01-23 18:48:53 +00:00
|
|
|
'' + stdenv.lib.optionalString (tsmbac != null) ''
|
|
|
|
export XBSA_CFLAGS="-Dxbsa -DNEW_XBSA -I${tsmbac}/lib64/sample -DXBSA_TSMLIB=\\\"${tsmbac}/lib64/libApiTSM64.so\\\""
|
|
|
|
export XBSA_XLIBS="-ldl"
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildFlags = [ "all_nolibafs" ];
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
for d in doc/xml/{AdminGuide,QuickStartUnix,UserGuide}; do
|
|
|
|
make -C "''${d}" html
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $doc/share/doc/openafs/{AdminGuide,QuickStartUnix,UserGuide}
|
|
|
|
cp -r doc/{arch,examples,pdf,protocol,txt} README NEWS $doc/share/doc/openafs
|
|
|
|
for d in AdminGuide QuickStartUnix UserGuide ; do
|
|
|
|
cp "doc/xml/''${d}"/*.html "$doc/share/doc/openafs/''${d}"
|
|
|
|
done
|
|
|
|
|
|
|
|
rm -r $out/lib/{openafs,afs,*.a}
|
|
|
|
rm $out/bin/kpasswd
|
|
|
|
rm $out/sbin/{kas,kdb,ka-forwarder,kadb_check}
|
|
|
|
rm $out/libexec/openafs/kaserver
|
|
|
|
rm $man/share/man/man{1/kpasswd*,5/kaserver*,8/{ka*,kdb*}}
|
2009-11-10 16:00:52 +00:00
|
|
|
'';
|
|
|
|
|
2016-03-26 21:53:41 +00:00
|
|
|
meta = with stdenv.lib; {
|
2018-01-23 18:48:53 +00:00
|
|
|
outputsToInstall = [ "out" "doc" "man" ];
|
2011-10-13 13:37:15 +01:00
|
|
|
description = "Open AFS client";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.openafs.org";
|
2016-03-26 21:53:41 +00:00
|
|
|
license = licenses.ipl10;
|
|
|
|
platforms = platforms.linux;
|
2019-10-07 15:44:58 +01:00
|
|
|
maintainers = [ maintainers.maggesi maintainers.spacefrogg ];
|
2009-11-10 16:00:52 +00:00
|
|
|
};
|
|
|
|
}
|