2015-09-14 19:59:37 +01:00
|
|
|
{ stdenv, fetchurl, fetchgit, which, autoconf, automake, flex, yacc,
|
2014-12-30 08:05:12 +00:00
|
|
|
kernel, glibc, ncurses, perl, kerberos }:
|
2009-11-10 16:00:52 +00:00
|
|
|
|
2015-09-14 19:59:37 +01:00
|
|
|
let
|
|
|
|
version = if stdenv.lib.versionAtLeast kernel.version "4.2"
|
|
|
|
then "1.6.14-1-602130"
|
|
|
|
else "1.6.14";
|
|
|
|
in
|
2011-10-13 13:37:15 +01:00
|
|
|
stdenv.mkDerivation {
|
2015-09-14 19:59:37 +01:00
|
|
|
name = "openafs-${version}-${kernel.version}";
|
|
|
|
|
|
|
|
src = if version == "1.6.14-1-602130"
|
|
|
|
# 1.6.14 + patches to run on linux 4.2 that will get into 1.6.15
|
|
|
|
then fetchgit {
|
|
|
|
url = "git://git.openafs.org/openafs.git";
|
|
|
|
rev = "feab09080ec050b3026eff966352b058e2c2295b";
|
|
|
|
sha256 = "03j71c7y487jbjmm6ydr1hw38pf43j2dz153xknndf4x4v21nnp2";
|
|
|
|
}
|
|
|
|
else fetchurl {
|
|
|
|
url = "http://www.openafs.org/dl/openafs/${version}/openafs-${version}-src.tar.bz2";
|
|
|
|
sha256 = "3e62c798a7f982c4f88d85d32e46bee6a47848d207b1e318fe661ce44ae4e01f";
|
|
|
|
};
|
2015-01-01 16:59:27 +00:00
|
|
|
|
2011-10-13 13:37:15 +01:00
|
|
|
buildInputs = [ autoconf automake flex yacc ncurses perl which ];
|
2009-11-10 16:00:52 +00:00
|
|
|
|
2011-10-13 13:37:15 +01:00
|
|
|
preConfigure = ''
|
2015-01-01 16:59:09 +00:00
|
|
|
ln -s "${kernel.dev}/lib/modules/"*/build $TMP/linux
|
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 \
|
|
|
|
--replace "/usr/include" "${glibc}/include" \
|
|
|
|
--replace "/usr/src" "$TMP"
|
2009-11-10 16:00:52 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
./regen.sh
|
|
|
|
|
2015-08-30 04:29:55 +01:00
|
|
|
${stdenv.lib.optionalString (kerberos != null)
|
|
|
|
"export KRB5_CONFIG=${kerberos}/bin/krb5-config"}
|
2009-11-10 16:00:52 +00:00
|
|
|
|
2011-10-13 13:37:15 +01:00
|
|
|
configureFlagsArray=(
|
|
|
|
"--with-linux-kernel-build=$TMP/linux"
|
2015-01-01 08:07:49 +00:00
|
|
|
${stdenv.lib.optionalString (kerberos != null) "--with-krb5"}
|
2011-10-13 13:37:15 +01:00
|
|
|
"--sysconfdir=/etc/static"
|
2015-08-30 04:29:55 +01:00
|
|
|
"--disable-linux-d_splice-alias-extra-iput"
|
2011-10-13 13:37:15 +01:00
|
|
|
)
|
2009-11-10 16:00:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2011-10-13 13:37:15 +01:00
|
|
|
description = "Open AFS client";
|
|
|
|
homepage = http://www.openafs.org;
|
|
|
|
license = stdenv.lib.licenses.ipl10;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2014-09-13 12:51:39 +01:00
|
|
|
maintainers = [ stdenv.lib.maintainers.z77z ];
|
2009-11-10 16:00:52 +00:00
|
|
|
};
|
|
|
|
}
|