1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by scripts/Create-CopyPatch.
4 # T2 SDE: package/*/samba/samba.conf
5 # Copyright (C) 2004 - 2021 The T2 SDE Project
6 # Copyright (C) 1998 - 2003 ROCK Linux Project
8 # More information can be found in the files COPYING and README.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
16 if [ $prefix_auto = 1 ]; then
17 if [ "$SDECFG_PKG_SAMBA_CORE_PREFIX" ]; then
18 prefix="$SDECFG_PKG_SAMBA_CORE_PREFIX"
24 [ "${prefix#opt/}" == "$prefix" ] && sysconfdir="$sysconfdir/samba"
27 var_remove confopt ' ' '--disable-debug'
28 var_remove_regex confopt ' ' '--with-sysroot=.*'
29 var_remove_regex confopt ' ' '--host=.*'
30 var_remove_regex confopt ' ' '--build=.*'
33 var_append extraconfopt " " "--with-automount \
34 --with-syslog --with-configdir=$sysconfdir \
35 --with-privatedir=$sysconfdir/private \
38 if atstage cross; then
39 var_append confopt ' ' '--disable-python'
42 pkginstalled pam && atstage native && var_append extraconfopt ' ' "--with-pam" # --with-pam_smbpass"
43 pkginstalled jansson || var_append extraconfopt ' ' '--without-json'
44 pkginstalled libarchive || var_append extraconfopt ' ' '--without-libarchive'
45 pkginstalled acl && var_append confopt ' ' '--with-acl-support' || var_append confopt ' ' '--without-acl-support'
46 pkginstalled cups || var_append extraconfopt ' ' '--disable-cups'
48 #var_append extraconfopt ' ' "--with-nisplus-home"
50 # let samba configure find ldap and enable ldapsam
51 if pkginstalled openldapX; then
53 var_append extraconfopt ' ' "--with-ldapsam"
54 var_append extraconfopt ' ' "CFLAGS=\"$CFLAGS${CFLAGS:+ }-I$( pkgprefix includedir openldap )\""
55 var_append extraconfopt ' ' "CPPFLAGS=\"$CPPFLAGS${CPPFLAGS:+ }-I$( pkgprefix includedir openldap )\""
56 var_append extraconfopt ' ' "LDFLAGS=\"$LDFLAGS${LDFLAGS:+ }-L$( pkgprefix libdir openldap )\""
58 var_append extraconfopt ' ' '--without-ldap --without-ads --without-ad-dc'
62 # FIXME: this should be down with pkgprefix libdir cups
63 [ -d $root/usr/lib/cups/backend/ ] &&
64 ln -sf $bindir/smbspool $root/usr/lib/cups/backend/smb
66 chmod 755 smbadduser; cp -vf smbadduser $root$bindir/
69 sed 's/; encrypt passwords = yes/ encrypt passwords = yes/' \
70 examples/smb.conf.default > $root$docdir/smb.conf
72 cat > $root$sysconfdir/lmhosts <<'EOS'
75 # This file contains host maps for NetBIOS
76 # It is similar to the /etc/hosts file format
77 # See lmhosts (5) for more info.
80 # 0.0.0.0 NetBIOS_Name
84 # xinetd integration readme
85 sed "s,D_sbindir,$sbindir," < $confdir/README.xinetd > $root$docdir/README.xinetd
87 #hook_add postmake 3 "samba_pm"
90 hook_add postmake 5 "cp -vRf examples $root$docdir/"