#### this file is sourced not run
PKGVER=4.7.3
PKGBUILD=1
PKGARCH=x86_64

TARBALL=samba-$PKGVER.tar.gz
MD5SUM=5da8a195094c44a60eb7eb7cf96d6a49
SRC_URL=http://samba.org/samba/ftp/stable/$TARBALL
BUNDLE=

SLACKREQ='cups libcap2 libtirpc' # requires python to build
SLACKDESC="samba4: samba4 $PKGVER (CIFS/SMB Server and Client)  
samba4:  
samba4: The Samba package provides file and print services to SMB/CIFS clients 
samba4: and Windows networking to Linux clients. Samba can also be configured 
samba4: as a Windows Domain Controller replacement, a file/print server acting 
samba4: as a member of a Windows Active Directory domain and a NetBIOS 
samba4: (rfc1001/1002) nameserver (which among other things provides LAN 
samba4: browsing support).  
samba4: 
samba4: 
samba4:  
"
SLACKSUG='python'

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/samba*
	CONFFLAGS="$CONFFLAGS \
    --with-piddir=/run/samba           \
    --without-pam            \
    --enable-fhs                       \
    --without-systemd     \
    --without-ldap        \
    --without-ads         \
    --without-quotas      \
    --without-winbind     \
    --disable-iprint      \
    --without-iconv      \
    --disable-glusterfs  \
    --without-ntvfs-fileserver \
    --without-ad-dc"
	  
    pkg_build_autoconf &&
	# install
	#mv -v /usr/lib64/libnss_win{s,bind}.so*   /lib64                       &&
	#ln -v -sf ../../lib64/libnss_winbind.so.2 /usr/lib64/libnss_winbind.so &&
	#ln -v -sf ../../lib64/libnss_wins.so.2    /usr/lib64/libnss_wins.so    &&

	install -v -m644    examples/smb.conf.default /etc/samba &&
	mkdir -pv /etc/openldap/schema                        &&
	install -v -m644    examples/LDAP/README              \
						/etc/openldap/schema/README.LDAP  &&

	install -v -m644    examples/LDAP/samba*              \
						/etc/openldap/schema              &&

	install -v -m755    examples/LDAP/{get*,ol*} \
						/etc/openldap/schema
	
	
	# cups
	mkdir -p /usr/lib64/cups/backend &&
	ln -v -sf /usr/bin/smbspool /usr/lib64/cups/backend/smb &&
	
	pkg_build_slackdesc
}
