2015-07-13 13:43:11 +02:00
|
|
|
{ stdenv, fetchFromGitHub, pkgconfig, nettools, gettext, libtool, flex
|
2016-11-09 11:11:09 +01:00
|
|
|
, readline ? null, openssl ? null, python2 ? null, ncurses ? null, rocksdb
|
2015-04-23 01:03:20 +02:00
|
|
|
, sqlite ? null, postgresql ? null, libmysql ? null, zlib ? null, lzo ? null
|
2015-09-18 23:52:43 +02:00
|
|
|
, jansson ? null, acl ? null, glusterfs ? null, libceph ? null, libcap ? null
|
2014-11-04 19:54:25 +01:00
|
|
|
}:
|
|
|
|
|
2015-04-23 01:03:20 +02:00
|
|
|
assert sqlite != null || postgresql != null || libmysql != null;
|
2014-11-04 19:54:25 +01:00
|
|
|
|
|
|
|
with stdenv.lib;
|
2015-03-28 07:46:47 +01:00
|
|
|
let
|
|
|
|
withGlusterfs = "\${with_glusterfs_directory}";
|
|
|
|
in
|
2014-11-04 19:54:25 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "bareos-${version}";
|
2016-10-15 11:46:57 +02:00
|
|
|
version = "15.2.4";
|
2014-11-04 19:54:25 +01:00
|
|
|
|
2015-01-14 17:38:26 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bareos";
|
|
|
|
repo = "bareos";
|
|
|
|
rev = "Release/${version}";
|
|
|
|
name = "${name}-src";
|
2016-10-15 11:46:57 +02:00
|
|
|
sha256 = "02k6wmr2n12dc6vwda8xczmbqidg6fs8nfg9n2cwwpm3k1a21qnd";
|
2014-11-04 19:54:25 +01:00
|
|
|
};
|
|
|
|
|
2015-09-18 23:52:43 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2014-11-04 19:54:25 +01:00
|
|
|
buildInputs = [
|
2016-11-09 11:11:09 +01:00
|
|
|
nettools gettext readline openssl python2 flex ncurses sqlite postgresql
|
2016-03-10 10:44:19 +01:00
|
|
|
libmysql zlib lzo jansson acl glusterfs libceph libcap rocksdb
|
2014-11-04 19:54:25 +01:00
|
|
|
];
|
|
|
|
|
2015-03-28 07:46:47 +01:00
|
|
|
postPatch = ''
|
|
|
|
sed -i 's,\(-I${withGlusterfs}/include\),\1/glusterfs,' configure
|
|
|
|
'';
|
|
|
|
|
2014-11-04 19:54:25 +01:00
|
|
|
configureFlags = [
|
2015-03-28 07:46:47 +01:00
|
|
|
"--sysconfdir=/etc"
|
2014-11-04 19:54:25 +01:00
|
|
|
"--exec-prefix=\${out}"
|
2015-03-28 07:46:47 +01:00
|
|
|
"--enable-lockmgr"
|
|
|
|
"--enable-dynamic-storage-backends"
|
|
|
|
"--with-basename=nixos" # For reproducible builds since it uses the hostname otherwise
|
|
|
|
"--with-hostname=nixos" # For reproducible builds since it uses the hostname otherwise
|
|
|
|
"--with-working-dir=/var/lib/bareos"
|
|
|
|
"--with-bsrdir=/var/lib/bareos"
|
|
|
|
"--with-logdir=/var/log/bareos"
|
|
|
|
"--with-pid-dir=/var/run/bareos"
|
|
|
|
"--with-subsys-dir=/var/run/bareos"
|
2014-11-04 19:54:25 +01:00
|
|
|
"--enable-ndmp"
|
|
|
|
"--enable-lmdb"
|
2015-03-28 07:46:47 +01:00
|
|
|
"--enable-batch-insert"
|
|
|
|
"--enable-dynamic-cats-backends"
|
|
|
|
"--enable-sql-pooling"
|
|
|
|
"--enable-scsi-crypto"
|
2016-04-16 19:46:17 +02:00
|
|
|
] ++ optionals (readline != null) [ "--disable-conio" "--enable-readline" "--with-readline=${readline.dev}" ]
|
2016-11-09 11:11:09 +01:00
|
|
|
++ optional (python2 != null) "--with-python=${python2}"
|
2016-04-16 19:44:32 +02:00
|
|
|
++ optional (openssl != null) "--with-openssl=${openssl.dev}"
|
2016-04-16 19:47:23 +02:00
|
|
|
++ optional (sqlite != null) "--with-sqlite3=${sqlite.dev}"
|
2014-11-04 19:54:25 +01:00
|
|
|
++ optional (postgresql != null) "--with-postgresql=${postgresql}"
|
2016-08-23 02:34:12 +02:00
|
|
|
++ optional (libmysql != null) "--with-mysql=${libmysql.dev}"
|
2016-04-16 19:50:01 +02:00
|
|
|
++ optional (zlib != null) "--with-zlib=${zlib.dev}"
|
2015-03-28 07:46:47 +01:00
|
|
|
++ optional (lzo != null) "--with-lzo=${lzo}"
|
2015-09-18 23:52:43 +02:00
|
|
|
++ optional (jansson != null) "--with-jansson=${jansson}"
|
2015-03-28 07:46:47 +01:00
|
|
|
++ optional (acl != null) "--enable-acl"
|
|
|
|
++ optional (glusterfs != null) "--with-glusterfs=${glusterfs}"
|
2015-04-23 01:01:50 +02:00
|
|
|
++ optional (libceph != null) "--with-cephfs=${libceph}";
|
2015-03-28 07:46:47 +01:00
|
|
|
|
2015-04-05 07:11:45 +02:00
|
|
|
installFlags = [
|
|
|
|
"sysconfdir=\${out}/etc"
|
2015-09-18 23:52:43 +02:00
|
|
|
"confdir=\${out}/etc/bareos"
|
|
|
|
"scriptdir=\${out}/etc/bareos"
|
2015-04-05 07:11:45 +02:00
|
|
|
"working_dir=\${TMPDIR}"
|
|
|
|
"log_dir=\${TMPDIR}"
|
2015-07-13 13:43:11 +02:00
|
|
|
"sbindir=\${out}/bin"
|
2015-04-05 07:11:45 +02:00
|
|
|
];
|
2014-11-04 19:54:25 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = http://www.bareos.org/;
|
2015-04-28 10:54:58 +02:00
|
|
|
description = "A fork of the bacula project";
|
2014-11-04 19:54:25 +01:00
|
|
|
license = licenses.agpl3;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ wkennington ];
|
|
|
|
};
|
|
|
|
}
|