nixpkgs/pkgs/servers/samba/4.x.nix

122 lines
3.8 KiB
Nix
Raw Normal View History

2015-01-03 06:21:34 +01:00
{ stdenv, fetchurl, python, pkgconfig, perl, libxslt, docbook_xsl_ns
, docbook_xml_dtd_42, readline, talloc, ntdb, tdb, tevent, ldb, popt, iniparser
2015-03-04 22:46:20 +01:00
, pythonPackages, libbsd, nss_wrapper, socket_wrapper, uid_wrapper, libarchive
2015-01-03 06:21:34 +01:00
# source3/wscript optionals
2015-03-04 22:46:20 +01:00
, kerberos ? null
2015-01-03 06:21:34 +01:00
, openldap ? null
, cups ? null
, pam ? null
, avahi ? null
, acl ? null
, libaio ? null
, fam ? null
, ceph ? null
, glusterfs ? null
# buildtools/wafsamba/wscript optionals
, libiconv ? null
, gettext ? null
# source4/lib/tls/wscript optionals
, gnutls ? null
, libgcrypt ? null
, libgpgerror ? null
# other optionals
, zlib ? null
, ncurses ? null
, libcap ? null
}:
stdenv.mkDerivation rec {
2015-03-04 22:46:20 +01:00
name = "samba-4.2.0";
2015-01-03 06:21:34 +01:00
src = fetchurl {
url = "mirror://samba/pub/samba/stable/${name}.tar.gz";
2015-03-04 22:46:20 +01:00
sha256 = "03s9pjdgq6nlv2lcnlmxlhhj8m5drgv6z4xy9zkgwwd92mw0b9k6";
2015-01-03 06:21:34 +01:00
};
2015-03-04 22:46:20 +01:00
patches = [
./4.x-no-persistent-install.patch
./4.x-heimdal-compat.patch
];
2015-01-03 06:21:34 +01:00
buildInputs = [
python pkgconfig perl libxslt docbook_xsl_ns docbook_xml_dtd_42
readline talloc ntdb tdb tevent ldb popt iniparser pythonPackages.subunit
2015-03-04 22:46:20 +01:00
libbsd nss_wrapper socket_wrapper uid_wrapper libarchive
2015-01-03 06:21:34 +01:00
2015-03-04 22:46:20 +01:00
kerberos openldap cups pam avahi acl libaio fam ceph glusterfs
2015-01-03 06:21:34 +01:00
libiconv gettext
gnutls libgcrypt libgpgerror
zlib ncurses libcap
];
enableParallelBuilding = true;
configureFlags = [
# source3/wscript options
"--with-static-modules=NONE"
"--with-shared-modules=ALL"
"--with-winbind"
2015-03-04 22:46:20 +01:00
] ++ (if kerberos != null then [ "--with-ads" ] else [ "--without-ads" ])
2015-01-03 06:21:34 +01:00
++ (if openldap != null then [ "--with-ldap" ] else [ "--without-ldap" ])
++ (if cups != null then [ "--enable-cups" ] else [ "--disable-cups" ])
++ (if pam != null then [ "--with-pam" "--with-pam_smbpass" ]
else [ "--without-pam" "--without-pam_smbpass" ]) ++ [
"--with-quotas"
"--with-sendfile-support"
"--with-utmp"
"--enable-pthreadpool"
] ++ (if avahi != null then [ "--enable-avahi" ] else [ "--disable-avahi" ]) ++ [
"--with-iconv"
] ++ (if acl != null then [ "--with-acl-support" ] else [ "--without-acl-support" ]) ++ [
"--with-dnsupdate"
"--with-syslog"
"--with-automount"
] ++ (if libaio != null then [ "--with-aio-support" ] else [ "--without-aio-support" ])
2015-03-04 22:46:20 +01:00
++ (if fam != null then [ "--with-fam" ] else [ "--without-fam" ]) ++ [
"--with-cluster-support"
] ++ (if ceph != null then [ "--with-libcephfs=${ceph}" ] else [ ])
2015-01-03 06:21:34 +01:00
++ (if glusterfs != null then [ "--enable-glusterfs" ] else [ "--disable-glusterfs" ]) ++ [
2015-03-04 22:46:20 +01:00
2015-01-03 06:21:34 +01:00
# dynconfig/wscript options
"--enable-fhs"
2015-01-04 02:53:50 +01:00
"--sysconfdir=/etc"
2015-01-03 06:21:34 +01:00
"--localstatedir=/var"
# buildtools/wafsamba/wscript options
"--bundled-libraries=${if kerberos != null && kerberos.implementation == "heimdal" then "NONE" else "com_err"}"
2015-01-03 06:21:34 +01:00
"--private-libraries=NONE"
"--builtin-libraries=replace"
] ++ (if libiconv != null then [ "--with-libiconv=${libiconv}" ] else [ ])
++ (if gettext != null then [ "--with-gettext=${gettext}" ] else [ "--without-gettext" ]) ++ [
2015-03-04 22:46:20 +01:00
2015-01-03 06:21:34 +01:00
# source4/lib/tls/wscript options
] ++ (if gnutls != null && libgcrypt != null && libgpgerror != null
then [ "--enable-gnutls" ] else [ "--disable-gnutls" ]) ++ [
2015-03-04 22:46:20 +01:00
2015-01-03 06:21:34 +01:00
# wscript options
] ++ stdenv.lib.optional (kerberos != null && kerberos.implementation == "krb5") "--with-system-mitkrb5"
2015-03-04 22:46:20 +01:00
++ stdenv.lib.optional (kerberos == null) "--without-ad-dc" ++ [
# ctdb/wscript
"--enable-infiniband"
"--enable-pmda"
];
2015-01-03 06:21:34 +01:00
stripAllList = [ "bin" "sbin" ];
meta = with stdenv.lib; {
homepage = http://www.samba.org/;
description = "The standard Windows interoperability suite of programs for Linux and Unix";
license = licenses.gpl3;
maintainers = with maintainers; [ wkennington ];
platforms = platforms.unix;
};
}