Add dependency on sys-libs/ldb, bug #372747
authorMaxim Koltsov <maksbotan@gentoo.org>
Thu, 4 Aug 2011 18:52:26 +0000 (18:52 +0000)
committerMaxim Koltsov <maksbotan@gentoo.org>
Thu, 4 Aug 2011 18:52:26 +0000 (18:52 +0000)
Package-Manager: portage-2.1.10.7/cvs/Linux i686

net-fs/samba/ChangeLog
net-fs/samba/Manifest
net-fs/samba/samba-3.4.12-r1.ebuild [new file with mode: 0644]
net-fs/samba/samba-3.4.13-r1.ebuild [new file with mode: 0644]
net-fs/samba/samba-3.5.8-r2.ebuild [new file with mode: 0644]
net-fs/samba/samba-3.5.9-r1.ebuild [new file with mode: 0644]
net-fs/samba/samba-3.6.0_rc3-r1.ebuild [new file with mode: 0644]

index 73656c64d9c6d8136a40def422eedcb4bbb87a9c..d0a18a3530fdd6e89d2cb5e85967867fc3476ac2 100644 (file)
@@ -1,6 +1,17 @@
 # ChangeLog for net-fs/samba
 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/ChangeLog,v 1.475 2011/07/27 11:51:12 dagger Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/ChangeLog,v 1.476 2011/08/04 18:52:26 maksbotan Exp $
+
+*samba-3.6.0_rc3-r1 (04 Aug 2011)
+*samba-3.5.9-r1 (04 Aug 2011)
+*samba-3.5.8-r2 (04 Aug 2011)
+*samba-3.4.13-r1 (04 Aug 2011)
+*samba-3.4.12-r1 (04 Aug 2011)
+
+  04 Aug 2011; Maxim Koltsov (maksbotan) <maksbotan@gentoo.org>
+  +samba-3.4.12-r1.ebuild, +samba-3.4.13-r1.ebuild, +samba-3.5.8-r2.ebuild,
+  +samba-3.5.9-r1.ebuild, +samba-3.6.0_rc3-r1.ebuild:
+  Bumped revisions to add sys-libs/ldb dependency, bug #372747
 
 *samba-3.6.0_rc3 (27 Jul 2011)
 
index 52af1089899831e941cdf904e38ac07073afded6..47a53052d5db0f3adaa80fb947ed6aaa20e2c29f 100644 (file)
@@ -39,12 +39,17 @@ DIST samba-3.5.9.tar.gz 30750297 RMD160 c48b3d0ecf0b4cde2764cebdde5f8513320cd966
 DIST samba-3.6.0rc3.tar.gz 28990368 RMD160 5255ecc79d80bb68219587745735fb1d880c1deb SHA1 97dedbcc09fe0d1b7a7e3c723fc78a1d631eacb1 SHA256 4e058128cbf030f1497858be74ad18a746be21b527498ec6c43ec72a4d995d1e
 DIST samba-4.0.0alpha11.tar.gz 13917363 RMD160 3ec5597de6a2c80eaa426712101777fa92786b5c SHA1 8ed2befbbd45f6501d9e6036bcdfb332431a7b4f SHA256 ec9f4a9153b9e2c233420642ee98a8b944322e8b39a9b6912430fb24e88b81b9
 DIST smb_traffic_analyzer_v2.diff.bz2 12226 RMD160 82f6d443d289253a184e5f5dda17d865cb79b2b5 SHA1 1dd5100447cb827aacb8bb18bf88b7b10955a38c SHA256 1bae7eafbe8ac2382313d5ab9d43d73ba64b63a714f0f588516952d476fb868d
+EBUILD samba-3.4.12-r1.ebuild 11854 RMD160 6a63fd620d63eceedd349ff08de3a703c0e4a67c SHA1 de9e4f5d31cfe09aab0d0eb48c4d2ce27d50c4b0 SHA256 5daf968e52eab146b73abae4ae5b37c714ec8a13d30756980f0a1ef5a918f760
 EBUILD samba-3.4.12.ebuild 11868 RMD160 f4a947beec3cceb95e1241991a827e673913aee3 SHA1 76ef9617d3604eb6941a13bae2f92e2816bdc223 SHA256 b72494103bf6f78691ec952bd878687b56671a1914e305a56a4728d22a410bb1
+EBUILD samba-3.4.13-r1.ebuild 11854 RMD160 6e520ff4a3df257390bfaa2c042f8cc548ce3c2a SHA1 6d6099f346122119dc11a9a8f10a7f73c7d5c7f5 SHA256 bdfaa284ceff33d7bac0880b704cd60699f86ff305834595c8f32a044e8e35a9
 EBUILD samba-3.4.13.ebuild 11879 RMD160 d8fe5d3ad76b26f653f4c2f8a62d57e748fb113f SHA1 217edcd9a75b23de4328d8f6cdbe441565bbc25a SHA256 9bb1cbe6642d07e12eb8f0e80228405fc5e09cb4f16bbf9f2c291d5750ef6c5f
 EBUILD samba-3.5.8-r1.ebuild 11968 RMD160 0b559c0d46a4e6493971616a765053e2ce216be3 SHA1 13b3686487563435be413ece26de403ebe59f8f1 SHA256 964102b971bf1c3db52b0673363f89250561f335601a9a33f3df1f2483c74917
+EBUILD samba-3.5.8-r2.ebuild 11934 RMD160 8025dc5078f57a10e1bf54f7d39d72828b464c87 SHA1 ef266e0a9c38be685fe105fa7294f12adf1da88a SHA256 3e5aafb910df330443eb320b4b90a418e1432cccacc3a0a0b4b1cf5bcbbd9e8b
 EBUILD samba-3.5.8.ebuild 12734 RMD160 3d4145c2be91bb05498adbbd507ced25df9aff91 SHA1 f30d7d7e16e365d421ef79a90efc20d1729b7e0f SHA256 cf6f724a69d82644ad4a4be64aed243775c44d55fbf7d69acf443d175c91b110
+EBUILD samba-3.5.9-r1.ebuild 11977 RMD160 32eb1694399213c535e9ac0b335650b7e52ec75f SHA1 44f47d5444ba5fc56271251e0066ac0bbda99663 SHA256 c60be18861ac486b7d881a0c1636fbb20316680009144bdbb84af07e9e17dcdf
 EBUILD samba-3.5.9.ebuild 12008 RMD160 d4053610ac661eb0e3ea485f587dd4b4032ffc05 SHA1 6b3114748e010c7b5f3a2e42c689e6f4432c615a SHA256 bd4aa352db979cace6634c8df1221c6e0393da8678de64e92c1cacf716adc4b7
+EBUILD samba-3.6.0_rc3-r1.ebuild 11214 RMD160 c3a874e9131de96dd36ee67fc37b788f6b82a8ca SHA1 02a9bba6d6d204512ee2b6cc8f050153e60e1b6c SHA256 ac0f6308ba4c789291b99a641abd556820d5e1dbebfdba03194ba03f116bc676
 EBUILD samba-3.6.0_rc3.ebuild 11213 RMD160 e100cff24e7f0b6539884d767880bf948592dcea SHA1 226ae89aafbd5f02bfbac2b984296517be1a8253 SHA256 4748979f3c755cc696ee045c0c586f6878e1da15262a24ce44edb6291f94b585
 EBUILD samba-4.0.0_alpha11.ebuild 4231 RMD160 efebbeed51868bf0cf51f6151b531f3e65834db2 SHA1 49169a33b69d1a69ecc102d8010c7b11f9256117 SHA256 02427fccf34de0f6aea8960d664b85a51fb80cce7bd107bc53111df386fb0660
-MISC ChangeLog 79519 RMD160 28415b746992a098aa8fa8817f348fb044796b49 SHA1 99574a52a7edb29bf1eab3282d63217e02415e79 SHA256 932fff8e61e0ddaf8df92c886bc697adf7aa8f1ec02b22ae0f64ac9e019f3b3f
+MISC ChangeLog 79937 RMD160 22e3e91a0cf20a323ac87b581f1310d0ca060eb4 SHA1 32fc32f8b149d3653db6cdf5392e2799cb36ccef SHA256 29fc60b6255d604e6d81558335e0d7696d5dab4e5d8416426d9defc8e6c601d4
 MISC metadata.xml 1435 RMD160 cbeae62707473b88127daa6170e8ca58861ef38b SHA1 32ff9e4f94646cc85bca64f208ea19faae1e2075 SHA256 bdff2271efdf94275d1a6096c48407c0372e088b10f85f19b989b18d50c2a5f0
diff --git a/net-fs/samba/samba-3.4.12-r1.ebuild b/net-fs/samba/samba-3.4.12-r1.ebuild
new file mode 100644 (file)
index 0000000..bd8c6dd
--- /dev/null
@@ -0,0 +1,412 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.4.12-r1.ebuild,v 1.1 2011/08/04 18:52:26 maksbotan Exp $
+
+EAPI="2"
+
+inherit pam confutils versionator multilib
+
+MY_PV=${PV/_/}
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Library bits of the samba network filesystem"
+HOMEPAGE="http://www.samba.org/"
+SRC_URI="mirror://samba/${P}.tar.gz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="acl addns ads aio avahi caps +client cluster cups debug doc examples fam
+       ldap ldb +netapi pam quota +readline +server +smbclient smbsharemodes swat
+       syslog winbind "
+
+DEPEND="dev-libs/popt
+       !net-fs/samba-client
+       !net-fs/samba-libs
+       !net-fs/samba-server
+       !net-fs/cifs-utils
+       sys-libs/talloc
+       sys-libs/tdb
+       virtual/libiconv
+       ads? ( virtual/krb5 sys-fs/e2fsprogs
+               client? ( sys-apps/keyutils ) )
+       avahi? ( net-dns/avahi[dbus] )
+       caps? ( sys-libs/libcap )
+       client? ( !net-fs/mount-cifs
+               dev-libs/iniparser )
+       cluster? ( dev-db/ctdb )
+       cups? ( net-print/cups )
+       debug? ( dev-libs/dmalloc )
+       fam? ( virtual/fam )
+       ldap? ( net-nds/openldap )
+       ldb? ( sys-libs/ldb )
+       pam? ( virtual/pam
+               winbind? ( dev-libs/iniparser ) )
+       readline? ( >=sys-libs/readline-5.2 )
+       syslog? ( virtual/logger )"
+
+RDEPEND="${DEPEND}"
+
+# Disable tests since we don't want to build that much here
+RESTRICT="test"
+
+SBINPROGS=""
+BINPROGS=""
+
+if use server ; then
+       SBINPROGS="${SBINPROGS} bin/smbd bin/nmbd"
+       BINPROGS="${BINPROGS} bin/testparm bin/smbstatus bin/smbcontrol bin/pdbedit
+               bin/profiles bin/sharesec bin/eventlogadm"
+
+       use swat && SBINPROGS="${SBINPROGS} bin/swat"
+       use winbind && SBINPROGS="${SBINPROGS} bin/winbindd"
+       use ads && use winbind && SBIN_PROGS="${SBINPROGS} bin/winbind_krb5_locator"
+fi
+
+if use client ; then
+       BINPROGS="${BINPROGS} bin/smbclient bin/net bin/smbget bin/smbtree
+               bin/nmblookup bin/smbpasswd bin/rpcclient bin/smbcacls bin/smbcquotas
+               bin/ntlm_auth"
+
+       use ads && SBINPROGS="${SBINPROGS} bin/cifs.upcall"
+fi
+
+use cups && BINPROGS="${BINPROGS} bin/smbspool"
+#use ldb && BINPROGS="${BINPROGS} bin/ldbedit bin/ldbsearch bin/ldbadd bin/ldbdel bin/ldbmodify bin/ldbrename";
+
+if use winbind ; then
+       BINPROGS="${BINPROGS} bin/wbinfo"
+       mymod_shared="--with-shared-modules=idmap_rid,idmap_hash"
+       use ldap && mymod_shared="${mymod_shared},idmap_adex,idmap_ldap"
+       use ads && mymod_shared="${mymod_shared},idmap_ad"
+fi
+
+S="${WORKDIR}/${MY_P}/source3"
+
+# TODO:
+# - enable iPrint on Prefix/OSX and Darwin?
+# - selftest-prefix? selftest?
+# - AFS?
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+pkg_setup() {
+       if use winbind &&
+               [[ $(tc-getCC)$ == *gcc* ]] &&
+               [[ $(gcc-major-version)$(gcc-minor-version) -lt 43 ]]
+       then
+               eerror "It is a known issue that ${P} will not build with "
+               eerror "winbind use flag enabled when using gcc < 4.3 ."
+               eerror "Please use at least the latest stable gcc version."
+               die "Using sys-devel/gcc < 4.3 with winbind use flag."
+       fi
+
+       confutils_use_depend_all ads ldap
+       confutils_use_depend_all swat server
+       confutils_use_depend_all client netapi
+}
+
+src_prepare() {
+       cp "${FILESDIR}/samba-3.4.2-lib.tevent.python.mk" "../lib/tevent/python.mk"
+
+       # ensure that winbind has correct ldflags (QA notice)
+       sed -i \
+               -e 's|LDSHFLAGS="|LDSHFLAGS="\\${LDFLAGS} |g' \
+               configure || die "sed failed"
+
+       epatch "${CONFDIR}"/${PN}-3.4.9-kerberos-dummy.patch
+}
+
+src_configure() {
+       local myconf
+
+       # Filter out -fPIE
+       [[ ${CHOST} == *-*bsd* ]] && myconf="${myconf} --disable-pie"
+
+       # Upstream refuses to make this configurable
+       use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no
+
+       # use_with doesn't accept 2 USE-flags
+       if use client && use ads ; then
+               myconf="${myconf} --with-cifsupcall"
+       else
+               myconf="${myconf} --without-cifsupcall"
+       fi
+
+       # Notes:
+       # - automount is only needed in conjunction with NIS and we don't have that
+       # anymore => LDAP?
+       # - --without-dce-dfs and --without-nisplus-home can't be passed to configure but are disabled by default
+       econf ${myconf} \
+               --with-piddir=/var/run/samba \
+               --sysconfdir=/etc/samba \
+               --localstatedir=/var \
+               $(use_enable debug developer) \
+               --enable-largefile \
+               --enable-socket-wrapper \
+               --enable-nss-wrapper \
+               $(use_enable swat) \
+               $(use_enable debug dmalloc) \
+               $(use_enable cups) \
+               --disable-iprint \
+               $(use_enable fam) \
+               --enable-shared-libs \
+               --disable-dnssd \
+               $(use_enable avahi) \
+               --with-fhs \
+               --with-privatedir=/var/lib/samba/private \
+               --with-rootsbindir=/var/cache/samba \
+               --with-lockdir=/var/cache/samba \
+               --with-swatdir=/usr/share/doc/${PF}/swat \
+               --with-configdir=/etc/samba \
+               --with-logfilebase=/var/log/samba \
+               --with-pammodulesdir=$(getpam_mod_dir) \
+               --without-afs \
+               --without-fake-kaserver \
+               --without-vfs-afsacl \
+               $(use_with ldap) \
+               $(use_with ads) \
+               $(use_with ads krb5 /usr) \
+               $(use_with ads dnsupdate) \
+               --without-automount \
+               $(use_with client cifsmount) \
+               $(use_with pam) \
+               $(use_with pam pam_smbpass) \
+               $(use_with syslog) \
+               $(use_with quota quotas) \
+               $(use_with quota sys-quotas) \
+               --without-utmp \
+               --without-lib{talloc,tdb} \
+               $(use_with netapi libnetapi) \
+               $(use_with smbclient libsmbclient) \
+               $(use_with smbsharemodes libsmbsharemodes) \
+               $(use_with addns libaddns) \
+               $(use_with cluster ctdb /usr) \
+               $(use_with cluster cluster-support) \
+               $(use_with acl acl-support) \
+               $(use_with aio aio-support) \
+               --with-sendfile-support \
+               $(use_with winbind) \
+               ${mymod_shared} \
+               --without-included-popt \
+               --without-included-iniparser
+}
+
+src_compile() {
+       # compile libs
+       if use addns ; then
+               einfo "make addns library"
+               emake libaddns || die "emake libaddns failed"
+       fi
+       if use netapi ; then
+               einfo "make netapi library"
+               emake libnetapi || die "emake libnetapi failed"
+       fi
+       if use smbclient ; then
+               einfo "make smbclient library"
+               emake libsmbclient || die "emake libsmbclient failed"
+       fi
+       if use smbsharemodes ; then
+               einfo "make smbsharemodes library"
+               emake libsmbsharemodes || die "emake libsmbsharemodes failed"
+       fi
+
+       # compile modules
+       emake modules || die "building modules failed"
+
+       # compile pam moudles
+       if use pam ; then
+               einfo "make pam modules"
+               emake pam_modules || die "emake pam_modules failed";
+       fi
+
+       # compile winbind nss modules
+       if use winbind ; then
+               einfo "make nss modules"
+               emake nss_modules || die "emake nss_modules failed";
+       fi
+
+       # compile utilities
+       if [ -n "${BINPROGS}" ] ; then
+               einfo "make binprogs"
+               emake ${BINPROGS} || die "emake binprogs failed";
+       fi
+       if [ -n "${SBINPROGS}" ] ; then
+               einfo "make sbinprogs"
+               emake ${SBINPROGS} || die "emake sbinprogs failed";
+       fi
+
+       if use client ; then
+               einfo "make {,u}mount.cifs"
+               emake bin/{,u}mount.cifs || die "emake {,u}mount.cifs failed"
+       fi
+}
+
+src_install() {
+       # install libs
+       if use addns ; then
+               einfo "install addns library"
+               emake installlibaddns DESTDIR="${D}" || die "emake install libaddns failed"
+       fi
+       if use netapi ; then
+               einfo "install netapi library"
+               emake installlibnetapi DESTDIR="${D}" || die "emake install libnetapi failed"
+       fi
+       if use smbclient ; then
+               einfo "install smbclient library"
+               emake installlibsmbclient DESTDIR="${D}" || die "emake install libsmbclient failed"
+       fi
+       if use smbsharemodes ; then
+               einfo "install smbsharemodes library"
+               emake installlibsmbsharemodes DESTDIR="${D}" || die "emake install libsmbsharemodes failed"
+       fi
+
+       # install modules
+       emake installmodules DESTDIR="${D}" || die "installing modules failed"
+
+       if use pam ; then
+               einfo "install pam modules"
+               emake installpammodules DESTDIR="${D}" || die "emake installpammodules failed"
+
+               if use winbind ; then
+                       newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind
+                       doman ../docs/manpages/pam_winbind.8
+               fi
+
+               newpamd "${CONFDIR}/samba.pam" samba
+               dodoc pam_smbpass/README
+       fi
+
+       # Nsswitch extensions. Make link for wins and winbind resolvers
+       if use winbind ; then
+               einfo "install libwbclient"
+               emake installlibwbclient DESTDIR="${D}" || die "emake installlibwbclient failed"
+               dolib.so ../nsswitch/libnss_wins.so
+               dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2
+               dolib.so ../nsswitch/libnss_winbind.so
+               dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2
+               einfo "install libwbclient related manpages"
+               doman ../docs/manpages/idmap_rid.8
+               doman ../docs/manpages/idmap_hash.8
+               if use ldap ; then
+                       doman ../docs/manpages/idmap_adex.8
+                       doman ../docs/manpages/idmap_ldap.8
+               fi
+               if use ads ; then
+                       doman ../docs/manpages/idmap_ad.8
+               fi
+       fi
+
+       # install binaries
+       insinto /usr
+       for prog in ${SBINPROGS} ; do
+               dosbin ${prog} || die "installing ${prog} failed"
+               doman ../docs/manpages/${prog/bin\/}* || die "doman failed"
+       done
+
+       for prog in ${BINPROGS} ; do
+               dobin ${prog} || die "installing ${prog} failed"
+               doman ../docs/manpages/${prog/bin\/}* || die "doman failed"
+       done
+
+       # install server components
+       if use server ; then
+               doman ../docs/manpages/vfs* ../docs/manpages/samba.7
+
+               diropts -m0700
+               keepdir /var/lib/samba/private
+
+               diropts -m1777
+               keepdir /var/spool/samba
+
+               diropts -m0755
+               keepdir /var/{cache,log}/samba
+               keepdir /var/lib/samba/{netlogon,profiles}
+               keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR}
+               keepdir /usr/$(get_libdir)/samba/{auth,pdb,rpc,idmap,nss_info,gpext}
+
+               newconfd "${CONFDIR}/samba.confd" samba
+               newinitd "${CONFDIR}/samba.initd" samba
+
+               insinto /etc/samba
+               doins "${CONFDIR}"/{smbusers,lmhosts}
+
+               if use ldap ; then
+                       insinto /etc/openldap/schema
+                       doins ../examples/LDAP/samba.schema
+               fi
+
+               if use swat ; then
+                       insinto /etc/xinetd.d
+                       newins "${CONFDIR}/swat.xinetd" swat
+                       script/installswat.sh "${D}" "${ROOT}/usr/share/doc/${PF}/swat" "${S}" \
+                               || die "installing swat failed"
+               fi
+
+               dodoc ../MAINTAINERS ../README* ../Roadmap ../WHATSNEW.txt ../docs/THANKS
+       fi
+
+       # install client files ({u,}mount.cifs into /)
+       if use client ; then
+               into /
+               dosbin bin/{u,}mount.cifs || die "u/mount.cifs not around"
+               doman ../docs/manpages/{u,}mount.cifs.8 || die "can't create man pages"
+       fi
+
+       # install the spooler to cups
+       use cups && dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb
+
+       # install misc files
+       insinto /etc/samba
+       doins "${CONFDIR}"/smb.conf.default
+       doman  ../docs/manpages/smb.conf.5
+
+       insinto /usr/"$(get_libdir)"/samba
+       doins ../codepages/{valid.dat,upcase.dat,lowcase.dat}
+
+       # install docs
+       if use doc ; then
+               dohtml -r ../docs/htmldocs/*
+               dodoc ../docs/*.pdf
+       fi
+
+       # install examples
+       if use examples ; then
+               einfo "install examples"
+               insinto /usr/share/doc/${PF}/examples
+
+               if use smbclient ; then
+                       doins -r ../examples/libsmbclient
+               fi
+
+               if use winbind ; then
+                       doins -r ../examples/pam_winbind ../examples/nss
+               fi
+
+               if use server ; then
+                       doins -r \
+                               ../examples/{auth,autofs,dce-dfs,LDAP,logon,misc} \
+                               ../examples/{pdb,perfcounter,printer-accounting} \
+                               ../examples/{printing,scripts,tridge,validchars,VFS}
+               fi
+       fi
+
+       # Remove empty installation directories
+       rmdir --ignore-fail-on-non-empty \
+               "${D}/usr/$(get_libdir)/samba" \
+               "${D}/usr"/{sbin,bin} \
+               "${D}/usr/share"/{man,locale,} \
+               "${D}/var"/{run,lib/samba/private,lib/samba,lib,cache/samba,cache,} \
+       #       || die "tried to remove non-empty dirs, this seems like a bug in the ebuild"
+}
+
+pkg_postinst() {
+       elog "The default passdb backend has been changed to 'tdbsam' in samba 3.4!"
+       elog "That breaks existing setups using the 'smbpasswd' backend without"
+       elog "explicit declaration!"
+       elog "Please use 'passdb backend = smbpasswd' if you would like to stick to the"
+       elog "'smbpasswd' backend or convert your smbpasswd entries using e.g. "
+       elog "'pdbedit -i smbpasswd -e tdbsam'."
+       elog "For further information make sure to read the release notes at"
+       elog "http://samba.org/samba/history/${P}.html and "
+       elog "http://samba.org/samba/history/${PN}-3.4.0.html"
+}
diff --git a/net-fs/samba/samba-3.4.13-r1.ebuild b/net-fs/samba/samba-3.4.13-r1.ebuild
new file mode 100644 (file)
index 0000000..0d873be
--- /dev/null
@@ -0,0 +1,412 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.4.13-r1.ebuild,v 1.1 2011/08/04 18:52:26 maksbotan Exp $
+
+EAPI="2"
+
+inherit pam confutils versionator multilib
+
+MY_PV=${PV/_/}
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Library bits of the samba network filesystem"
+HOMEPAGE="http://www.samba.org/"
+SRC_URI="mirror://samba/${P}.tar.gz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="acl addns ads aio avahi caps +client cluster cups debug doc examples fam
+       ldap ldb +netapi pam quota +readline +server +smbclient smbsharemodes swat
+       syslog winbind "
+
+DEPEND="dev-libs/popt
+       !net-fs/samba-client
+       !net-fs/samba-libs
+       !net-fs/samba-server
+       !net-fs/cifs-utils
+       sys-libs/talloc
+       sys-libs/tdb
+       virtual/libiconv
+       ads? ( virtual/krb5 sys-fs/e2fsprogs
+               client? ( sys-apps/keyutils ) )
+       avahi? ( net-dns/avahi[dbus] )
+       caps? ( sys-libs/libcap )
+       client? ( !net-fs/mount-cifs
+               dev-libs/iniparser )
+       cluster? ( dev-db/ctdb )
+       cups? ( net-print/cups )
+       debug? ( dev-libs/dmalloc )
+       fam? ( virtual/fam )
+       ldap? ( net-nds/openldap )
+       ldb? ( sys-libs/ldb )
+       pam? ( virtual/pam
+               winbind? ( dev-libs/iniparser ) )
+       readline? ( >=sys-libs/readline-5.2 )
+       syslog? ( virtual/logger )"
+
+RDEPEND="${DEPEND}"
+
+# Disable tests since we don't want to build that much here
+RESTRICT="test"
+
+SBINPROGS=""
+BINPROGS=""
+
+if use server ; then
+       SBINPROGS="${SBINPROGS} bin/smbd bin/nmbd"
+       BINPROGS="${BINPROGS} bin/testparm bin/smbstatus bin/smbcontrol bin/pdbedit
+               bin/profiles bin/sharesec bin/eventlogadm"
+
+       use swat && SBINPROGS="${SBINPROGS} bin/swat"
+       use winbind && SBINPROGS="${SBINPROGS} bin/winbindd"
+       use ads && use winbind && SBIN_PROGS="${SBINPROGS} bin/winbind_krb5_locator"
+fi
+
+if use client ; then
+       BINPROGS="${BINPROGS} bin/smbclient bin/net bin/smbget bin/smbtree
+               bin/nmblookup bin/smbpasswd bin/rpcclient bin/smbcacls bin/smbcquotas
+               bin/ntlm_auth"
+
+       use ads && SBINPROGS="${SBINPROGS} bin/cifs.upcall"
+fi
+
+use cups && BINPROGS="${BINPROGS} bin/smbspool"
+#use ldb && BINPROGS="${BINPROGS} bin/ldbedit bin/ldbsearch bin/ldbadd bin/ldbdel bin/ldbmodify bin/ldbrename";
+
+if use winbind ; then
+       BINPROGS="${BINPROGS} bin/wbinfo"
+       mymod_shared="--with-shared-modules=idmap_rid,idmap_hash"
+       use ldap && mymod_shared="${mymod_shared},idmap_adex,idmap_ldap"
+       use ads && mymod_shared="${mymod_shared},idmap_ad"
+fi
+
+S="${WORKDIR}/${MY_P}/source3"
+
+# TODO:
+# - enable iPrint on Prefix/OSX and Darwin?
+# - selftest-prefix? selftest?
+# - AFS?
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+pkg_setup() {
+       if use winbind &&
+               [[ $(tc-getCC)$ == *gcc* ]] &&
+               [[ $(gcc-major-version)$(gcc-minor-version) -lt 43 ]]
+       then
+               eerror "It is a known issue that ${P} will not build with "
+               eerror "winbind use flag enabled when using gcc < 4.3 ."
+               eerror "Please use at least the latest stable gcc version."
+               die "Using sys-devel/gcc < 4.3 with winbind use flag."
+       fi
+
+       confutils_use_depend_all ads ldap
+       confutils_use_depend_all swat server
+       confutils_use_depend_all client netapi
+}
+
+src_prepare() {
+       cp "${FILESDIR}/samba-3.4.2-lib.tevent.python.mk" "../lib/tevent/python.mk"
+
+       # ensure that winbind has correct ldflags (QA notice)
+       sed -i \
+               -e 's|LDSHFLAGS="|LDSHFLAGS="\\${LDFLAGS} |g' \
+               configure || die "sed failed"
+
+       epatch "${CONFDIR}"/${PN}-3.4.9-kerberos-dummy.patch
+}
+
+src_configure() {
+       local myconf
+
+       # Filter out -fPIE
+       [[ ${CHOST} == *-*bsd* ]] && myconf="${myconf} --disable-pie"
+
+       # Upstream refuses to make this configurable
+       use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no
+
+       # use_with doesn't accept 2 USE-flags
+       if use client && use ads ; then
+               myconf="${myconf} --with-cifsupcall"
+       else
+               myconf="${myconf} --without-cifsupcall"
+       fi
+
+       # Notes:
+       # - automount is only needed in conjunction with NIS and we don't have that
+       # anymore => LDAP?
+       # - --without-dce-dfs and --without-nisplus-home can't be passed to configure but are disabled by default
+       econf ${myconf} \
+               --with-piddir=/var/run/samba \
+               --sysconfdir=/etc/samba \
+               --localstatedir=/var \
+               $(use_enable debug developer) \
+               --enable-largefile \
+               --enable-socket-wrapper \
+               --enable-nss-wrapper \
+               $(use_enable swat) \
+               $(use_enable debug dmalloc) \
+               $(use_enable cups) \
+               --disable-iprint \
+               $(use_enable fam) \
+               --enable-shared-libs \
+               --disable-dnssd \
+               $(use_enable avahi) \
+               --with-fhs \
+               --with-privatedir=/var/lib/samba/private \
+               --with-rootsbindir=/var/cache/samba \
+               --with-lockdir=/var/cache/samba \
+               --with-swatdir=/usr/share/doc/${PF}/swat \
+               --with-configdir=/etc/samba \
+               --with-logfilebase=/var/log/samba \
+               --with-pammodulesdir=$(getpam_mod_dir) \
+               --without-afs \
+               --without-fake-kaserver \
+               --without-vfs-afsacl \
+               $(use_with ldap) \
+               $(use_with ads) \
+               $(use_with ads krb5 /usr) \
+               $(use_with ads dnsupdate) \
+               --without-automount \
+               $(use_with client cifsmount) \
+               $(use_with pam) \
+               $(use_with pam pam_smbpass) \
+               $(use_with syslog) \
+               $(use_with quota quotas) \
+               $(use_with quota sys-quotas) \
+               --without-utmp \
+               --without-lib{talloc,tdb} \
+               $(use_with netapi libnetapi) \
+               $(use_with smbclient libsmbclient) \
+               $(use_with smbsharemodes libsmbsharemodes) \
+               $(use_with addns libaddns) \
+               $(use_with cluster ctdb /usr) \
+               $(use_with cluster cluster-support) \
+               $(use_with acl acl-support) \
+               $(use_with aio aio-support) \
+               --with-sendfile-support \
+               $(use_with winbind) \
+               ${mymod_shared} \
+               --without-included-popt \
+               --without-included-iniparser
+}
+
+src_compile() {
+       # compile libs
+       if use addns ; then
+               einfo "make addns library"
+               emake libaddns || die "emake libaddns failed"
+       fi
+       if use netapi ; then
+               einfo "make netapi library"
+               emake libnetapi || die "emake libnetapi failed"
+       fi
+       if use smbclient ; then
+               einfo "make smbclient library"
+               emake libsmbclient || die "emake libsmbclient failed"
+       fi
+       if use smbsharemodes ; then
+               einfo "make smbsharemodes library"
+               emake libsmbsharemodes || die "emake libsmbsharemodes failed"
+       fi
+
+       # compile modules
+       emake modules || die "building modules failed"
+
+       # compile pam moudles
+       if use pam ; then
+               einfo "make pam modules"
+               emake pam_modules || die "emake pam_modules failed";
+       fi
+
+       # compile winbind nss modules
+       if use winbind ; then
+               einfo "make nss modules"
+               emake nss_modules || die "emake nss_modules failed";
+       fi
+
+       # compile utilities
+       if [ -n "${BINPROGS}" ] ; then
+               einfo "make binprogs"
+               emake ${BINPROGS} || die "emake binprogs failed";
+       fi
+       if [ -n "${SBINPROGS}" ] ; then
+               einfo "make sbinprogs"
+               emake ${SBINPROGS} || die "emake sbinprogs failed";
+       fi
+
+       if use client ; then
+               einfo "make {,u}mount.cifs"
+               emake bin/{,u}mount.cifs || die "emake {,u}mount.cifs failed"
+       fi
+}
+
+src_install() {
+       # install libs
+       if use addns ; then
+               einfo "install addns library"
+               emake installlibaddns DESTDIR="${D}" || die "emake install libaddns failed"
+       fi
+       if use netapi ; then
+               einfo "install netapi library"
+               emake installlibnetapi DESTDIR="${D}" || die "emake install libnetapi failed"
+       fi
+       if use smbclient ; then
+               einfo "install smbclient library"
+               emake installlibsmbclient DESTDIR="${D}" || die "emake install libsmbclient failed"
+       fi
+       if use smbsharemodes ; then
+               einfo "install smbsharemodes library"
+               emake installlibsmbsharemodes DESTDIR="${D}" || die "emake install libsmbsharemodes failed"
+       fi
+
+       # install modules
+       emake installmodules DESTDIR="${D}" || die "installing modules failed"
+
+       if use pam ; then
+               einfo "install pam modules"
+               emake installpammodules DESTDIR="${D}" || die "emake installpammodules failed"
+
+               if use winbind ; then
+                       newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind
+                       doman ../docs/manpages/pam_winbind.8
+               fi
+
+               newpamd "${CONFDIR}/samba.pam" samba
+               dodoc pam_smbpass/README
+       fi
+
+       # Nsswitch extensions. Make link for wins and winbind resolvers
+       if use winbind ; then
+               einfo "install libwbclient"
+               emake installlibwbclient DESTDIR="${D}" || die "emake installlibwbclient failed"
+               dolib.so ../nsswitch/libnss_wins.so
+               dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2
+               dolib.so ../nsswitch/libnss_winbind.so
+               dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2
+               einfo "install libwbclient related manpages"
+               doman ../docs/manpages/idmap_rid.8
+               doman ../docs/manpages/idmap_hash.8
+               if use ldap ; then
+                       doman ../docs/manpages/idmap_adex.8
+                       doman ../docs/manpages/idmap_ldap.8
+               fi
+               if use ads ; then
+                       doman ../docs/manpages/idmap_ad.8
+               fi
+       fi
+
+       # install binaries
+       insinto /usr
+       for prog in ${SBINPROGS} ; do
+               dosbin ${prog} || die "installing ${prog} failed"
+               doman ../docs/manpages/${prog/bin\/}* || die "doman failed"
+       done
+
+       for prog in ${BINPROGS} ; do
+               dobin ${prog} || die "installing ${prog} failed"
+               doman ../docs/manpages/${prog/bin\/}* || die "doman failed"
+       done
+
+       # install server components
+       if use server ; then
+               doman ../docs/manpages/vfs* ../docs/manpages/samba.7
+
+               diropts -m0700
+               keepdir /var/lib/samba/private
+
+               diropts -m1777
+               keepdir /var/spool/samba
+
+               diropts -m0755
+               keepdir /var/{cache,log}/samba
+               keepdir /var/lib/samba/{netlogon,profiles}
+               keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR}
+               keepdir /usr/$(get_libdir)/samba/{auth,pdb,rpc,idmap,nss_info,gpext}
+
+               newconfd "${CONFDIR}/samba.confd" samba
+               newinitd "${CONFDIR}/samba.initd" samba
+
+               insinto /etc/samba
+               doins "${CONFDIR}"/{smbusers,lmhosts}
+
+               if use ldap ; then
+                       insinto /etc/openldap/schema
+                       doins ../examples/LDAP/samba.schema
+               fi
+
+               if use swat ; then
+                       insinto /etc/xinetd.d
+                       newins "${CONFDIR}/swat.xinetd" swat
+                       script/installswat.sh "${D}" "${ROOT}/usr/share/doc/${PF}/swat" "${S}" \
+                               || die "installing swat failed"
+               fi
+
+               dodoc ../MAINTAINERS ../README* ../Roadmap ../WHATSNEW.txt ../docs/THANKS
+       fi
+
+       # install client files ({u,}mount.cifs into /)
+       if use client ; then
+               into /
+               dosbin bin/{u,}mount.cifs || die "u/mount.cifs not around"
+               doman ../docs/manpages/{u,}mount.cifs.8 || die "can't create man pages"
+       fi
+
+       # install the spooler to cups
+       use cups && dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb
+
+       # install misc files
+       insinto /etc/samba
+       doins "${CONFDIR}"/smb.conf.default
+       doman  ../docs/manpages/smb.conf.5
+
+       insinto /usr/"$(get_libdir)"/samba
+       doins ../codepages/{valid.dat,upcase.dat,lowcase.dat}
+
+       # install docs
+       if use doc ; then
+               dohtml -r ../docs/htmldocs/*
+               dodoc ../docs/*.pdf
+       fi
+
+       # install examples
+       if use examples ; then
+               einfo "install examples"
+               insinto /usr/share/doc/${PF}/examples
+
+               if use smbclient ; then
+                       doins -r ../examples/libsmbclient
+               fi
+
+               if use winbind ; then
+                       doins -r ../examples/pam_winbind ../examples/nss
+               fi
+
+               if use server ; then
+                       doins -r \
+                               ../examples/{auth,autofs,dce-dfs,LDAP,logon,misc} \
+                               ../examples/{pdb,perfcounter,printer-accounting} \
+                               ../examples/{printing,scripts,tridge,validchars,VFS}
+               fi
+       fi
+
+       # Remove empty installation directories
+       rmdir --ignore-fail-on-non-empty \
+               "${D}/usr/$(get_libdir)/samba" \
+               "${D}/usr"/{sbin,bin} \
+               "${D}/usr/share"/{man,locale,} \
+               "${D}/var"/{run,lib/samba/private,lib/samba,lib,cache/samba,cache,} \
+       #       || die "tried to remove non-empty dirs, this seems like a bug in the ebuild"
+}
+
+pkg_postinst() {
+       elog "The default passdb backend has been changed to 'tdbsam' in samba 3.4!"
+       elog "That breaks existing setups using the 'smbpasswd' backend without"
+       elog "explicit declaration!"
+       elog "Please use 'passdb backend = smbpasswd' if you would like to stick to the"
+       elog "'smbpasswd' backend or convert your smbpasswd entries using e.g. "
+       elog "'pdbedit -i smbpasswd -e tdbsam'."
+       elog "For further information make sure to read the release notes at"
+       elog "http://samba.org/samba/history/${P}.html and "
+       elog "http://samba.org/samba/history/${PN}-3.4.0.html"
+}
diff --git a/net-fs/samba/samba-3.5.8-r2.ebuild b/net-fs/samba/samba-3.5.8-r2.ebuild
new file mode 100644 (file)
index 0000000..fcceb77
--- /dev/null
@@ -0,0 +1,445 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.5.8-r2.ebuild,v 1.1 2011/08/04 18:52:26 maksbotan Exp $
+
+EAPI=4
+
+inherit pam versionator multilib eutils
+
+MY_PV=${PV/_/}
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Library bits of the samba network filesystem"
+HOMEPAGE="http://www.samba.org/"
+SRC_URI="mirror://samba/${P}.tar.gz
+       http://dev.gentoo.org/~dagger/files/smb_traffic_analyzer_v2.diff.bz2"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="acl addns ads +aio avahi caps +client cluster cups debug doc examples fam
+       ldap ldb +netapi pam quota +readline +server +smbclient smbsharemodes smbtav2
+       swat syslog winbind"
+
+DEPEND="dev-libs/popt
+       !net-fs/samba-client
+       !net-fs/samba-libs
+       !net-fs/samba-server
+       !net-fs/cifs-utils
+       sys-libs/talloc
+       sys-libs/tdb
+       virtual/libiconv
+       ads? ( virtual/krb5 sys-fs/e2fsprogs
+               client? ( sys-apps/keyutils ) )
+       avahi? ( net-dns/avahi[dbus] )
+       caps? ( sys-libs/libcap )
+       client? ( !net-fs/mount-cifs
+               dev-libs/iniparser )
+       cluster? ( >=dev-db/ctdb-1.0.114_p1 )
+       cups? ( net-print/cups )
+       debug? ( dev-libs/dmalloc )
+       fam? ( virtual/fam )
+       ldap? ( net-nds/openldap )
+       ldb? ( sys-libs/ldb )
+       pam? ( virtual/pam
+               winbind? ( dev-libs/iniparser )
+       )
+       readline? ( >=sys-libs/readline-5.2 )
+       syslog? ( virtual/logger )"
+
+RDEPEND="${DEPEND}"
+
+# Disable tests since we don't want to build that much here
+RESTRICT="test"
+
+SBINPROGS=""
+BINPROGS=""
+KRBPLUGIN=""
+PLUGINEXT=".so"
+SHAREDMODS=""
+
+S="${WORKDIR}/${MY_P}/source3"
+
+# TODO:
+# - enable iPrint on Prefix/OSX and Darwin?
+# - selftest-prefix? selftest?
+# - AFS?
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+REQUIRED_USE="
+       ads? ( ldap )
+       swat? ( server )
+"
+
+pkg_setup() {
+       if use server ; then
+               SBINPROGS="${SBINPROGS} bin/smbd bin/nmbd"
+               BINPROGS="${BINPROGS} bin/testparm bin/smbstatus bin/smbcontrol bin/pdbedit
+                       bin/profiles bin/sharesec bin/eventlogadm"
+
+               use smbtav2 && BINPROGS="${BINPROGS} bin/smbta-util"
+               use swat && SBINPROGS="${SBINPROGS} bin/swat"
+               use winbind && SBINPROGS="${SBINPROGS} bin/winbindd"
+               use ads && use winbind && KRBPLUGIN="${KRBPLUGIN} bin/winbind_krb5_locator"
+       fi
+
+       if use client ; then
+               BINPROGS="${BINPROGS} bin/smbclient bin/net bin/smbget bin/smbtree
+                       bin/nmblookup bin/smbpasswd bin/rpcclient bin/smbcacls bin/smbcquotas
+                       bin/ntlm_auth"
+
+               use ads && SBINPROGS="${SBINPROGS} bin/cifs.upcall"
+       fi
+
+       use cups && BINPROGS="${BINPROGS} bin/smbspool"
+#      use ldb && BINPROGS="${BINPROGS} bin/ldbedit bin/ldbsearch bin/ldbadd bin/ldbdel bin/ldbmodify bin/ldbrename";
+
+       if use winbind ; then
+               BINPROGS="${BINPROGS} bin/wbinfo"
+               SHAREDMODS="${SHAREDMODS}idmap_rid,idmap_hash"
+               use ads && SHAREDMODS="${SHAREDMODS},idmap_ad"
+               use ldap && SHAREDMODS="${SHAREDMODS},idmap_ldap,idmap_adex"
+       fi
+
+       if use winbind &&
+               [[ $(tc-getCC)$ == *gcc* ]] &&
+               [[ $(gcc-major-version)$(gcc-minor-version) -lt 43 ]]
+       then
+               eerror "It is a known issue that ${P} will not build with "
+               eerror "winbind use flag enabled when using gcc < 4.3 ."
+               eerror "Please use at least the latest stable gcc version."
+               die "Using sys-devel/gcc < 4.3 with winbind use flag."
+       fi
+}
+
+src_prepare() {
+       cp "${FILESDIR}/samba-3.4.2-lib.tevent.python.mk" "../lib/tevent/python.mk"
+
+       # ensure that winbind has correct ldflags (QA notice)
+       sed -i \
+               -e 's|LDSHFLAGS="|LDSHFLAGS="\\${LDFLAGS} |g' \
+               configure || die "sed failed"
+
+       epatch "${CONFDIR}"/${PN}-3.5.6-kerberos-dummy.patch
+       use smbtav2 && cd "${WORKDIR}/${P}" && epatch "${WORKDIR}"/smb_traffic_analyzer_v2.diff
+       cd "${WORKDIR}/${MY_P}" && epatch "${CONFDIR}"/${PN}-3.5.8-uclib-build.patch
+}
+
+src_configure() {
+       local myconf
+
+       # Filter out -fPIE
+       [[ ${CHOST} == *-*bsd* ]] && myconf+=" --disable-pie"
+
+       # Upstream refuses to make this configurable
+       use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no
+
+       # use_with doesn't accept 2 USE-flags
+       if use client && use ads ; then
+               myconf+=" --with-cifsupcall"
+       else
+               myconf+=" --without-cifsupcall"
+       fi
+
+       # Notes:
+       # - automount is only needed in conjunction with NIS and we don't have that
+       # anymore => LDAP?
+       # - --without-dce-dfs and --without-nisplus-home can't be passed to configure but are disabled by default
+       econf ${myconf} \
+               --with-piddir=/var/run/samba \
+               --sysconfdir=/etc/samba \
+               --localstatedir=/var \
+               $(use_enable debug developer) \
+               --enable-largefile \
+               --enable-socket-wrapper \
+               --enable-nss-wrapper \
+               $(use_enable swat) \
+               $(use_enable debug dmalloc) \
+               $(use_enable cups) \
+               --disable-iprint \
+               $(use_enable fam) \
+               --enable-shared-libs \
+               --disable-dnssd \
+               $(use_enable avahi) \
+               --with-fhs \
+               --with-privatedir=/var/lib/samba/private \
+               --with-rootsbindir=/var/cache/samba \
+               --with-lockdir=/var/cache/samba \
+               --with-swatdir=/usr/share/doc/${PF}/swat \
+               --with-configdir=/etc/samba \
+               --with-logfilebase=/var/log/samba \
+               --with-pammodulesdir=$(getpam_mod_dir) \
+               --without-afs \
+               --without-fake-kaserver \
+               --without-vfs-afsacl \
+               $(use_with ldap) \
+               $(use_with ads) \
+               $(use_with ads krb5 /usr) \
+               $(use_with ads dnsupdate) \
+               --without-automount \
+               $(use_with client cifsmount) \
+               $(use_with client cifsumount) \
+               $(use_with pam) \
+               $(use_with pam pam_smbpass) \
+               $(use_with syslog) \
+               $(use_with quota quotas) \
+               $(use_with quota sys-quotas) \
+               --without-utmp \
+               --without-lib{talloc,tdb} \
+               $(use_with netapi libnetapi) \
+               $(use_with smbclient libsmbclient) \
+               $(use_with smbsharemodes libsmbsharemodes) \
+               $(use_with addns libaddns) \
+               $(use_with cluster ctdb /usr) \
+               $(use_with cluster cluster-support) \
+               $(use_with acl acl-support) \
+               $(use_with aio aio-support) \
+               --with-sendfile-support \
+               $(use_with winbind) \
+               --with-shared-modules=${SHAREDMODS} \
+               --without-included-popt \
+               --without-included-iniparser
+}
+
+src_compile() {
+       # compile libs
+       if use addns ; then
+               einfo "make addns library"
+               emake libaddns
+       fi
+       if use netapi ; then
+               einfo "make netapi library"
+               emake libnetapi
+       fi
+       if use smbclient ; then
+               einfo "make smbclient library"
+               emake libsmbclient
+       fi
+       if use smbsharemodes ; then
+               einfo "make smbsharemodes library"
+               emake libsmbsharemodes
+       fi
+
+       # compile modules
+       emake modules
+
+       # compile pam moudles
+       if use pam ; then
+               einfo "make pam modules"
+               emake pam_modules
+       fi
+
+       # compile winbind nss modules
+       if use winbind ; then
+               einfo "make nss modules"
+               emake nss_modules
+       fi
+
+       # compile utilities
+       if [ -n "${BINPROGS}" ] ; then
+               einfo "make binprogs"
+               emake ${BINPROGS}
+       fi
+       if [ -n "${SBINPROGS}" ] ; then
+               einfo "make sbinprogs"
+               emake ${SBINPROGS}
+       fi
+
+       if [ -n "${KRBPLUGIN}" ] ; then
+               einfo "make krbplugin"
+               emake ${KRBPLUGIN}${PLUGINEXT}
+       fi
+
+       if use client ; then
+               einfo "make {,u}mount.cifs"
+               emake bin/{,u}mount.cifs
+       fi
+}
+
+src_install() {
+       # install libs
+       if use addns ; then
+               einfo "install addns library"
+               emake installlibaddns DESTDIR="${D}"
+       fi
+       if use netapi ; then
+               einfo "install netapi library"
+               emake installlibnetapi DESTDIR="${D}"
+       fi
+       if use smbclient ; then
+               einfo "install smbclient library"
+               emake installlibsmbclient DESTDIR="${D}"
+       fi
+       if use smbsharemodes ; then
+               einfo "install smbsharemodes library"
+               emake installlibsmbsharemodes DESTDIR="${D}"
+       fi
+
+       # install modules
+       emake installmodules DESTDIR="${D}"
+
+       if use pam ; then
+               einfo "install pam modules"
+               emake installpammodules DESTDIR="${D}"
+
+               if use winbind ; then
+                       newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind
+                       doman ../docs/manpages/pam_winbind.8
+               fi
+
+               newpamd "${CONFDIR}/samba.pam" samba
+               dodoc pam_smbpass/README
+       fi
+
+       # Nsswitch extensions. Make link for wins and winbind resolvers
+       if use winbind ; then
+               einfo "install libwbclient"
+               emake installlibwbclient DESTDIR="${D}"
+               dolib.so ../nsswitch/libnss_wins.so
+               dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2
+               dolib.so ../nsswitch/libnss_winbind.so
+               dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2
+               einfo "install libwbclient related manpages"
+               doman ../docs/manpages/idmap_rid.8
+               doman ../docs/manpages/idmap_hash.8
+               if use ldap ; then
+                       doman ../docs/manpages/idmap_adex.8
+                       doman ../docs/manpages/idmap_ldap.8
+               fi
+               if use ads ; then
+                       doman ../docs/manpages/idmap_ad.8
+               fi
+       fi
+
+       # install binaries
+       insinto /usr
+       for prog in ${SBINPROGS} ; do
+               dosbin ${prog}
+               doman ../docs/manpages/${prog/bin\/}*
+       done
+
+       for prog in ${BINPROGS} ; do
+               dobin ${prog}
+               doman ../docs/manpages/${prog/bin\/}*
+       done
+
+       # install krbplugin
+       if [ -n "${KRBPLUGIN}" ] ; then
+               if has_version app-crypt/mit-krb5 ; then
+                       insinto /usr/$(get_libdir)/krb5/plugins/libkrb5
+                       doins ${KRBPLUGIN}${PLUGINEXT}
+               elif has_version app-crypt/heimdal ; then
+                       insinto /usr/$(get_libdir)/plugin/krb5
+                       doins ${KRBPLUGIN}${PLUGINEXT}
+               fi
+               insinto /usr
+               for prog in ${KRBPLUGIN} ; do
+                       doman ../docs/manpages/${prog/bin\/}*
+               done
+       fi
+
+       # install server components
+       if use server ; then
+               doman ../docs/manpages/vfs* ../docs/manpages/samba.7
+
+               diropts -m0700
+               keepdir /var/lib/samba/private
+
+               diropts -m1777
+               keepdir /var/spool/samba
+
+               diropts -m0755
+               keepdir /var/{cache,log}/samba
+               keepdir /var/lib/samba/{netlogon,profiles}
+               keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR}
+               keepdir /usr/$(get_libdir)/samba/{auth,pdb,rpc,idmap,nss_info,gpext}
+
+               newconfd "${CONFDIR}/samba.confd" samba
+               newinitd "${CONFDIR}/samba.initd" samba
+
+               insinto /etc/samba
+               doins "${CONFDIR}"/{smbusers,lmhosts}
+
+               if use ldap ; then
+                       insinto /etc/openldap/schema
+                       doins ../examples/LDAP/samba.schema
+               fi
+
+               if use swat ; then
+                       insinto /etc/xinetd.d
+                       newins "${CONFDIR}/swat.xinetd" swat
+                       script/installswat.sh "${D}" "${ROOT}/usr/share/doc/${PF}/swat" "${S}"
+               fi
+
+               dodoc ../MAINTAINERS ../README* ../Roadmap ../WHATSNEW.txt ../docs/THANKS
+       fi
+
+       # install client files ({u,}mount.cifs into /)
+       if use client ; then
+               into /
+               dosbin bin/{u,}mount.cifs
+               doman ../docs/manpages/{u,}mount.cifs.8
+       fi
+
+       # install the spooler to cups
+       if use cups ; then
+               dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb
+       fi
+
+       # install misc files
+       insinto /etc/samba
+       doins "${CONFDIR}"/smb.conf.default
+       doman  ../docs/manpages/smb.conf.5
+
+       insinto /usr/"$(get_libdir)"/samba
+       doins ../codepages/{valid.dat,upcase.dat,lowcase.dat}
+
+       # install docs
+       if use doc ; then
+               dohtml -r ../docs/htmldocs/*
+               dodoc ../docs/*.pdf
+       fi
+
+       # install examples
+       if use examples ; then
+               insinto /usr/share/doc/${PF}/examples
+
+               if use smbclient ; then
+                       doins -r ../examples/libsmbclient
+               fi
+
+               if use winbind ; then
+                       doins -r ../examples/pam_winbind ../examples/nss
+               fi
+
+               if use server ; then
+                       cd ../examples
+                       doins -r auth autofs dce-dfs LDAP logon misc pdb \
+                       perfcounter printer-accounting printing scripts tridge \
+                       validchars VFS
+               fi
+       fi
+
+       # Remove empty installation directories
+       rmdir --ignore-fail-on-non-empty \
+               "${D}/usr/$(get_libdir)/samba" \
+               "${D}/usr"/{sbin,bin} \
+               "${D}/usr/share"/{man,locale,} \
+               "${D}/var"/{run,lib/samba/private,lib/samba,lib,cache/samba,cache,} \
+       #       || die "tried to remove non-empty dirs, this seems like a bug in the ebuild"
+}
+
+pkg_postinst() {
+       elog "The default value of 'wide links' has been changed to 'no' in samba 3.5"
+       elog "to avoid an insecure default configuration"
+       elog "('wide links = yes' and 'unix extensions = yes'). For more details,"
+       elog "please see http://www.samba.org/samba/news/symlink_attack.html ."
+       elog ""
+       elog "An EXPERIMENTAL implementation of the SMB2 protocol has been added."
+       elog "SMB2 can be enabled by setting 'max protocol = smb2'. SMB2 is a new "
+       elog "implementation of the SMB protocol used by Windows Vista and higher"
+       elog ""
+       elog "For further information make sure to read the release notes at"
+       elog "http://samba.org/samba/history/${P}.html and "
+       elog "http://samba.org/samba/history/${PN}-3.5.0.html"
+}
diff --git a/net-fs/samba/samba-3.5.9-r1.ebuild b/net-fs/samba/samba-3.5.9-r1.ebuild
new file mode 100644 (file)
index 0000000..a0eddc3
--- /dev/null
@@ -0,0 +1,446 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.5.9-r1.ebuild,v 1.1 2011/08/04 18:52:26 maksbotan Exp $
+
+EAPI=4
+
+inherit pam versionator multilib eutils
+
+MY_PV=${PV/_/}
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Library bits of the samba network filesystem"
+HOMEPAGE="http://www.samba.org/"
+SRC_URI="mirror://samba/${P}.tar.gz
+       http://dev.gentoo.org/~dagger/files/smb_traffic_analyzer_v2.diff.bz2"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="acl addns ads +aio avahi caps +client cluster cups debug doc examples fam
+       ldap ldb +netapi pam quota +readline +server +smbclient smbsharemodes smbtav2
+       swat syslog winbind"
+
+DEPEND="dev-libs/popt
+       !net-fs/samba-client
+       !net-fs/samba-libs
+       !net-fs/samba-server
+       !net-fs/cifs-utils
+       sys-libs/talloc
+       sys-libs/tdb
+       virtual/libiconv
+       ads? ( virtual/krb5 sys-fs/e2fsprogs
+               client? ( sys-apps/keyutils ) )
+       avahi? ( net-dns/avahi[dbus] )
+       caps? ( sys-libs/libcap )
+       client? ( !net-fs/mount-cifs
+               dev-libs/iniparser )
+       cluster? ( >=dev-db/ctdb-1.0.114_p1 )
+       cups? ( net-print/cups )
+       debug? ( dev-libs/dmalloc )
+       fam? ( virtual/fam )
+       ldap? ( net-nds/openldap )
+       ldb? ( sys-libs/ldb )
+       pam? ( virtual/pam
+               winbind? ( dev-libs/iniparser )
+       )
+       readline? ( >=sys-libs/readline-5.2 )
+       syslog? ( virtual/logger )"
+
+RDEPEND="${DEPEND}"
+
+# Disable tests since we don't want to build that much here
+RESTRICT="test"
+
+SBINPROGS=""
+BINPROGS=""
+KRBPLUGIN=""
+PLUGINEXT=".so"
+SHAREDMODS=""
+
+S="${WORKDIR}/${MY_P}/source3"
+
+# TODO:
+# - enable iPrint on Prefix/OSX and Darwin?
+# - selftest-prefix? selftest?
+# - AFS?
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+REQUIRED_USE="
+       ads? ( ldap )
+       swat? ( server )
+"
+
+pkg_setup() {
+       if use server ; then
+               SBINPROGS="${SBINPROGS} bin/smbd bin/nmbd"
+               BINPROGS="${BINPROGS} bin/testparm bin/smbstatus bin/smbcontrol bin/pdbedit
+                       bin/profiles bin/sharesec bin/eventlogadm"
+
+               use smbtav2 && BINPROGS="${BINPROGS} bin/smbta-util"
+               use swat && SBINPROGS="${SBINPROGS} bin/swat"
+               use winbind && SBINPROGS="${SBINPROGS} bin/winbindd"
+               use ads && use winbind && KRBPLUGIN="${KRBPLUGIN} bin/winbind_krb5_locator"
+       fi
+
+       if use client ; then
+               BINPROGS="${BINPROGS} bin/smbclient bin/net bin/smbget bin/smbtree
+                       bin/nmblookup bin/smbpasswd bin/rpcclient bin/smbcacls bin/smbcquotas
+                       bin/ntlm_auth"
+
+               use ads && SBINPROGS="${SBINPROGS} bin/cifs.upcall"
+       fi
+
+       use cups && BINPROGS="${BINPROGS} bin/smbspool"
+#      use ldb && BINPROGS="${BINPROGS} bin/ldbedit bin/ldbsearch bin/ldbadd bin/ldbdel bin/ldbmodify bin/ldbrename";
+
+       if use winbind ; then
+               BINPROGS="${BINPROGS} bin/wbinfo"
+               SHAREDMODS="${SHAREDMODS}idmap_rid,idmap_hash"
+               use ads && SHAREDMODS="${SHAREDMODS},idmap_ad"
+               use ldap && SHAREDMODS="${SHAREDMODS},idmap_ldap,idmap_adex"
+       fi
+
+       if use winbind &&
+               [[ $(tc-getCC)$ == *gcc* ]] &&
+               [[ $(gcc-major-version)$(gcc-minor-version) -lt 43 ]]
+       then
+               eerror "It is a known issue that ${P} will not build with "
+               eerror "winbind use flag enabled when using gcc < 4.3 ."
+               eerror "Please use at least the latest stable gcc version."
+               die "Using sys-devel/gcc < 4.3 with winbind use flag."
+       fi
+}
+
+src_prepare() {
+       cp "${FILESDIR}/samba-3.4.2-lib.tevent.python.mk" "../lib/tevent/python.mk"
+
+       # ensure that winbind has correct ldflags (QA notice)
+       sed -i \
+               -e 's|LDSHFLAGS="|LDSHFLAGS="\\${LDFLAGS} |g' \
+               configure || die "sed failed"
+
+       epatch "${CONFDIR}"/${PN}-3.5.6-kerberos-dummy.patch
+       use smbtav2 && cd "${WORKDIR}/${P}" && epatch "${WORKDIR}"/smb_traffic_analyzer_v2.diff
+       cd "${WORKDIR}/${MY_P}" && epatch "${CONFDIR}"/${PN}-3.5.8-uclib-build.patch
+       epatch "${CONFDIR}"/smb.conf.default.patch
+}
+
+src_configure() {
+       local myconf
+
+       # Filter out -fPIE
+       [[ ${CHOST} == *-*bsd* ]] && myconf+=" --disable-pie"
+
+       # Upstream refuses to make this configurable
+       use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no
+
+       # use_with doesn't accept 2 USE-flags
+       if use client && use ads ; then
+               myconf+=" --with-cifsupcall"
+       else
+               myconf+=" --without-cifsupcall"
+       fi
+
+       # Notes:
+       # - automount is only needed in conjunction with NIS and we don't have that
+       # anymore => LDAP?
+       # - --without-dce-dfs and --without-nisplus-home can't be passed to configure but are disabled by default
+       econf ${myconf} \
+               --with-piddir=/var/run/samba \
+               --sysconfdir=/etc/samba \
+               --localstatedir=/var \
+               $(use_enable debug developer) \
+               --enable-largefile \
+               --enable-socket-wrapper \
+               --enable-nss-wrapper \
+               $(use_enable swat) \
+               $(use_enable debug dmalloc) \
+               $(use_enable cups) \
+               --disable-iprint \
+               $(use_enable fam) \
+               --enable-shared-libs \
+               --disable-dnssd \
+               $(use_enable avahi) \
+               --with-fhs \
+               --with-privatedir=/var/lib/samba/private \
+               --with-rootsbindir=/var/cache/samba \
+               --with-lockdir=/var/cache/samba \
+               --with-swatdir=/usr/share/doc/${PF}/swat \
+               --with-configdir=/etc/samba \
+               --with-logfilebase=/var/log/samba \
+               --with-pammodulesdir=$(getpam_mod_dir) \
+               --without-afs \
+               --without-fake-kaserver \
+               --without-vfs-afsacl \
+               $(use_with ldap) \
+               $(use_with ads) \
+               $(use_with ads krb5 /usr) \
+               $(use_with ads dnsupdate) \
+               --without-automount \
+               $(use_with client cifsmount) \
+               $(use_with client cifsumount) \
+               $(use_with pam) \
+               $(use_with pam pam_smbpass) \
+               $(use_with syslog) \
+               $(use_with quota quotas) \
+               $(use_with quota sys-quotas) \
+               --without-utmp \
+               --without-lib{talloc,tdb} \
+               $(use_with netapi libnetapi) \
+               $(use_with smbclient libsmbclient) \
+               $(use_with smbsharemodes libsmbsharemodes) \
+               $(use_with addns libaddns) \
+               $(use_with cluster ctdb /usr) \
+               $(use_with cluster cluster-support) \
+               $(use_with acl acl-support) \
+               $(use_with aio aio-support) \
+               --with-sendfile-support \
+               $(use_with winbind) \
+               --with-shared-modules=${SHAREDMODS} \
+               --without-included-popt \
+               --without-included-iniparser
+}
+
+src_compile() {
+       # compile libs
+       if use addns ; then
+               einfo "make addns library"
+               emake libaddns
+       fi
+       if use netapi ; then
+               einfo "make netapi library"
+               emake libnetapi
+       fi
+       if use smbclient ; then
+               einfo "make smbclient library"
+               emake libsmbclient
+       fi
+       if use smbsharemodes ; then
+               einfo "make smbsharemodes library"
+               emake libsmbsharemodes
+       fi
+
+       # compile modules
+       emake modules
+
+       # compile pam moudles
+       if use pam ; then
+               einfo "make pam modules"
+               emake pam_modules
+       fi
+
+       # compile winbind nss modules
+       if use winbind ; then
+               einfo "make nss modules"
+               emake nss_modules
+       fi
+
+       # compile utilities
+       if [ -n "${BINPROGS}" ] ; then
+               einfo "make binprogs"
+               emake ${BINPROGS}
+       fi
+       if [ -n "${SBINPROGS}" ] ; then
+               einfo "make sbinprogs"
+               emake ${SBINPROGS}
+       fi
+
+       if [ -n "${KRBPLUGIN}" ] ; then
+               einfo "make krbplugin"
+               emake ${KRBPLUGIN}${PLUGINEXT}
+       fi
+
+       if use client ; then
+               einfo "make {,u}mount.cifs"
+               emake bin/{,u}mount.cifs
+       fi
+}
+
+src_install() {
+       # install libs
+       if use addns ; then
+               einfo "install addns library"
+               emake installlibaddns DESTDIR="${D}"
+       fi
+       if use netapi ; then
+               einfo "install netapi library"
+               emake installlibnetapi DESTDIR="${D}"
+       fi
+       if use smbclient ; then
+               einfo "install smbclient library"
+               emake installlibsmbclient DESTDIR="${D}"
+       fi
+       if use smbsharemodes ; then
+               einfo "install smbsharemodes library"
+               emake installlibsmbsharemodes DESTDIR="${D}"
+       fi
+
+       # install modules
+       emake installmodules DESTDIR="${D}"
+
+       if use pam ; then
+               einfo "install pam modules"
+               emake installpammodules DESTDIR="${D}"
+
+               if use winbind ; then
+                       newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind
+                       doman ../docs/manpages/pam_winbind.8
+               fi
+
+               newpamd "${CONFDIR}/samba.pam" samba
+               dodoc pam_smbpass/README
+       fi
+
+       # Nsswitch extensions. Make link for wins and winbind resolvers
+       if use winbind ; then
+               einfo "install libwbclient"
+               emake installlibwbclient DESTDIR="${D}"
+               dolib.so ../nsswitch/libnss_wins.so
+               dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2
+               dolib.so ../nsswitch/libnss_winbind.so
+               dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2
+               einfo "install libwbclient related manpages"
+               doman ../docs/manpages/idmap_rid.8
+               doman ../docs/manpages/idmap_hash.8
+               if use ldap ; then
+                       doman ../docs/manpages/idmap_adex.8
+                       doman ../docs/manpages/idmap_ldap.8
+               fi
+               if use ads ; then
+                       doman ../docs/manpages/idmap_ad.8
+               fi
+       fi
+
+       # install binaries
+       insinto /usr
+       for prog in ${SBINPROGS} ; do
+               dosbin ${prog}
+               doman ../docs/manpages/${prog/bin\/}*
+       done
+
+       for prog in ${BINPROGS} ; do
+               dobin ${prog}
+               doman ../docs/manpages/${prog/bin\/}*
+       done
+
+       # install krbplugin
+       if [ -n "${KRBPLUGIN}" ] ; then
+               if has_version app-crypt/mit-krb5 ; then
+                       insinto /usr/$(get_libdir)/krb5/plugins/libkrb5
+                       doins ${KRBPLUGIN}${PLUGINEXT}
+               elif has_version app-crypt/heimdal ; then
+                       insinto /usr/$(get_libdir)/plugin/krb5
+                       doins ${KRBPLUGIN}${PLUGINEXT}
+               fi
+               insinto /usr
+               for prog in ${KRBPLUGIN} ; do
+                       doman ../docs/manpages/${prog/bin\/}*
+               done
+       fi
+
+       # install server components
+       if use server ; then
+               doman ../docs/manpages/vfs* ../docs/manpages/samba.7
+
+               diropts -m0700
+               keepdir /var/lib/samba/private
+
+               diropts -m1777
+               keepdir /var/spool/samba
+
+               diropts -m0755
+               keepdir /var/{cache,log}/samba
+               keepdir /var/lib/samba/{netlogon,profiles}
+               keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR}
+               keepdir /usr/$(get_libdir)/samba/{auth,pdb,rpc,idmap,nss_info,gpext}
+
+               newconfd "${CONFDIR}/samba.confd" samba
+               newinitd "${CONFDIR}/samba.initd" samba
+
+               insinto /etc/samba
+               doins "${CONFDIR}"/{smbusers,lmhosts}
+
+               if use ldap ; then
+                       insinto /etc/openldap/schema
+                       doins ../examples/LDAP/samba.schema
+               fi
+
+               if use swat ; then
+                       insinto /etc/xinetd.d
+                       newins "${CONFDIR}/swat.xinetd" swat
+                       script/installswat.sh "${D}" "${ROOT}/usr/share/doc/${PF}/swat" "${S}"
+               fi
+
+               dodoc ../MAINTAINERS ../README* ../Roadmap ../WHATSNEW.txt ../docs/THANKS
+       fi
+
+       # install client files ({u,}mount.cifs into /)
+       if use client ; then
+               into /
+               dosbin bin/{u,}mount.cifs
+               doman ../docs/manpages/{u,}mount.cifs.8
+       fi
+
+       # install the spooler to cups
+       if use cups ; then
+               dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb
+       fi
+
+       # install misc files
+       insinto /etc/samba
+       doins ../examples/smb.conf.default
+       doman  ../docs/manpages/smb.conf.5
+
+       insinto /usr/"$(get_libdir)"/samba
+       doins ../codepages/{valid.dat,upcase.dat,lowcase.dat}
+
+       # install docs
+       if use doc ; then
+               dohtml -r ../docs/htmldocs/*
+               dodoc ../docs/*.pdf
+       fi
+
+       # install examples
+       if use examples ; then
+               insinto /usr/share/doc/${PF}/examples
+
+               if use smbclient ; then
+                       doins -r ../examples/libsmbclient
+               fi
+
+               if use winbind ; then
+                       doins -r ../examples/pam_winbind ../examples/nss
+               fi
+
+               if use server ; then
+                       cd ../examples
+                       doins -r auth autofs dce-dfs LDAP logon misc pdb \
+                       perfcounter printer-accounting printing scripts tridge \
+                       validchars VFS
+               fi
+       fi
+
+       # Remove empty installation directories
+       rmdir --ignore-fail-on-non-empty \
+               "${D}/usr/$(get_libdir)/samba" \
+               "${D}/usr"/{sbin,bin} \
+               "${D}/usr/share"/{man,locale,} \
+               "${D}/var"/{run,lib/samba/private,lib/samba,lib,cache/samba,cache,} \
+       #       || die "tried to remove non-empty dirs, this seems like a bug in the ebuild"
+}
+
+pkg_postinst() {
+       elog "The default value of 'wide links' has been changed to 'no' in samba 3.5"
+       elog "to avoid an insecure default configuration"
+       elog "('wide links = yes' and 'unix extensions = yes'). For more details,"
+       elog "please see http://www.samba.org/samba/news/symlink_attack.html ."
+       elog ""
+       elog "An EXPERIMENTAL implementation of the SMB2 protocol has been added."
+       elog "SMB2 can be enabled by setting 'max protocol = smb2'. SMB2 is a new "
+       elog "implementation of the SMB protocol used by Windows Vista and higher"
+       elog ""
+       elog "For further information make sure to read the release notes at"
+       elog "http://samba.org/samba/history/${P}.html and "
+       elog "http://samba.org/samba/history/${PN}-3.5.0.html"
+}
diff --git a/net-fs/samba/samba-3.6.0_rc3-r1.ebuild b/net-fs/samba/samba-3.6.0_rc3-r1.ebuild
new file mode 100644 (file)
index 0000000..7c701b6
--- /dev/null
@@ -0,0 +1,420 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-fs/samba/samba-3.6.0_rc3-r1.ebuild,v 1.1 2011/08/04 18:52:26 maksbotan Exp $
+
+EAPI=4
+
+inherit pam versionator multilib eutils
+
+MY_PV=${PV/_/}
+MY_P="${PN}-${MY_PV}"
+
+DESCRIPTION="Library bits of the samba network filesystem"
+HOMEPAGE="http://www.samba.org/"
+SRC_URI="mirror://samba/rc/${MY_P}.tar.gz"
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="acl addns ads +aio avahi caps +client cluster cups debug doc examples fam
+       ldap ldb +netapi pam quota +readline +server +smbclient smbsharemodes
+       swat syslog winbind"
+
+DEPEND="dev-libs/popt
+       !net-fs/samba-client
+       !net-fs/samba-libs
+       !net-fs/samba-server
+       >=sys-libs/talloc-2.0.5
+       >=sys-libs/tdb-1.2.9
+       virtual/libiconv
+       ads? ( virtual/krb5 sys-fs/e2fsprogs
+               client? ( sys-apps/keyutils
+                       net-fs/cifs-utils[ads] ) )
+       avahi? ( net-dns/avahi[dbus] )
+       caps? ( sys-libs/libcap )
+       client? ( !net-fs/mount-cifs
+               dev-libs/iniparser
+               net-fs/cifs-utils )
+       cluster? ( >=dev-db/ctdb-1.0.114_p1 )
+       cups? ( net-print/cups )
+       debug? ( dev-libs/dmalloc )
+       fam? ( virtual/fam )
+       ldap? ( net-nds/openldap )
+       ldb? ( sys-libs/ldb )
+       pam? ( virtual/pam
+               winbind? ( dev-libs/iniparser )
+       )
+       readline? ( >=sys-libs/readline-5.2 )
+       syslog? ( virtual/logger )"
+
+RDEPEND="${DEPEND}"
+
+# Disable tests since we don't want to build that much here
+RESTRICT="test"
+
+SBINPROGS=""
+BINPROGS=""
+KRBPLUGIN=""
+PLUGINEXT=".so"
+SHAREDMODS=""
+
+S="${WORKDIR}/${MY_P}/source3"
+
+# TODO:
+# - enable iPrint on Prefix/OSX and Darwin?
+# - selftest-prefix? selftest?
+# - AFS?
+
+CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+
+REQUIRED_USE="
+       ads? ( ldap )
+       swat? ( server )
+"
+
+pkg_setup() {
+       if use server ; then
+               SBINPROGS="${SBINPROGS} bin/smbd bin/nmbd"
+               BINPROGS="${BINPROGS} bin/testparm bin/smbstatus bin/smbcontrol bin/pdbedit
+                       bin/profiles bin/sharesec bin/eventlogadm bin/smbta-util"
+
+               use swat && SBINPROGS="${SBINPROGS} bin/swat"
+               use winbind && SBINPROGS="${SBINPROGS} bin/winbindd"
+               use ads && use winbind && KRBPLUGIN="${KRBPLUGIN} bin/winbind_krb5_locator"
+       fi
+
+       if use client ; then
+               BINPROGS="${BINPROGS} bin/smbclient bin/net bin/smbget bin/smbtree
+                       bin/nmblookup bin/smbpasswd bin/rpcclient bin/smbcacls bin/smbcquotas
+                       bin/ntlm_auth"
+
+       fi
+
+       use cups && BINPROGS="${BINPROGS} bin/smbspool"
+#      use ldb && BINPROGS="${BINPROGS} bin/ldbedit bin/ldbsearch bin/ldbadd bin/ldbdel bin/ldbmodify bin/ldbrename";
+
+       if use winbind ; then
+               BINPROGS="${BINPROGS} bin/wbinfo"
+               SHAREDMODS="${SHAREDMODS}idmap_rid,idmap_hash"
+               use ads && SHAREDMODS="${SHAREDMODS},idmap_ad"
+               use ldap && SHAREDMODS="${SHAREDMODS},idmap_ldap,idmap_adex"
+       fi
+
+       if use winbind &&
+               [[ $(tc-getCC)$ == *gcc* ]] &&
+               [[ $(gcc-major-version)$(gcc-minor-version) -lt 43 ]]
+       then
+               eerror "It is a known issue that ${P} will not build with "
+               eerror "winbind use flag enabled when using gcc < 4.3 ."
+               eerror "Please use at least the latest stable gcc version."
+               die "Using sys-devel/gcc < 4.3 with winbind use flag."
+       fi
+}
+
+src_prepare() {
+       cp "${FILESDIR}/samba-3.4.2-lib.tevent.python.mk" "../lib/tevent/python.mk"
+
+       # ensure that winbind has correct ldflags (QA notice)
+       sed -i \
+               -e 's|LDSHFLAGS="|LDSHFLAGS="\\${LDFLAGS} |g' \
+               configure || die "sed failed"
+       cd "${WORKDIR}/${MY_P}" && epatch "${CONFDIR}"/smb.conf.default.patch
+}
+
+src_configure() {
+       local myconf
+
+       # Filter out -fPIE
+       [[ ${CHOST} == *-*bsd* ]] && myconf+=" --disable-pie"
+
+       # Upstream refuses to make this configurable
+       use caps && export ac_cv_header_sys_capability_h=yes || export ac_cv_header_sys_capability_h=no
+
+       # Notes:
+       # - automount is only needed in conjunction with NIS and we don't have that
+       # anymore => LDAP?
+       # - --without-dce-dfs and --without-nisplus-home can't be passed to configure but are disabled by default
+       econf ${myconf} \
+               --with-piddir=/var/run/samba \
+               --sysconfdir=/etc/samba \
+               --localstatedir=/var \
+               $(use_enable debug developer) \
+               --enable-largefile \
+               --enable-socket-wrapper \
+               --enable-nss-wrapper \
+               $(use_enable swat) \
+               $(use_enable debug dmalloc) \
+               $(use_enable cups) \
+               --disable-iprint \
+               $(use_enable fam) \
+               --enable-shared-libs \
+               --disable-dnssd \
+               $(use_enable avahi) \
+               --with-fhs \
+               --with-privatedir=/var/lib/samba/private \
+               --with-rootsbindir=/var/cache/samba \
+               --with-lockdir=/var/cache/samba \
+               --with-swatdir=/usr/share/doc/${PF}/swat \
+               --with-configdir=/etc/samba \
+               --with-logfilebase=/var/log/samba \
+               --with-pammodulesdir=$(getpam_mod_dir) \
+               --without-afs \
+               --without-fake-kaserver \
+               --without-vfs-afsacl \
+               $(use_with ldap) \
+               $(use_with ads) \
+               $(use_with ads krb5 /usr) \
+               $(use_with ads dnsupdate) \
+               --without-automount \
+               $(use_with pam) \
+               $(use_with pam pam_smbpass) \
+               $(use_with syslog) \
+               $(use_with quota quotas) \
+               $(use_with quota sys-quotas) \
+               --without-utmp \
+               --without-lib{talloc,tdb} \
+               $(use_with netapi libnetapi) \
+               $(use_with smbclient libsmbclient) \
+               $(use_with smbsharemodes libsmbsharemodes) \
+               $(use_with addns libaddns) \
+               $(use_with cluster ctdb /usr) \
+               $(use_with cluster cluster-support) \
+               $(use_with acl acl-support) \
+               $(use_with aio aio-support) \
+               --with-sendfile-support \
+               $(use_with winbind) \
+               --with-shared-modules=${SHAREDMODS} \
+               --without-included-popt \
+               --without-included-iniparser
+}
+
+src_compile() {
+       # compile libs
+       if use addns ; then
+               einfo "make addns library"
+               emake libaddns
+       fi
+       if use netapi ; then
+               einfo "make netapi library"
+               emake libnetapi
+       fi
+       if use smbclient ; then
+               einfo "make smbclient library"
+               emake libsmbclient
+       fi
+       if use smbsharemodes ; then
+               einfo "make smbsharemodes library"
+               emake libsmbsharemodes
+       fi
+
+       # compile modules
+       emake modules
+
+       # compile pam moudles
+       if use pam ; then
+               einfo "make pam modules"
+               emake pam_modules
+       fi
+
+       # compile winbind nss modules
+       if use winbind ; then
+               einfo "make nss modules"
+               emake nss_modules
+       fi
+
+       # compile utilities
+       if [ -n "${BINPROGS}" ] ; then
+               einfo "make binprogs"
+               emake ${BINPROGS}
+       fi
+       if [ -n "${SBINPROGS}" ] ; then
+               einfo "make sbinprogs"
+               emake ${SBINPROGS}
+       fi
+
+       if [ -n "${KRBPLUGIN}" ] ; then
+               einfo "make krbplugin"
+               emake ${KRBPLUGIN}${PLUGINEXT}
+       fi
+
+}
+
+src_install() {
+       # install libs
+       if use addns ; then
+               einfo "install addns library"
+               emake installlibaddns DESTDIR="${D}"
+       fi
+       if use netapi ; then
+               einfo "install netapi library"
+               emake installlibnetapi DESTDIR="${D}"
+       fi
+       if use smbclient ; then
+               einfo "install smbclient library"
+               emake installlibsmbclient DESTDIR="${D}"
+       fi
+       if use smbsharemodes ; then
+               einfo "install smbsharemodes library"
+               emake installlibsmbsharemodes DESTDIR="${D}"
+       fi
+
+       # install modules
+       emake installmodules DESTDIR="${D}"
+
+       if use pam ; then
+               einfo "install pam modules"
+               emake installpammodules DESTDIR="${D}"
+
+               if use winbind ; then
+                       newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind
+                       doman ../docs/manpages/pam_winbind.8
+               fi
+
+               newpamd "${CONFDIR}/samba.pam" samba
+               dodoc pam_smbpass/README
+       fi
+
+       # Nsswitch extensions. Make link for wins and winbind resolvers
+       if use winbind ; then
+               einfo "install libwbclient"
+               emake installlibwbclient DESTDIR="${D}"
+               dolib.so ../nsswitch/libnss_wins.so
+               dosym libnss_wins.so /usr/$(get_libdir)/libnss_wins.so.2
+               dolib.so ../nsswitch/libnss_winbind.so
+               dosym libnss_winbind.so /usr/$(get_libdir)/libnss_winbind.so.2
+               einfo "install libwbclient related manpages"
+               doman ../docs/manpages/idmap_rid.8
+               doman ../docs/manpages/idmap_hash.8
+               if use ldap ; then
+                       doman ../docs/manpages/idmap_adex.8
+                       doman ../docs/manpages/idmap_ldap.8
+               fi
+               if use ads ; then
+                       doman ../docs/manpages/idmap_ad.8
+               fi
+       fi
+
+       # install binaries
+       insinto /usr
+       for prog in ${SBINPROGS} ; do
+               dosbin ${prog}
+               doman ../docs/manpages/${prog/bin\/}*
+       done
+
+       for prog in ${BINPROGS} ; do
+               dobin ${prog}
+               doman ../docs/manpages/${prog/bin\/}*
+       done
+
+       # install krbplugin
+       if [ -n "${KRBPLUGIN}" ] ; then
+               if has_version app-crypt/mit-krb5 ; then
+                       insinto /usr/$(get_libdir)/krb5/plugins/libkrb5
+                       doins ${KRBPLUGIN}${PLUGINEXT}
+               elif has_version app-crypt/heimdal ; then
+                       insinto /usr/$(get_libdir)/plugin/krb5
+                       doins ${KRBPLUGIN}${PLUGINEXT}
+               fi
+               insinto /usr
+               for prog in ${KRBPLUGIN} ; do
+                       doman ../docs/manpages/${prog/bin\/}*
+               done
+       fi
+
+       # install server components
+       if use server ; then
+               doman ../docs/manpages/vfs* ../docs/manpages/samba.7
+
+               diropts -m0700
+               keepdir /var/lib/samba/private
+
+               diropts -m1777
+               keepdir /var/spool/samba
+
+               diropts -m0755
+               keepdir /var/{cache,log}/samba
+               keepdir /var/lib/samba/{netlogon,profiles}
+               keepdir /var/lib/samba/printers/{W32X86,WIN40,W32ALPHA,W32MIPS,W32PPC,X64,IA64,COLOR}
+               keepdir /usr/$(get_libdir)/samba/{auth,pdb,rpc,idmap,nss_info,gpext}
+
+               newconfd "${CONFDIR}/samba.confd" samba
+               newinitd "${CONFDIR}/samba.initd" samba
+
+               insinto /etc/samba
+               doins "${CONFDIR}"/{smbusers,lmhosts}
+
+               if use ldap ; then
+                       insinto /etc/openldap/schema
+                       doins ../examples/LDAP/samba.schema
+               fi
+
+               if use swat ; then
+                       insinto /etc/xinetd.d
+                       newins "${CONFDIR}/swat.xinetd" swat
+                       script/installswat.sh "${D}" "${ROOT}/usr/share/doc/${PF}/swat" "${S}"
+               fi
+
+               dodoc ../MAINTAINERS.txt ../README* ../Roadmap ../WHATSNEW.txt ../docs/THANKS
+       fi
+
+       # install the spooler to cups
+       if use cups ; then
+               dosym /usr/bin/smbspool $(cups-config --serverbin)/backend/smb
+       fi
+
+       # install misc files
+       insinto /etc/samba
+       doins ../examples/smb.conf.default
+       doman  ../docs/manpages/smb.conf.5
+
+       insinto /usr/"$(get_libdir)"/samba
+       doins ../codepages/{valid.dat,upcase.dat,lowcase.dat}
+
+       # install docs
+       if use doc ; then
+               dohtml -r ../docs/htmldocs/*
+               dodoc ../docs/*.pdf
+       fi
+
+       # install examples
+       if use examples ; then
+               insinto /usr/share/doc/${PF}/examples
+
+               if use smbclient ; then
+                       doins -r ../examples/libsmbclient
+               fi
+
+               if use winbind ; then
+                       doins -r ../examples/pam_winbind ../examples/nss
+               fi
+
+               if use server ; then
+                       cd ../examples
+                       doins -r auth autofs dce-dfs LDAP logon misc pdb \
+                       perfcounter printer-accounting printing scripts tridge \
+                       validchars VFS
+               fi
+       fi
+
+       # Remove empty installation directories
+       rmdir --ignore-fail-on-non-empty \
+               "${D}/usr/$(get_libdir)/samba" \
+               "${D}/usr"/{sbin,bin} \
+               "${D}/usr/share"/{man,locale,} \
+               "${D}/var"/{run,lib/samba/private,lib/samba,lib,cache/samba,cache,} \
+       #       || die "tried to remove non-empty dirs, this seems like a bug in the ebuild"
+}
+
+pkg_postinst() {
+       elog "The default value of 'wide links' has been changed to 'no' in samba 3.5"
+       elog "to avoid an insecure default configuration"
+       elog "('wide links = yes' and 'unix extensions = yes'). For more details,"
+       elog "please see http://www.samba.org/samba/news/symlink_attack.html ."
+       elog ""
+       elog "An EXPERIMENTAL implementation of the SMB2 protocol has been added."
+       elog "SMB2 can be enabled by setting 'max protocol = smb2'. SMB2 is a new "
+       elog "implementation of the SMB protocol used by Windows Vista and higher"
+       elog ""
+       elog "For further information make sure to read the release notes at"
+       elog "http://samba.org/samba/history/${P}.html and "
+       elog "http://samba.org/samba/history/${PN}-3.5.0.html"
+}