2011-11-29 23:54:00 +01:00
|
|
|
{ stdenv, fetchurl, readline, pam ? null, openldap ? null
|
|
|
|
, popt, iniparser, libunwind
|
|
|
|
, fam ? null , acl ? null, cups ? null
|
2010-09-26 07:07:41 +02:00
|
|
|
, useKerberos ? false, kerberos ? null, winbind ? true
|
2009-04-26 13:06:41 +02:00
|
|
|
|
|
|
|
# Eg. smbclient and smbspool require a smb.conf file.
|
|
|
|
# If you set configDir to "" an empty configuration file
|
|
|
|
# $out/lib/smb.conf is is created for you.
|
|
|
|
#
|
|
|
|
# configDir defaults to "/etc/samba" so that smbpassword picks up
|
|
|
|
# the location of its passwd db files from the system configuration file
|
|
|
|
# /etc/samba/smb.conf. That's why nixos touches /etc/samba/smb.conf even if you
|
|
|
|
# don't enable the samba upstart service.
|
|
|
|
, configDir ? "/etc/samba"
|
2007-05-28 17:40:17 +02:00
|
|
|
|
2010-09-26 07:07:41 +02:00
|
|
|
}:
|
2010-12-06 19:59:07 +01:00
|
|
|
|
2011-11-29 23:54:00 +01:00
|
|
|
assert useKerberos -> kerberos != null;
|
2010-12-06 19:59:07 +01:00
|
|
|
|
2008-01-28 20:46:27 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2013-08-17 12:21:29 +02:00
|
|
|
name = "samba-3.6.18";
|
2007-05-28 17:40:17 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2009-04-04 02:59:55 +02:00
|
|
|
url = "http://us3.samba.org/samba/ftp/stable/${name}.tar.gz";
|
2013-08-17 12:21:29 +02:00
|
|
|
sha256 = "14lrb7724952wyc1sah4nsngd6cv8x8y96cm7f3awzjnfyxajwbd";
|
2007-05-28 17:40:17 +02:00
|
|
|
};
|
|
|
|
|
2011-04-14 09:25:06 +02:00
|
|
|
buildInputs = [ readline pam openldap popt iniparser libunwind fam acl cups ]
|
2010-04-28 11:39:01 +02:00
|
|
|
++ stdenv.lib.optional useKerberos kerberos;
|
2008-03-11 18:01:55 +01:00
|
|
|
|
2011-04-13 17:31:22 +02:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2011-11-29 23:54:00 +01:00
|
|
|
postPatch =
|
|
|
|
# XXX: Awful hack to allow cross-compilation.
|
|
|
|
'' sed -i source3/configure \
|
2012-10-11 12:02:46 +02:00
|
|
|
-e 's/^as_fn_error .. \("cannot run test program while cross compiling\)/$as_echo \1/g'
|
2012-02-23 01:01:24 +01:00
|
|
|
''; # "
|
2011-11-29 23:54:00 +01:00
|
|
|
|
|
|
|
preConfigure =
|
|
|
|
'' cd source3
|
|
|
|
export samba_cv_CC_NEGATIVE_ENUM_VALUES=yes
|
|
|
|
export libreplace_cv_HAVE_GETADDRINFO=yes
|
|
|
|
export ac_cv_file__proc_sys_kernel_core_pattern=no # XXX: true on Linux, false elsewhere
|
|
|
|
'';
|
2008-11-07 14:05:05 +01:00
|
|
|
|
2011-11-29 23:54:00 +01:00
|
|
|
configureFlags =
|
|
|
|
stdenv.lib.optionals (pam != null) [ "--with-pam" "--with-pam_smbpass" ]
|
|
|
|
++ [ "--with-aio-support"
|
|
|
|
"--disable-swat"
|
|
|
|
"--with-configdir=${configDir}"
|
|
|
|
"--with-fhs"
|
|
|
|
"--localstatedir=/var"
|
|
|
|
]
|
|
|
|
++ (stdenv.lib.optional winbind "--with-winbind")
|
|
|
|
++ (stdenv.lib.optional (stdenv.gcc.libc != null) "--with-libiconv=${stdenv.gcc.libc}");
|
2010-12-06 19:59:07 +01:00
|
|
|
|
|
|
|
# Need to use a DESTDIR because `make install' tries to write in /var and /etc.
|
|
|
|
installFlags = "DESTDIR=$(TMPDIR)/inst";
|
|
|
|
|
2011-08-10 22:19:36 +02:00
|
|
|
stripAllList = [ "bin" "sbin" ];
|
|
|
|
|
2010-12-06 19:59:07 +01:00
|
|
|
postInstall =
|
|
|
|
''
|
|
|
|
mkdir -p $out
|
|
|
|
mv $TMPDIR/inst/$out/* $out/
|
2012-10-09 15:49:51 +02:00
|
|
|
|
2010-12-06 19:59:07 +01:00
|
|
|
mkdir -pv $out/lib/cups/backend
|
|
|
|
ln -sv ../../../bin/smbspool $out/lib/cups/backend/smb
|
2011-04-13 17:31:22 +02:00
|
|
|
mkdir -pv $out/etc/openldap/schema
|
|
|
|
cp ../examples/LDAP/samba.schema $out/etc/openldap/schema
|
2013-08-25 18:41:35 +02:00
|
|
|
cp -v ../nsswitch/libnss_wins.so "$out/lib"
|
|
|
|
cp -v ../nsswitch/libnss_winbind.so "$out/lib"
|
2010-12-06 19:59:07 +01:00
|
|
|
'' # */
|
|
|
|
+ stdenv.lib.optionalString (configDir == "") "touch $out/lib/smb.conf";
|
2013-01-06 22:30:23 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://www.samba.org/;
|
|
|
|
description = "The standard Windows interoperability suite of programs for Linux and Unix";
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
2007-05-28 17:40:17 +02:00
|
|
|
}
|