# Maintainer: Natanael Copa pkgname=samba pkgver=3.6.2 pkgrel=0 pkgdesc="Tools to access a server's filespace and printers via SMB" url="http://www.samba.org" arch="all" license="GPL3" subpackages="$pkgname-dev $pkgname-doc winbind $pkgname-common $pkgname-initscript tdb libsmbclient $pkgname-client $pkgname-lang" depends="samba-initscript samba-client" makedepends="popt-dev ncurses-dev openldap-dev heimdal-dev e2fsprogs-dev libiconv-dev talloc-dev cups-dev" source="http://us1.$pkgname.org/$pkgname/ftp/stable/$pkgname-$pkgver.tar.gz samba.initd samba.confd samba.logrotate " pkggroups="winbind" _builddir="$srcdir"/$pkgname-$pkgver prepare() { cd "$_builddir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done } build() { cd "$_builddir"/source3 ./configure --prefix=/usr \ --sysconfdir=/etc/samba \ --with-configdir=/etc/samba \ --localstatedir=/var \ --with-fhs \ --with-lockdir=/var/cache/samba \ --with-piddir=/var/run/samba \ --with-logfilebase=/var/log/samba \ --without-pam \ --with-ads \ --with-krb5 \ --with-libsmbclient \ --with-shared-modules=idmap_rid,imap_ad \ --enable-cups \ --enable-external-libtalloc \ --disable-nss-wrapper \ --disable-dnssd \ --disable-swat make || return 1 } package() { cd "$_builddir"/source3 make DESTDIR="$pkgdir" install install -d "$pkgdir"/var/log/samba \ "$pkgdir"/usr/share/doc/samba cd "$srcdir"/$pkgname-$pkgver cp -r examples "$pkgdir"/usr/share/doc/samba/ install -D packaging/RHEL/setup/smbusers "$pkgdir"/etc/samba/smbusers install -Dm644 ../samba.logrotate "$pkgdir"/etc/logrotate.d/samba } initscript() { pkgdesc="Init script for Samba" depends="" install -Dm755 $srcdir/samba.initd "$subpkgdir"/etc/init.d/samba install -Dm644 $srcdir/samba.confd "$subpkgdir"/etc/conf.d/samba } _mv_files() { local i for i in "$@"; do mkdir -p "$subpkgdir"/${i%/*} mv "$pkgdir"/$i "$subpkgdir"/$i || return 1 done } winbind() { pkgdesc="Samba user and group resolver" depends= install="winbind.pre-install winbind.pre-upgrade winbind.post-install winbind.post-upgrade" replaces="samba" cd "$pkgdir" _mv_files \ usr/bin/wbinfo \ usr/bin/ntlm_auth \ usr/sbin/winbindd \ usr/lib/samba/idmap install -d -g winbind -m 750 \ "$subpkgdir"/var/cache/samba/winbindd_privileged } common() { pkgdesc="Samba common files for both client an servers" depends= # we have moved libwbclient and libnetapi to samba-common replaces="winbind samba" cd "$pkgdir" _mv_files \ usr/bin/net \ usr/bin/nmblookup \ usr/bin/smbpasswd \ usr/bin/testparm \ usr/lib/samba/*.dat \ usr/lib/libnetapi.so.* \ usr/lib/libwbclient* \ var/run/samba \ var/cache/samba \ var/log/samba } tdb() { pkgdesc="Trivial database" depends= cd "$pkgdir" _mv_files \ usr/lib/libtdb* \ usr/bin/tdb* } libsmbclient() { pkgdesc="The SMB client library" replaces="samba" depends= cd "$pkgdir" _mv_files \ usr/lib/libsmbclient.so.* \ usr/lib/libsmbsharemodes.so.* \ || return 1 } client() { pkgdesc="Samba client program" replaces="samba" depends= cd "$pkgdir" _mv_files \ usr/bin/rpcclient \ usr/bin/smbcacls \ usr/bin/findsmb \ usr/bin/smbget \ usr/bin/smbclient \ usr/bin/smbcquotas \ usr/bin/smbspool \ usr/bin/smbtar \ usr/bin/smbtree \ usr/bin/sharesec \ || return 1 } md5sums="bd2bb63b1c90161b88262f813bd1ce8b samba-3.6.2.tar.gz f0b8d460ad4af28266ac8bc1d6fa0d31 samba.initd c150433426e18261e6e3eed3930e1a76 samba.confd b7cafabfb4fa5b3ab5f2e857d8d1c733 samba.logrotate"