2018-10-16 16:44:02 +02:00
|
|
|
{ stdenv, buildPackages, fetchurl, which, autoconf, automake, flex
|
|
|
|
, yacc , glibc, perl, kerberos, libxslt, docbook_xsl
|
|
|
|
, docbook_xml_dtd_43 , libtool_2, removeReferencesTo
|
2018-01-23 19:48:53 +01:00
|
|
|
, ncurses # Extra ncurses utilities. Only needed for debugging.
|
|
|
|
, tsmbac ? null # Tivoli Storage Manager Backup Client from IBM
|
|
|
|
}:
|
2009-11-10 17:00:52 +01:00
|
|
|
|
2018-01-23 19:48:53 +01:00
|
|
|
with (import ./srcs.nix { inherit fetchurl; });
|
2015-09-14 20:59:37 +02:00
|
|
|
|
2018-01-23 19:48:53 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "openafs-${version}";
|
|
|
|
inherit version srcs;
|
2016-03-26 22:53:41 +01:00
|
|
|
|
2018-10-16 16:44:02 +02:00
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
2018-06-30 00:34:35 +02:00
|
|
|
nativeBuildInputs = [ autoconf automake flex libxslt libtool_2 perl
|
|
|
|
removeReferencesTo which yacc ];
|
2015-01-01 17:59:27 +01:00
|
|
|
|
2018-06-30 00:34:35 +02:00
|
|
|
buildInputs = [ kerberos ncurses ];
|
2009-11-10 17:00:52 +01:00
|
|
|
|
2018-10-16 16:44:02 +02:00
|
|
|
patches = [ ./bosserver.patch ./cross-build.patch ] ++ stdenv.lib.optional (tsmbac != null) ./tsmbac.patch;
|
2018-01-23 19:48:53 +01:00
|
|
|
|
2018-06-30 00:34:35 +02:00
|
|
|
outputs = [ "out" "dev" "man" "doc" "server" ];
|
2016-02-12 03:53:54 +01:00
|
|
|
|
2018-06-30 00:34:35 +02:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
setOutputFlags = false;
|
|
|
|
|
|
|
|
# Makefiles don't include install targets for all new shared libs, yet.
|
|
|
|
dontDisableStatic = true;
|
2009-11-10 17:00:52 +01:00
|
|
|
|
2018-10-16 16:44:02 +02:00
|
|
|
# Fixes broken format string in 1.8.2
|
|
|
|
hardeningDisable=[ "format" ];
|
|
|
|
|
2018-06-30 00:34:35 +02:00
|
|
|
preConfigure = ''
|
2011-10-13 14:37:15 +02: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 19:54:51 +02:00
|
|
|
--replace "/usr/include" "${glibc.dev}/include" \
|
2011-10-13 14:37:15 +02:00
|
|
|
--replace "/usr/src" "$TMP"
|
2009-11-10 17:00:52 +01:00
|
|
|
done
|
|
|
|
|
2018-01-23 19:48:53 +01: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 17:00:52 +01:00
|
|
|
./regen.sh
|
|
|
|
|
2011-10-13 14:37:15 +02:00
|
|
|
configureFlagsArray=(
|
2018-06-30 00:34:35 +02:00
|
|
|
"--with-gssapi"
|
2018-01-23 19:48:53 +01: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 05:29:55 +02:00
|
|
|
"--disable-linux-d_splice-alias-extra-iput"
|
2018-06-30 00:34:35 +02:00
|
|
|
"--libexecdir=$server/libexec"
|
2011-10-13 14:37:15 +02:00
|
|
|
)
|
2018-01-23 19:48:53 +01: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
|
2018-06-30 00:34:35 +02:00
|
|
|
make -C "''${d}" index.html
|
2018-01-23 19:48:53 +01:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $doc/share/doc/openafs/{AdminGuide,QuickStartUnix,UserGuide}
|
2018-06-30 00:34:35 +02:00
|
|
|
cp -r doc/{pdf,protocol,txt} README LICENSE $doc/share/doc/openafs
|
2018-01-23 19:48:53 +01:00
|
|
|
for d in AdminGuide QuickStartUnix UserGuide ; do
|
|
|
|
cp "doc/xml/''${d}"/*.html "$doc/share/doc/openafs/''${d}"
|
|
|
|
done
|
|
|
|
|
2018-06-30 00:34:35 +02:00
|
|
|
rm -r $out/lib/openafs
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Avoid references to $TMPDIR by removing it and let patchelf cleanup the
|
|
|
|
# binaries.
|
|
|
|
preFixup = ''
|
|
|
|
rm -rf "$(pwd)" && mkdir "$(pwd)"
|
|
|
|
|
|
|
|
find $out -type f -exec remove-references-to -t $server '{}' '+'
|
2009-11-10 17:00:52 +01:00
|
|
|
'';
|
|
|
|
|
2016-03-26 22:53:41 +01:00
|
|
|
meta = with stdenv.lib; {
|
2018-01-23 19:48:53 +01:00
|
|
|
outputsToInstall = [ "out" "doc" "man" ];
|
2011-10-13 14:37:15 +02:00
|
|
|
description = "Open AFS client";
|
2016-03-26 22:53:41 +01:00
|
|
|
homepage = https://www.openafs.org;
|
|
|
|
license = licenses.ipl10;
|
|
|
|
platforms = platforms.linux;
|
2018-01-23 19:48:53 +01:00
|
|
|
maintainers = [ maintainers.z77z maintainers.spacefrogg ];
|
2009-11-10 17:00:52 +01:00
|
|
|
};
|
|
|
|
}
|