From 6c8076e2722d6a401e51e7cd9e05f1d57f8191f3 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Wed, 15 Dec 2021 19:43:24 +0100 Subject: [PATCH] net-fs/samba: Apply Flatcar modifications - Add a minimal USE flag for only installing libraries - Change the Perl and Python run-time deps to build-time only - Drop a bunch of dependencies with broken cross-compilation - Enable using bundled libraries in their place - Disable building libraries requiring Python - Use EAPI7 - Move libsxlt and stylesheets to BDEPEND - Introduce some USE flags, so we don't install some tools we don't need - Limit the size of bundled libraries - Make it compatible with newer python versions - Bump to r2 because of updating EAPI to 7 --- .../coreos-overlay/net-fs/samba/metadata.xml | 4 + ....12.9-r1.ebuild => samba-4.12.9-r2.ebuild} | 80 ++++++++++++------- 2 files changed, 55 insertions(+), 29 deletions(-) rename sdk_container/src/third_party/coreos-overlay/net-fs/samba/{samba-4.12.9-r1.ebuild => samba-4.12.9-r2.ebuild} (85%) diff --git a/sdk_container/src/third_party/coreos-overlay/net-fs/samba/metadata.xml b/sdk_container/src/third_party/coreos-overlay/net-fs/samba/metadata.xml index d1bb8bfdd5..e871aa5724 100644 --- a/sdk_container/src/third_party/coreos-overlay/net-fs/samba/metadata.xml +++ b/sdk_container/src/third_party/coreos-overlay/net-fs/samba/metadata.xml @@ -16,12 +16,16 @@ Enables the client part Enable support for clustering Enable support for DMAPI. This currently works only in combination with XFS. + Enable support for Glusterfs filesystem via sys-cluster/glusterfs Use app-crypt/gpgme for AD DC Enable json audit support through dev-libs/jansson Enabling iPrint technology by Novell + Enable support for NTVFS fileserver Enables support for collecting profiling data Enables support for user quotas + Enable support for regedit command-line tool Enable vfs_snapper module (requires sys-apps/dbus) + Enable support for spotlight backend Use app-crypt/heimdal instead of bundled heimdal. Use app-crypt/mit-krb5 instead of diff --git a/sdk_container/src/third_party/coreos-overlay/net-fs/samba/samba-4.12.9-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/net-fs/samba/samba-4.12.9-r2.ebuild similarity index 85% rename from sdk_container/src/third_party/coreos-overlay/net-fs/samba/samba-4.12.9-r1.ebuild rename to sdk_container/src/third_party/coreos-overlay/net-fs/samba/samba-4.12.9-r2.ebuild index d719891701..7b1b079397 100644 --- a/sdk_container/src/third_party/coreos-overlay/net-fs/samba/samba-4.12.9-r1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/net-fs/samba/samba-4.12.9-r2.ebuild @@ -1,11 +1,12 @@ # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=6 +EAPI=7 -PYTHON_COMPAT=( python3_{6,7,8} ) +PYTHON_COMPAT=( python3_{6..10} ) PYTHON_REQ_USE='threads(+),xml(+)' -inherit python-single-r1 waf-utils multilib-minimal linux-info systemd pam +TMPFILES_OPTIONAL=1 +inherit python-single-r1 waf-utils multilib-minimal linux-info systemd pam tmpfiles MY_PV="${PV/_rc/rc}" MY_P="${PN}-${MY_PV}" @@ -23,9 +24,11 @@ LICENSE="GPL-3" SLOT="0" -IUSE="acl addc addns ads ceph client cluster cups debug dmapi fam gpg iprint -json ldap pam profiling-data python quota selinux snapper syslog -system-heimdal +system-mitkrb5 systemd test winbind zeroconf" +IUSE="acl addc addns ads ceph client cluster cups debug dmapi fam glusterfs +gpg iprint json ldap ntvfs pam profiling-data python quota +regedit selinux +snapper spotlight syslog system-heimdal +system-mitkrb5 systemd test winbind +zeroconf" +IUSE+=" +minimal" # Flatcar: Only install libraries, not executables. MULTILIB_WRAPPED_HEADERS=( /usr/include/samba-4.0/policy.h @@ -40,35 +43,24 @@ MULTILIB_WRAPPED_HEADERS=( CDEPEND=" >=app-arch/libarchive-3.1.2[${MULTILIB_USEDEP}] - dev-lang/perl:= - dev-libs/icu:=[${MULTILIB_USEDEP}] + spotlight? ( dev-libs/icu:=[${MULTILIB_USEDEP}] ) dev-libs/libbsd[${MULTILIB_USEDEP}] - dev-libs/libtasn1[${MULTILIB_USEDEP}] + !minimal? ( dev-libs/libtasn1[${MULTILIB_USEDEP}] ) dev-libs/popt[${MULTILIB_USEDEP}] - dev-perl/Parse-Yapp >=net-libs/gnutls-3.4.7[${MULTILIB_USEDEP}] - net-libs/libnsl:=[${MULTILIB_USEDEP}] sys-libs/e2fsprogs-libs[${MULTILIB_USEDEP}] - >=sys-libs/ldb-2.1.4[ldap(+)?,python?,${PYTHON_SINGLE_USEDEP},${MULTILIB_USEDEP}] - =sys-libs/talloc-2.3.1[python?,${PYTHON_SINGLE_USEDEP},${MULTILIB_USEDEP}] - >=sys-libs/tdb-1.4.3[python?,${PYTHON_SINGLE_USEDEP},${MULTILIB_USEDEP}] - >=sys-libs/tevent-0.10.2[python?,${PYTHON_SINGLE_USEDEP},${MULTILIB_USEDEP}] sys-libs/zlib[${MULTILIB_USEDEP}] virtual/libiconv pam? ( sys-libs/pam ) acl? ( virtual/acl ) - $(python_gen_cond_dep " - dev-python/subunit[\${PYTHON_MULTI_USEDEP},${MULTILIB_USEDEP}] - addns? ( - net-dns/bind-tools[gssapi] - dev-python/dnspython:=[\${PYTHON_MULTI_USEDEP}] - ) - ") + addns? ( + net-dns/bind-tools[gssapi] + dev-python/dnspython + ) ceph? ( sys-cluster/ceph ) cluster? ( net-libs/rpcsvc-proto @@ -89,8 +81,7 @@ CDEPEND=" " DEPEND="${CDEPEND} ${PYTHON_DEPS} - app-text/docbook-xsl-stylesheets - dev-libs/libxslt + dev-lang/perl:= >=dev-util/cmocka-1.1.3[${MULTILIB_USEDEP}] net-libs/libtirpc[${MULTILIB_USEDEP}] virtual/pkgconfig @@ -98,6 +89,10 @@ DEPEND="${CDEPEND} net-libs/rpcsvc-proto =sys-libs/nss_wrapper-1.1.3 @@ -112,12 +107,19 @@ RDEPEND="${CDEPEND} selinux? ( sec-policy/selinux-samba ) " +BDEPEND=" + app-text/docbook-xsl-stylesheets + dev-libs/libxslt +" + REQUIRED_USE=" addc? ( python json winbind ) addns? ( python ) ads? ( acl ldap winbind ) cluster? ( ads ) gpg? ( addc ) + ntvfs? ( addc ) + spotlight? ( json ) test? ( python ) ?? ( system-heimdal system-mitkrb5 ) ${PYTHON_REQUIRED_USE} @@ -168,9 +170,6 @@ src_prepare() { sed -i -e '/"iso8601":/d' "${S}"/third_party/wscript || die fi - ## ugly hackaround for bug #592502 - #cp /usr/include/tevent_internal.h "${S}"/lib/tevent/ || die - sed -e 's:::' \ -i source4/dsdb/samdb/ldb_modules/password_hash.c \ || die @@ -187,6 +186,10 @@ multilib_src_configure() { bundled_libs="heimbase,heimntlm,hdb,kdc,krb5,wind,gssapi,hcrypto,hx509,roken,asn1,com_err,NONE" fi + # Flatcar: we need only the mandatory bundled library, ldb by default. + # Without that, configure will fail because of a missing bundled library. + bundled_libs="ldb" + local myconf=( --enable-fhs --sysconfdir="${EPREFIX}/etc" @@ -200,6 +203,7 @@ multilib_src_configure() { --nopyc --nopyo --without-winexe + --disable-python $(multilib_native_use_with acl acl-support) $(multilib_native_usex addc '' '--without-ad-dc') $(multilib_native_use_with addns dnsupdate) @@ -209,13 +213,17 @@ multilib_src_configure() { $(multilib_native_use_enable cups) $(multilib_native_use_with dmapi) $(multilib_native_use_with fam) + $(multilib_native_use_enable glusterfs) $(multilib_native_use_with gpg gpgme) $(multilib_native_use_with json) $(multilib_native_use_enable iprint) + $(multilib_native_use_with ntvfs ntvfs-fileserver) $(multilib_native_use_with pam) $(multilib_native_usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '') $(multilib_native_use_with quota quotas) + $(multilib_native_use_with regedit regedit) $(multilib_native_use_enable snapper) + $(multilib_native_use_enable spotlight) $(multilib_native_use_with syslog) $(multilib_native_use_with systemd) --systemd-install-services @@ -277,7 +285,7 @@ multilib_src_install() { newinitd "${CONFDIR}/samba4.initd-r1" samba newconfd "${CONFDIR}/samba4.confd" samba - systemd_dotmpfilesd "${FILESDIR}"/samba.conf + [[ ! use_minimal ]] && dotmpfiles "${FILESDIR}"/samba.conf use addc || rm "${D}/$(systemd_get_systemunitdir)/samba.service" || die # Preserve functionality for old gentoo-specific unit names @@ -298,6 +306,20 @@ multilib_src_install() { keepdir /var/lib/samba/{bind-dns,private} keepdir /var/lock/samba keepdir /var/log/samba + + + rm -f "${ED%/}"/etc/samba/* + rm -f "${ED%/}"/usr/lib*/samba/ldb/* + if use minimal ; then + mv "${ED%/}"/usr/bin/net "${T}"/ + rm -f "${ED%/}"/usr/bin/* "${ED%/}"/usr/sbin/* + mv "${T}"/net "${ED%/}"/usr/bin/net + rm -rf ${ED%/}/lib*/security + rm -rf ${ED%/}/usr/lib/systemd + rm -rf ${ED%/}/usr/lib*/perl* + rm -rf ${ED%/}/usr/lib*/python* + rm -rf ${ED%/}/var + fi } multilib_src_test() {