2010-04-28 11:39:01 +02:00
|
|
|
{ stdenv, fetchurl, readline, pam, openldap, popt, iniparser, libunwind, fam
|
|
|
|
, acl
|
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
|
|
|
}:
|
|
|
|
let
|
|
|
|
usewith = flag: option: if flag then "--with-"+option else "";
|
|
|
|
in
|
2008-01-28 20:46:27 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2010-05-04 17:26:34 +02:00
|
|
|
name = "samba-3.3.3";
|
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";
|
2010-05-04 17:26:34 +02:00
|
|
|
sha256 = "08x3ng7ls5c1a95v7djx362i55wdlmnvarpr7rhng5bb55s9n5qn";
|
2007-05-28 17:40:17 +02:00
|
|
|
};
|
|
|
|
|
2010-04-28 11:39:01 +02:00
|
|
|
buildInputs = [readline pam openldap popt iniparser libunwind fam acl]
|
|
|
|
++ stdenv.lib.optional useKerberos kerberos;
|
2008-03-11 18:01:55 +01:00
|
|
|
|
2010-05-04 17:26:34 +02:00
|
|
|
preConfigure = "cd source";
|
2008-11-07 14:05:05 +01:00
|
|
|
|
2010-04-30 22:39:54 +02:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -pv $out/lib/cups/backend
|
|
|
|
ln -sv ../../../bin/smbspool $out/lib/cups/backend/smb
|
|
|
|
'' + stdenv.lib.optionalString (configDir == "") "touch $out/lib/smb.conf";
|
2009-04-26 13:06:41 +02:00
|
|
|
|
|
|
|
# Don't pass --with-private-dir=/var/samba/private
|
|
|
|
# --with-lockdir=/var/samba/lock
|
|
|
|
# the build system will try to create it.
|
2008-03-11 18:01:55 +01:00
|
|
|
configureFlags = ''
|
|
|
|
--with-pam
|
2009-04-04 02:59:55 +02:00
|
|
|
--with-cifsmount
|
2008-03-11 18:01:55 +01:00
|
|
|
--with-aio-support
|
2009-04-03 12:02:30 +02:00
|
|
|
--with-pam_smbpass
|
2009-04-04 02:59:55 +02:00
|
|
|
--disable-swat
|
|
|
|
--enable-shared-libs
|
2009-04-26 13:06:41 +02:00
|
|
|
--with-configdir=${configDir}
|
2010-09-26 07:07:41 +02:00
|
|
|
${usewith winbind "winbind"}
|
2009-04-04 02:59:55 +02:00
|
|
|
${if stdenv.gcc.libc != null then "--with-libiconv=${stdenv.gcc.libc}" else ""}
|
2008-01-28 20:46:27 +01:00
|
|
|
'';
|
2007-05-28 17:40:17 +02:00
|
|
|
}
|