summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wendler <polynomial-c@gentoo.org>2017-09-20 21:52:23 +0200
committerLars Wendler <polynomial-c@gentoo.org>2017-09-20 22:17:09 +0200
commitec9ee6a2bfb22b695fc9da2e1e42a8e9595f6177 (patch)
tree7e447672d03b0a742cbf7d5a921b57a0f5421aff /net-fs/samba
parentnet-misc/crossbar: Version bumps, Add python_test() to 17.6.1_p3-r1 (diff)
downloadgentoo-ec9ee6a2bfb22b695fc9da2e1e42a8e9595f6177.tar.gz
gentoo-ec9ee6a2bfb22b695fc9da2e1e42a8e9595f6177.tar.bz2
gentoo-ec9ee6a2bfb22b695fc9da2e1e42a8e9595f6177.zip
net-fs/samba: Bump to version 4.5.14 and 4.6.8
Package-Manager: Portage-2.3.10, Repoman-2.3.3
Diffstat (limited to 'net-fs/samba')
-rw-r--r--net-fs/samba/Manifest2
-rw-r--r--net-fs/samba/samba-4.5.14.ebuild282
-rw-r--r--net-fs/samba/samba-4.6.8.ebuild304
3 files changed, 588 insertions, 0 deletions
diff --git a/net-fs/samba/Manifest b/net-fs/samba/Manifest
index 02f033fc4e5c..3f1581aab847 100644
--- a/net-fs/samba/Manifest
+++ b/net-fs/samba/Manifest
@@ -2,8 +2,10 @@ DIST samba-4.2.14.tar.gz 20883281 SHA256 db820a9947e44f04b0eb25e4aa0c3db32c4042f
DIST samba-4.5.10.tar.gz 20989431 SHA256 7cb753f5f6d5527ef40d4c1f47dacafb7c876cb304b4906ccb390c6a18477714 SHA512 046bae9c66083a4fe656d6a7b02b64343c66e0ea4925193a898dbda107b5b158d1897f16c36f4c393a30457a49215fa6ef91720367f4946760ec48ce02a4a68a WHIRLPOOL 2359a40337c2a85c17e3c860a8531c21ec5cf3c180dfd5a1e554f2eb5e10576a8b706464d490e008af441d9ce6a14043112d621d8e140461806c97947362933a
DIST samba-4.5.11-disable-python-patches.tar.xz 6292 SHA256 8db451910c3d46fc715203e0b674c49846528cf864c381520dc93de20a3637d3 SHA512 f0e3076e3e1ecaae3f06b3ef30efc81719fb3f63a1041dcbdae4b62ca4cf693732f9eb16f047d046d4930136fed82194e82b455ea888e12cf845b3e6a122d57d WHIRLPOOL 641d429fc4865e12e89bad28110b03ca87c6b658f59943f4d44c0b3a91fc49b5dc90e496a8a9d391c2897aec87fc43ea1c9a26084f3394b1883ad9755fd0eca3
DIST samba-4.5.13.tar.gz 21013879 SHA256 5fc4762d2259469bfb0067c10f77378cb720f2ebdaf2f37b5ca1918dbe84d04d SHA512 c495dffeee4dd83d710182713c8a0e6730f250fab2d03b62cc0f5354497fbc41d5140d7dea5c4089c026a7e9b820e48c94806bbc44b6594c9e5bad977793eb4a WHIRLPOOL 9e720801f44ac7fab65c748dd24c52763b8568d1af73b64006d847c53604df0a7f3d4febeac2dd467c2fd1c3940b86253c37f99e2e2f39028d43acc4f99668ee
+DIST samba-4.5.14.tar.gz 21016317 SHA256 15dc04fd2b19081daf1118318f43f88ef7260b3fc6e4f86ee7c7913bb7c92ed9 SHA512 35b6ec38b6750ebdd387eade3c7a1f61c83a4d6642c9a2a8a811d84b506c9f20ed69fa1db9065852ce792fd769fe151177200cdd55de308017cd5416f80eb095 WHIRLPOOL b374abd1439072ab16d84f12b4876f4c44c8d34b734e3c4a0b909e685bb3eb1f02f5b58d9c8173909f2154e97d3e60743646252818a527358ba7316f5a348140
DIST samba-4.6.7-disable-python-patches.tar.xz 8896 SHA256 33702adba80e9886625fda8cba46d4017ae603f5d9cf9d3dc78e5ef30ff6f5eb SHA512 c45e548a49735e17b568bebf07dc7409de3de0f93256d1dcf345d2723a27d22a51d860ed921785354fda691f83be4eca3b9d618d5c332438ebf97518a01983eb WHIRLPOOL 1cb176480b8583369e1085c8e122958112c0d13aa8ba78cd57dfd04b17c7d8f0a0664a43d277deba86775f1944eab052f4fb9459f64506215ae25184c86cbe40
DIST samba-4.6.7.tar.gz 21137329 SHA256 9ef24393de08390f236cabccd6a420b5cea304e959cbf1a99ff317325db3ddfa SHA512 394c28204bae4134e6a9d2e5b8f087a425dc4ac4ceecd8b29315acff1a92349d40ef0b6a9cc34f5ad18ff5ec9979199837c87f687858cb4e6687968284303aa5 WHIRLPOOL 14282c4a88a22f932099ef47dc50f57c5fef87d6909d529d3eb837b6e958f490a5fd64ce1a5dfdd36eab5ac82b41583736953be2be279f70f0491c61fd1d0d92
+DIST samba-4.6.8.tar.gz 21139872 SHA256 581deeb2543f5cedcb556cb950d0e82690d9f0cd33811d76624502ca0c32575d SHA512 fb40144210361bdeab09007aa49fa85077fbc8eeae2c49bcdafb01d33ec40425160882979f0829005a89766ed4fd4e36d7f952f6dbf6e0178f5b0945dc8d8efb WHIRLPOOL d669df156dcae5846d814eb30f577b9df0513383be91a87886b91dff12451d82c236dd7c1fd996a378d90619aabee5adc33ecd488534b612b8f82b7b88d0840a
DIST samba-4.7.0rc6.tar.gz 16830281 SHA256 b03d3bffc2cb43d08bc1e8622db6a1b4e2533fa3e347ffcf00c38be6108cb439 SHA512 6e0b89434237c0db9d0c6d6c08b282a94f1dfbc90a931076c63034c2ef4d90edadfe528ca124450814de47225d2fa14f61fba9a160a581f48029c1f9fa64cc13 WHIRLPOOL 69b7d5a8cb735c70ce7c85d5c1754c7875c7477179b2b2b5ded1fc976e128ec4dad9211a0ab51e1bb26bb524f4c23c648349e3284ddce5453f80da8e5c3e6b90
DIST samba-disable-python-patches-4.2.12.tar.xz 6052 SHA256 8903eacbabdfaf7b64cbde03d7c367d1efdc92e54090f0f4b9ed5d2a462b1c18 SHA512 c527d0a052d3211e5b12c17bc94db56cc5e5545189ed65a760c0656c94c22e27a4b159e6439eb0370873e1619873a741f3b3bd10d3876b38eb3914a87eace372 WHIRLPOOL ad63db55d5dc96f56e6c9b30c2092e2f6e206b0ed5d13c249879d10753c8db2f475c5d4e651e2fc042ad992b648d3b4465f1b28c6b4bbf821cf503d27f741f7e
DIST samba-disable-python-patches-4.5.0_rc1.tar.xz 6204 SHA256 fa0d776e04e3222c0dc4761e376717f4154937cdcb85f4117b8978dfb770a78e SHA512 920089ba3c6e8e7d913b1d7ef1017262a19d1af41215adb30cfc98a57556efc4b0116931d4ef774c01124149d8eca2be3a23814ce7e11daf0180d2c111799927 WHIRLPOOL 6d55710895435ad012e23f8c252e5276966241014710349ca7fa9cf037e8742030b8e053f7cb71309a0a45f48d2235d55393243bf4d19476a22dd39bb1b7748d
diff --git a/net-fs/samba/samba-4.5.14.ebuild b/net-fs/samba/samba-4.5.14.ebuild
new file mode 100644
index 000000000000..cbf7ec7d4fc5
--- /dev/null
+++ b/net-fs/samba/samba-4.5.14.ebuild
@@ -0,0 +1,282 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='threads(+),xml(+)'
+
+inherit python-single-r1 waf-utils multilib-minimal linux-info systemd eutils
+
+MY_PV="${PV/_rc/rc}"
+MY_P="${PN}-${MY_PV}"
+
+SRC_PATH="stable"
+[[ ${PV} = *_rc* ]] && SRC_PATH="rc"
+
+SRC_URI="mirror://samba/${SRC_PATH}/${MY_P}.tar.gz
+ https://dev.gentoo.org/~polynomial-c/samba-4.5.11-disable-python-patches.tar.xz"
+[[ ${PV} = *_rc* ]] || \
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+
+DESCRIPTION="Samba Suite Version 4"
+HOMEPAGE="http://www.samba.org/"
+LICENSE="GPL-3"
+
+SLOT="0"
+
+IUSE="acl addc addns ads client cluster cups dmapi fam gnutls gpg iprint ldap pam
+quota selinux syslog system-heimdal +system-mitkrb5 systemd test winbind zeroconf"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/samba-4.0/policy.h
+ /usr/include/samba-4.0/dcerpc_server.h
+ /usr/include/samba-4.0/ctdb.h
+ /usr/include/samba-4.0/ctdb_client.h
+ /usr/include/samba-4.0/ctdb_protocol.h
+ /usr/include/samba-4.0/ctdb_private.h
+ /usr/include/samba-4.0/ctdb_typesafe_cb.h
+ /usr/include/samba-4.0/ctdb_version.h
+)
+
+# sys-apps/attr is an automagic dependency (see bug #489748)
+CDEPEND="${PYTHON_DEPS}
+ >=app-arch/libarchive-3.1.2[${MULTILIB_USEDEP}]
+ dev-lang/perl:=
+ dev-libs/libaio[${MULTILIB_USEDEP}]
+ dev-libs/libbsd[${MULTILIB_USEDEP}]
+ dev-libs/iniparser:0
+ dev-libs/popt[${MULTILIB_USEDEP}]
+ dev-python/subunit[${PYTHON_USEDEP},${MULTILIB_USEDEP}]
+ sys-apps/attr[${MULTILIB_USEDEP}]
+ >=sys-libs/ldb-1.1.27[ldap(+)?,python(+),${MULTILIB_USEDEP}]
+ <sys-libs/ldb-1.1.30[ldap(+)?,python(+),${MULTILIB_USEDEP}]
+ sys-libs/libcap
+ sys-libs/ncurses:0=[${MULTILIB_USEDEP}]
+ sys-libs/readline:0=
+ >=sys-libs/talloc-2.1.8[python,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
+ >=sys-libs/tdb-1.3.10[python,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
+ >=sys-libs/tevent-0.9.31-r1[${MULTILIB_USEDEP}]
+ sys-libs/zlib[${MULTILIB_USEDEP}]
+ virtual/libiconv
+ pam? ( virtual/pam )
+ acl? ( virtual/acl )
+ addns? ( net-dns/bind-tools[gssapi] )
+ cluster? ( !dev-db/ctdb )
+ cups? ( net-print/cups )
+ dmapi? ( sys-apps/dmapi )
+ fam? ( virtual/fam )
+ gnutls? (
+ dev-libs/libgcrypt:0
+ >=net-libs/gnutls-1.4.0
+ )
+ gpg? ( app-crypt/gpgme )
+ ldap? ( net-nds/openldap[${MULTILIB_USEDEP}] )
+ system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl,${MULTILIB_USEDEP}] )
+ system-mitkrb5? ( app-crypt/mit-krb5[${MULTILIB_USEDEP}] )
+ systemd? ( sys-apps/systemd:0= )"
+DEPEND="${CDEPEND}
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ virtual/pkgconfig
+ test? (
+ !system-mitkrb5? (
+ >=sys-libs/nss_wrapper-1.1.3
+ >=net-dns/resolv_wrapper-1.1.4
+ >=net-libs/socket_wrapper-1.1.7
+ >=sys-libs/uid_wrapper-1.2.1
+ )
+ )"
+RDEPEND="${CDEPEND}
+ client? ( net-fs/cifs-utils[ads?] )
+ selinux? ( sec-policy/selinux-samba )
+ !dev-perl/Parse-Yapp
+"
+
+REQUIRED_USE="addc? ( gnutls !system-mitkrb5 )
+ ads? ( acl gnutls ldap )
+ gpg? ( addc )
+ ?? ( system-heimdal system-mitkrb5 )
+ ${PYTHON_REQUIRED_USE}"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-4.4.0-pam.patch"
+ "${FILESDIR}/${PN}-4.5.1-compile_et_fix.patch"
+)
+
+#CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+CONFDIR="${FILESDIR}/4.4"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+SHAREDMODS=""
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ if use cluster ; then
+ SHAREDMODS="idmap_rid,idmap_tdb2,idmap_ad"
+ elif use ads ; then
+ SHAREDMODS="idmap_ad"
+ fi
+}
+
+src_prepare() {
+ default
+
+ # install the patches from tarball(s)
+ eapply "${WORKDIR}/patches"
+
+ # ugly hackaround for bug #592502
+ cp /usr/include/tevent_internal.h "${S}"/lib/tevent/ || die
+
+ sed -e 's:<gpgme\.h>:<gpgme/gpgme.h>:' \
+ -i source4/dsdb/samdb/ldb_modules/password_hash.c \
+ || die
+
+ # Friggin' WAF shit
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ # when specifying libs for samba build you must append NONE to the end to
+ # stop it automatically including things
+ local bundled_libs="NONE"
+ if ! use system-heimdal && ! use system-mitkrb5 ; then
+ bundled_libs="heimbase,heimntlm,hdb,kdc,krb5,wind,gssapi,hcrypto,hx509,roken,asn1,com_err,NONE"
+ fi
+
+ local myconf=()
+ myconf=(
+ --enable-fhs
+ --sysconfdir="${EPREFIX}/etc"
+ --localstatedir="${EPREFIX}/var"
+ --with-modulesdir="${EPREFIX}/usr/$(get_libdir)/samba"
+ --with-piddir="${EPREFIX}/run/${PN}"
+ --without-lttng
+ --bundled-libraries="${bundled_libs}"
+ --builtin-libraries=NONE
+ --disable-rpath
+ --disable-rpath-install
+ --nopyc
+ --nopyo
+ )
+ if multilib_is_native_abi ; then
+ myconf+=(
+ $(use_with acl acl-support)
+ $(usex addc '' '--without-ad-dc')
+ $(use_with addns dnsupdate)
+ $(use_with ads)
+ $(use_with cluster cluster-support)
+ $(use_enable cups)
+ $(use_with dmapi)
+ $(use_with fam)
+ $(use_enable gnutls)
+ $(use_with gpg gpgme)
+ $(use_enable iprint)
+ $(use_with ldap)
+ $(use_with pam)
+ $(usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '')
+ $(use_with quota quotas)
+ $(use_with syslog)
+ $(use_with systemd)
+ $(usex system-mitkrb5 '--with-system-mitkrb5' '')
+ $(use_with winbind)
+ $(usex test '--enable-selftest' '')
+ $(use_enable zeroconf avahi)
+ --with-shared-modules=${SHAREDMODS}
+ )
+ else
+ myconf+=(
+ --without-acl-support
+ --without-ad-dc
+ --without-dnsupdate
+ --without-ads
+ --disable-avahi
+ --without-cluster-support
+ --disable-cups
+ --without-dmapi
+ --without-fam
+ --disable-gnutls
+ --without-gpgme
+ --disable-iprint
+ $(use_with ldap)
+ --without-pam
+ --without-quotas
+ --without-syslog
+ --without-systemd
+ $(usex system-mitkrb5 '--with-system-mitkrb5' '')
+ --without-winbind
+ --disable-python
+ )
+ fi
+
+ CPPFLAGS="-I${SYSROOT}${EPREFIX}/usr/include/et ${CPPFLAGS}" \
+ waf-utils_src_configure ${myconf[@]}
+}
+
+multilib_src_compile() {
+ waf-utils_src_compile
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+
+ # Make all .so files executable
+ find "${D}" -type f -name "*.so" -exec chmod +x {} +
+
+ if multilib_is_native_abi; then
+ # install ldap schema for server (bug #491002)
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins examples/LDAP/samba.schema
+ fi
+
+ # create symlink for cups (bug #552310)
+ if use cups ; then
+ dosym /usr/bin/smbspool /usr/libexec/cups/backend/smb
+ fi
+
+ # install example config file
+ insinto /etc/samba
+ doins examples/smb.conf.default
+
+ # Fix paths in example file (#603964)
+ sed \
+ -e '/log file =/s@/usr/local/samba/var/@/var/log/samba/@' \
+ -e '/include =/s@/usr/local/samba/lib/@/etc/samba/@' \
+ -e '/path =/s@/usr/local/samba/lib/@/var/lib/samba/@' \
+ -e '/path =/s@/usr/local/samba/@/var/lib/samba/@' \
+ -e '/path =/s@/usr/spool/samba@/var/spool/samba@' \
+ -i "${ED%/}"/etc/samba/smb.conf.default || die
+
+ # Install init script and conf.d file
+ newinitd "${CONFDIR}/samba4.initd-r1" samba
+ newconfd "${CONFDIR}/samba4.confd" samba
+
+ systemd_dotmpfilesd "${FILESDIR}"/samba.conf
+ systemd_dounit "${FILESDIR}"/nmbd.service
+ systemd_dounit "${FILESDIR}"/smbd.{service,socket}
+ systemd_newunit "${FILESDIR}"/smbd_at.service 'smbd@.service'
+ systemd_dounit "${FILESDIR}"/winbindd.service
+ systemd_dounit "${FILESDIR}"/samba.service
+ fi
+}
+
+multilib_src_test() {
+ if multilib_is_native_abi ; then
+ "${WAF_BINARY}" test || die "test failed"
+ fi
+}
+
+pkg_postinst() {
+ ewarn "Be aware the this release contains the best of all of Samba's"
+ ewarn "technology parts, both a file server (that you can reasonably expect"
+ ewarn "to upgrade existing Samba 3.x releases to) and the AD domain"
+ ewarn "controller work previously known as 'samba4'."
+
+ elog "For further information and migration steps make sure to read "
+ elog "http://samba.org/samba/history/${P}.html "
+ elog "http://samba.org/samba/history/${PN}-4.5.0.html and"
+ elog "http://wiki.samba.org/index.php/Samba4/HOWTO "
+}
diff --git a/net-fs/samba/samba-4.6.8.ebuild b/net-fs/samba/samba-4.6.8.ebuild
new file mode 100644
index 000000000000..de64a28ba3f1
--- /dev/null
+++ b/net-fs/samba/samba-4.6.8.ebuild
@@ -0,0 +1,304 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='threads(+),xml(+)'
+
+inherit python-single-r1 waf-utils multilib-minimal linux-info systemd eutils
+
+MY_PV="${PV/_rc/rc}"
+MY_P="${PN}-${MY_PV}"
+
+SRC_PATH="stable"
+[[ ${PV} = *_rc* ]] && SRC_PATH="rc"
+
+SRC_URI="mirror://samba/${SRC_PATH}/${MY_P}.tar.gz
+ https://dev.gentoo.org/~axs/samba-4.6.7-disable-python-patches.tar.xz"
+[[ ${PV} = *_rc* ]] || \
+KEYWORDS="~amd64 ~arm64 ~x86"
+
+DESCRIPTION="Samba Suite Version 4"
+HOMEPAGE="http://www.samba.org/"
+LICENSE="GPL-3"
+
+SLOT="0"
+
+IUSE="acl addc addns ads client cluster cups debug dmapi fam gnutls gpg iprint ldap pam python
+quota selinux syslog system-heimdal +system-mitkrb5 systemd test winbind zeroconf"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/samba-4.0/policy.h
+ /usr/include/samba-4.0/dcerpc_server.h
+ /usr/include/samba-4.0/ctdb.h
+ /usr/include/samba-4.0/ctdb_client.h
+ /usr/include/samba-4.0/ctdb_protocol.h
+ /usr/include/samba-4.0/ctdb_private.h
+ /usr/include/samba-4.0/ctdb_typesafe_cb.h
+ /usr/include/samba-4.0/ctdb_version.h
+)
+
+# sys-apps/attr is an automagic dependency (see bug #489748)
+CDEPEND="
+ >=app-arch/libarchive-3.1.2[${MULTILIB_USEDEP}]
+ dev-lang/perl:=
+ dev-libs/libaio[${MULTILIB_USEDEP}]
+ dev-libs/libbsd[${MULTILIB_USEDEP}]
+ dev-libs/iniparser:0
+ dev-libs/popt[${MULTILIB_USEDEP}]
+ dev-python/subunit[${PYTHON_USEDEP},${MULTILIB_USEDEP}]
+ >=dev-util/cmocka-1.0.0[${MULTILIB_USEDEP}]
+ sys-apps/attr[${MULTILIB_USEDEP}]
+ >=sys-libs/ldb-1.1.29[ldap(+)?,python(+),${PYTHON_USEDEP},${MULTILIB_USEDEP}]
+ sys-libs/libcap
+ sys-libs/ncurses:0=[${MULTILIB_USEDEP}]
+ sys-libs/readline:0=
+ >=sys-libs/talloc-2.1.9[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
+ >=sys-libs/tdb-1.3.12[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
+ >=sys-libs/tevent-0.9.31-r1[python?,${PYTHON_USEDEP},${MULTILIB_USEDEP}]
+ sys-libs/zlib[${MULTILIB_USEDEP}]
+ virtual/libiconv
+ pam? ( virtual/pam )
+ acl? ( virtual/acl )
+ addns? (
+ net-dns/bind-tools[gssapi]
+ dev-python/dnspython:=[${PYTHON_USEDEP}]
+ )
+ cluster? ( !dev-db/ctdb )
+ cups? ( net-print/cups )
+ debug? ( dev-util/lttng-ust )
+ dmapi? ( sys-apps/dmapi )
+ fam? ( virtual/fam )
+ gnutls? (
+ dev-libs/libgcrypt:0
+ >=net-libs/gnutls-1.4.0
+ )
+ gpg? ( app-crypt/gpgme )
+ ldap? ( net-nds/openldap[${MULTILIB_USEDEP}] )
+ system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl,${MULTILIB_USEDEP}] )
+ system-mitkrb5? ( app-crypt/mit-krb5[${MULTILIB_USEDEP}] )
+ systemd? ( sys-apps/systemd:0= )"
+DEPEND="${CDEPEND}
+ ${PYTHON_DEPS}
+ app-text/docbook-xsl-stylesheets
+ dev-libs/libxslt
+ virtual/pkgconfig
+ test? (
+ !system-mitkrb5? (
+ >=sys-libs/nss_wrapper-1.1.3
+ >=net-dns/resolv_wrapper-1.1.4
+ >=net-libs/socket_wrapper-1.1.7
+ >=sys-libs/uid_wrapper-1.2.1
+ )
+ )"
+RDEPEND="${CDEPEND}
+ python? ( ${PYTHON_DEPS} )
+ client? ( net-fs/cifs-utils[ads?] )
+ selinux? ( sec-policy/selinux-samba )
+ !dev-perl/Parse-Yapp
+"
+
+REQUIRED_USE="addc? ( python gnutls !system-mitkrb5 )
+ test? ( python )
+ addns? ( python )
+ ads? ( acl gnutls ldap )
+ gpg? ( addc )
+ ?? ( system-heimdal system-mitkrb5 )
+ ${PYTHON_REQUIRED_USE}"
+
+# the test suite is messed, it uses system-installed samba
+# bits instead of what was built, tests things disabled via use
+# flags, and generally just fails to work in a way ebuilds could
+# rely on in its current state
+RESTRICT="test"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-4.4.0-pam.patch"
+ "${FILESDIR}/${PN}-4.5.1-compile_et_fix.patch"
+)
+
+#CONFDIR="${FILESDIR}/$(get_version_component_range 1-2)"
+CONFDIR="${FILESDIR}/4.4"
+
+WAF_BINARY="${S}/buildtools/bin/waf"
+
+SHAREDMODS=""
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+ if use cluster ; then
+ SHAREDMODS="idmap_rid,idmap_tdb2,idmap_ad"
+ elif use ads ; then
+ SHAREDMODS="idmap_ad"
+ fi
+}
+
+src_prepare() {
+ default
+
+ # install the patches from tarball(s)
+ eapply "${WORKDIR}/patches"
+
+ # un-bundle dnspython
+ sed -i -e '/"dns.resolver":/d' "${S}"/third_party/wscript || die
+
+ # unbundle iso8601 unless tests are enabled
+ use test || sed -i -e '/"iso8601":/d' "${S}"/third_party/wscript || die
+
+ # ugly hackaround for bug #592502
+ cp /usr/include/tevent_internal.h "${S}"/lib/tevent/ || die
+
+ sed -e 's:<gpgme\.h>:<gpgme/gpgme.h>:' \
+ -i source4/dsdb/samdb/ldb_modules/password_hash.c \
+ || die
+
+ # Friggin' WAF shit
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ # when specifying libs for samba build you must append NONE to the end to
+ # stop it automatically including things
+ local bundled_libs="NONE"
+ if ! use system-heimdal && ! use system-mitkrb5 ; then
+ bundled_libs="heimbase,heimntlm,hdb,kdc,krb5,wind,gssapi,hcrypto,hx509,roken,asn1,com_err,NONE"
+ fi
+
+ local myconf=()
+ myconf=(
+ --enable-fhs
+ --sysconfdir="${EPREFIX}/etc"
+ --localstatedir="${EPREFIX}/var"
+ --with-modulesdir="${EPREFIX}/usr/$(get_libdir)/samba"
+ --with-piddir="${EPREFIX}/run/${PN}"
+ --bundled-libraries="${bundled_libs}"
+ --builtin-libraries=NONE
+ --disable-rpath
+ --disable-rpath-install
+ --nopyc
+ --nopyo
+ )
+ if multilib_is_native_abi ; then
+ myconf+=(
+ $(use_with acl acl-support)
+ $(usex addc '' '--without-ad-dc')
+ $(use_with addns dnsupdate)
+ $(use_with ads)
+ $(use_with cluster cluster-support)
+ $(use_enable cups)
+ $(use_with debug lttng)
+ $(use_with dmapi)
+ $(use_with fam)
+ $(use_enable gnutls)
+ $(use_with gpg gpgme)
+ $(use_enable iprint)
+ $(use_with ldap)
+ $(use_with pam)
+ $(usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '')
+ $(use_with quota quotas)
+ $(use_with syslog)
+ $(use_with systemd)
+ $(usex system-mitkrb5 '--with-system-mitkrb5' '')
+ $(use_with winbind)
+ $(usex python '' '--disable-python')
+ $(usex test '--enable-selftest' '')
+ $(use_enable zeroconf avahi)
+ --with-shared-modules=${SHAREDMODS}
+ )
+ else
+ myconf+=(
+ --without-acl-support
+ --without-ad-dc
+ --without-dnsupdate
+ --without-ads
+ --disable-avahi
+ --without-cluster-support
+ --disable-cups
+ --without-dmapi
+ --without-fam
+ --disable-gnutls
+ --without-gpgme
+ --disable-iprint
+ $(use_with ldap)
+ $(use_with debug lttng)
+ --without-pam
+ --without-quotas
+ --without-syslog
+ --without-systemd
+ $(usex system-mitkrb5 '--with-system-mitkrb5' '')
+ --without-winbind
+ --disable-python
+ )
+ fi
+
+ CPPFLAGS="-I${SYSROOT}${EPREFIX}/usr/include/et ${CPPFLAGS}" \
+ waf-utils_src_configure ${myconf[@]}
+}
+
+multilib_src_compile() {
+ waf-utils_src_compile
+}
+
+multilib_src_install() {
+ waf-utils_src_install
+
+ # Make all .so files executable
+ find "${D}" -type f -name "*.so" -exec chmod +x {} +
+
+ if multilib_is_native_abi; then
+ # install ldap schema for server (bug #491002)
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins examples/LDAP/samba.schema
+ fi
+
+ # create symlink for cups (bug #552310)
+ if use cups ; then
+ dosym /usr/bin/smbspool /usr/libexec/cups/backend/smb
+ fi
+
+ # install example config file
+ insinto /etc/samba
+ doins examples/smb.conf.default
+
+ # Fix paths in example file (#603964)
+ sed \
+ -e '/log file =/s@/usr/local/samba/var/@/var/log/samba/@' \
+ -e '/include =/s@/usr/local/samba/lib/@/etc/samba/@' \
+ -e '/path =/s@/usr/local/samba/lib/@/var/lib/samba/@' \
+ -e '/path =/s@/usr/local/samba/@/var/lib/samba/@' \
+ -e '/path =/s@/usr/spool/samba@/var/spool/samba@' \
+ -i "${ED%/}"/etc/samba/smb.conf.default || die
+
+ # Install init script and conf.d file
+ newinitd "${CONFDIR}/samba4.initd-r1" samba
+ newconfd "${CONFDIR}/samba4.confd" samba
+
+ systemd_dotmpfilesd "${FILESDIR}"/samba.conf
+ systemd_dounit "${FILESDIR}"/nmbd.service
+ systemd_dounit "${FILESDIR}"/smbd.{service,socket}
+ systemd_newunit "${FILESDIR}"/smbd_at.service 'smbd@.service'
+ systemd_dounit "${FILESDIR}"/winbindd.service
+ systemd_dounit "${FILESDIR}"/samba.service
+ fi
+}
+
+multilib_src_test() {
+ if multilib_is_native_abi ; then
+ "${WAF_BINARY}" test || die "test failed"
+ fi
+}
+
+pkg_postinst() {
+ ewarn "Be aware the this release contains the best of all of Samba's"
+ ewarn "technology parts, both a file server (that you can reasonably expect"
+ ewarn "to upgrade existing Samba 3.x releases to) and the AD domain"
+ ewarn "controller work previously known as 'samba4'."
+
+ elog "For further information and migration steps make sure to read "
+ elog "http://samba.org/samba/history/${P}.html "
+ elog "http://samba.org/samba/history/${PN}-4.5.0.html and"
+ elog "http://wiki.samba.org/index.php/Samba4/HOWTO "
+}