1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-30 01:20:40 +00:00
nixpkgs/pkgs/servers/openafs/module.nix
Michael Raitza 44a4844744 openafs: Break into multiple packages with multiple outputs
Two packages:
- pkgs.linuxPackages.openafs (only kernel module)
- pkgs.openafs (client/server programs, manpages, docs)

Disable `ncurses` by default
- Only needed for debugging tools

Introduce but disable `tsmbac` by default
- IBM's on-site backup service called Tivoli Storage Manager Backup
  Client
- Make openafs ready to use tsmbac when supplied via local overlay
  (needs special patching)
- TSM is not in nixpkgs due to unclear/unfree licensing. (Binaries need
  to be modified to work with nixos)
2018-02-01 16:21:38 +01:00

58 lines
1.5 KiB
Nix

{ stdenv, fetchurl, which, autoconf, automake, flex, yacc
, kernel, glibc, perl }:
with (import ./srcs.nix { inherit fetchurl; });
let
modDestDir = "$out/lib/modules/${kernel.modDirVersion}/extra/openafs";
kernelBuildDir = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
in stdenv.mkDerivation rec {
name = "openafs-${version}-${kernel.version}";
inherit version src;
nativeBuildInputs = [ autoconf automake flex perl yacc which ] ++ kernel.moduleBuildDependencies;
hardeningDisable = [ "pic" ];
configureFlags = [
"--with-linux-kernel-build=${kernelBuildDir}"
"--sysconfdir=/etc"
"--localstatedir=/var"
"--disable-linux-d_splice-alias-extra-iput"
];
preConfigure = ''
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.dev}/include" \
--replace "/usr/src" "${kernelBuildDir}"
done
./regen.sh -q
'';
buildPhase = ''
make V=1 only_libafs
'';
installPhase = ''
mkdir -p ${modDestDir}
cp src/libafs/MODLOAD-*/libafs-${kernel.version}.* ${modDestDir}/libafs.ko
xz -f ${modDestDir}/libafs.ko
'';
meta = with stdenv.lib; {
description = "Open AFS client kernel module";
homepage = https://www.openafs.org;
license = licenses.ipl10;
platforms = platforms.linux;
maintainers = [ maintainers.z77z maintainers.spacefrogg ];
broken = versionOlder kernel.version "3.18";
};
}