2011-08-22 01:31:25 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Samba < Formula
|
|
|
|
homepage 'http://samba.org/'
|
2014-03-23 17:43:21 +00:00
|
|
|
url 'http://www.samba.org/samba/ftp/stable/samba-3.6.23.tar.gz'
|
|
|
|
sha1 '5ba2f8323ab17fa6c04bf87c11d20f10a4fcfe17'
|
2012-07-04 21:34:19 +00:00
|
|
|
|
2013-11-15 07:36:13 +00:00
|
|
|
conflicts_with 'talloc', :because => 'both install `include/talloc.h`'
|
|
|
|
|
2013-12-03 05:58:05 +00:00
|
|
|
skip_clean 'private'
|
|
|
|
skip_clean 'var/locks'
|
|
|
|
|
2011-08-22 01:31:25 +00:00
|
|
|
# Fixes the Grouplimit of 16 users os OS X.
|
|
|
|
# Bug has been raised upstream:
|
|
|
|
# https://bugzilla.samba.org/show_bug.cgi?id=8773
|
2014-03-20 19:05:19 +00:00
|
|
|
patch :DATA
|
2011-08-22 01:31:25 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
cd 'source3' do
|
|
|
|
system "./configure", "--disable-debug",
|
|
|
|
"--prefix=#{prefix}",
|
2013-11-15 07:30:24 +00:00
|
|
|
"--with-configdir=#{prefix}/etc",
|
|
|
|
"--without-ldap",
|
|
|
|
"--without-krb5"
|
2011-08-22 01:31:25 +00:00
|
|
|
system "make install"
|
2012-08-31 04:06:18 +00:00
|
|
|
(prefix/'etc').mkpath
|
2012-09-06 22:50:12 +00:00
|
|
|
touch prefix/'etc/smb.conf'
|
2013-12-03 05:58:05 +00:00
|
|
|
(prefix/'private').mkpath
|
|
|
|
(var/'locks').mkpath
|
2011-08-22 01:31:25 +00:00
|
|
|
end
|
|
|
|
end
|
2014-08-22 03:19:53 +00:00
|
|
|
|
|
|
|
plist_options :manual => 'smbd'
|
|
|
|
|
|
|
|
def plist; <<-EOS.undent
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
|
|
<plist version="1.0">
|
|
|
|
<dict>
|
|
|
|
<key>Label</key>
|
|
|
|
<string>#{plist_name}</string>
|
|
|
|
<key>ProgramArguments</key>
|
|
|
|
<array>
|
|
|
|
<string>#{sbin}/smbd</string>
|
|
|
|
<string>-s</string>
|
|
|
|
<string>#{etc}/smb.conf</string>
|
|
|
|
</array>
|
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOS
|
|
|
|
end
|
2011-08-22 01:31:25 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
__END__
|
|
|
|
--- a/source3/lib/system.c 2012-02-22 22:46:14.000000000 -0200
|
|
|
|
+++ b/source3/lib/system.c 2012-02-22 22:47:51.000000000 -0200
|
|
|
|
@@ -1161,7 +1161,14 @@
|
|
|
|
|
|
|
|
int groups_max(void)
|
|
|
|
{
|
|
|
|
-#if defined(SYSCONF_SC_NGROUPS_MAX)
|
|
|
|
+#if defined(DARWINOS)
|
|
|
|
+ /* On OS X, sysconf(_SC_NGROUPS_MAX) returns 16
|
|
|
|
+ * due to OS X's group nesting and getgrouplist
|
|
|
|
+ * will return a flat list; users can exceed the
|
|
|
|
+ * maximum of 16 groups. And easily will.
|
|
|
|
+ */
|
|
|
|
+ return 32; // NGROUPS_MAX is defined, hence the define above is void.
|
|
|
|
+#elif defined(SYSCONF_SC_NGROUPS_MAX)
|
|
|
|
int ret = sysconf(_SC_NGROUPS_MAX);
|
|
|
|
return (ret == -1) ? NGROUPS_MAX : ret;
|
|
|
|
#else
|