summary refs log tree commit diff
path: root/pkgs/os-specific/linux/open-iscsi/default.nix
blob: 4805543130484f182b4401cbaad446c36899d0d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ stdenv, fetchFromGitHub, automake, autoconf, libtool, gettext, utillinux, openisns, openssl, kmod }:
stdenv.mkDerivation rec {
  name = "open-iscsi-${version}";
  version = "2.0-873-${stdenv.lib.substring 0 7 src.rev}";

  buildInputs = [ automake autoconf libtool gettext utillinux openisns.lib openssl kmod ];
  
  src = fetchFromGitHub {
    owner = "open-iscsi";
    repo = "open-iscsi";
    rev = "4c1f2d90ef1c73e33d9f1e4ae9c206ffe015a8f9";
    sha256 = "0h030zk4zih3l8z5662b3kcifdxlakbwwkz1afb7yf0cicds7va8";
  };
  
  DESTDIR = "$(out)";
  
  NIX_LDFLAGS = "-lkmod";
  NIX_CFLAGS_COMPILE = "-DUSE_KMOD";

  preConfigure = ''
    sed -i 's|/usr|/|' Makefile
  '';
  
  postInstall = ''
    cp usr/iscsistart $out/sbin/
    $out/sbin/iscsistart -v
  '';

  meta = with stdenv.lib; {
    description = "A high performance, transport independent, multi-platform implementation of RFC3720";
    license = licenses.gpl2Plus;
    homepage = http://www.open-iscsi.com;
    platforms = platforms.linux;
    maintainers = with maintainers; [ cleverca22 ];
  };
}