diff options
| author | root <root@alpha.trunkmasters.com> | 2026-06-04 05:48:38 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-06-04 05:48:38 -0500 |
| commit | bfd9c39e4712ebdb442d4ca0673061faed1e70e1 (patch) | |
| tree | 0d7a74b4463ee387f9cf9368ceb1b757f694f72a /net-fs | |
| parent | f716a9fe6455d39eef01e718aae68dae61c19704 (diff) | |
| download | baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.gz baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.xz baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.zip | |
Revert "Adding metadata"
This reverts commit f716a9fe6455d39eef01e718aae68dae61c19704.
Diffstat (limited to 'net-fs')
179 files changed, 14416 insertions, 0 deletions
diff --git a/net-fs/autofs/Manifest b/net-fs/autofs/Manifest new file mode 100644 index 000000000000..fa7faaca461e --- /dev/null +++ b/net-fs/autofs/Manifest @@ -0,0 +1 @@ +DIST autofs-5.1.9.tar.xz 331872 BLAKE2B baa2fd57fb4ac9f7390cad74d16ef6ef2e484d40061f4f894e5968277747b6852d98e089e904229d5fb08bef7e1810a7b5f14f0ea0adae8e40e317636c8a1f89 SHA512 81eb04270727c3fbf9dfb4b07a8dd39beac9068d6289f2f3bb0eabf723c14bec36860d3b2759c46b597bd77e8f3fa521646445e926c95ab63859a3a6c8588dcc diff --git a/net-fs/autofs/autofs-5.1.9-r2.ebuild b/net-fs/autofs/autofs-5.1.9-r2.ebuild new file mode 100644 index 000000000000..012a395ac1b1 --- /dev/null +++ b/net-fs/autofs/autofs-5.1.9-r2.ebuild @@ -0,0 +1,127 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit linux-info systemd toolchain-funcs + +DESCRIPTION="Kernel based automounter" +HOMEPAGE="https://web.archive.org/web/*/http://www.linux-consulting.com/Amd_AutoFS/autofs.html https://git.kernel.org/pub/scm/linux/storage/autofs/autofs.git" +SRC_URI="https://www.kernel.org/pub/linux/daemons/${PN}/v5/${P}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~mips ppc ppc64 ~riscv ~sparc x86" +IUSE="ldap +libtirpc mount-locking sasl selinux systemd" + +# currently, sasl code assumes the presence of kerberosV +RDEPEND=" + net-libs/libnsl:= + >=sys-apps/util-linux-2.20 + ldap? ( + >=net-nds/openldap-2.0:= + sasl? ( + dev-libs/cyrus-sasl + dev-libs/libxml2:= + virtual/krb5 + ) + ) + systemd? ( sys-apps/systemd ) + libtirpc? ( net-libs/libtirpc:= ) + !libtirpc? ( elibc_glibc? ( sys-libs/glibc[rpc(-)] ) ) +" +DEPEND="${RDEPEND} + libtirpc? ( net-libs/rpcsvc-proto ) +" +BDEPEND=" + app-alternatives/lex + virtual/pkgconfig + app-alternatives/yacc +" +RDEPEND+=" selinux? ( sec-policy/selinux-automount )" + +PATCHES=( + "${FILESDIR}"/${PN}-5.1.9-c99.patch +) + +pkg_setup() { + linux-info_pkg_setup + + local CONFIG_CHECK + + if kernel_is -ge 4 18; then + CONFIG_CHECK="~AUTOFS_FS" + else + CONFIG_CHECK="~AUTOFS4_FS" + fi + + check_extra_config +} + +src_prepare() { + sed -i -e "s:/usr/bin/kill:/bin/kill:" samples/autofs.service.in || die # bug #479492 + sed -i -e "/^EnvironmentFile/d" samples/autofs.service.in || die # bug #592334 + + # Install samples including autofs.service + sed -i -e "/^SUBDIRS/s/$/ samples/g" Makefile.rules || die + + default +} + +src_configure() { + # bug #483716 + tc-export AR + # --with-confdir is for bug #361481 + # --with-mapdir is for bug #385113 + local myeconfargs=( + --with-confdir=/etc/conf.d + --with-mapdir=/etc/autofs + --without-dmalloc + $(use_with ldap openldap) + $(use_with libtirpc) + $(use_with sasl) + $(use_enable mount-locking) + $(use_with systemd systemd $(systemd_get_systemunitdir)) # bug #479492 + --without-hesiod + --disable-ext-env + --enable-sloppy-mount # bug #453778 + --enable-force-shutdown + --enable-ignore-busy + RANLIB="$(type -P $(tc-getRANLIB))" # bug #483716 + ) + + CONFIG_SHELL="${BROOT}/bin/bash" econf "${myeconfargs[@]}" +} + +src_compile() { + emake STRIP=: DONTSTRIP=1 +} + +src_install() { + default + rmdir "${D}"/run + + if kernel_is -lt 2 6 30; then + # kernel patches + docinto patches + dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch + fi + newinitd "${FILESDIR}"/autofs5.initd autofs + insinto etc/autofs + newins "${FILESDIR}"/autofs5-auto.master auto.master +} + +pkg_postinst() { + if kernel_is -lt 2 6 30; then + elog "This version of ${PN} requires a kernel with autofs4 supporting" + elog "protocol version 5.00. Patches for kernels older than 2.6.30 have" + elog "been installed into" + elog "${EROOT}/usr/share/doc/${P}/patches." + elog "For further instructions how to patch the kernel, please refer to" + elog "${EROOT}/usr/share/doc/${P}/INSTALL." + elog + fi + elog "If you plan on using autofs for automounting remote NFS mounts," + elog "please check that both portmap (or rpcbind) and rpc.statd/lockd" + elog "are running." +} diff --git a/net-fs/autofs/files/autofs-5.1.9-c99.patch b/net-fs/autofs/files/autofs-5.1.9-c99.patch new file mode 100644 index 000000000000..e218f52a96f1 --- /dev/null +++ b/net-fs/autofs/files/autofs-5.1.9-c99.patch @@ -0,0 +1,57 @@ +https://src.fedoraproject.org/rpms/autofs/c/787a553722ec9aecf0c5108065bef9ef110d7639?branch=rawhide +https://lore.kernel.org/autofs/874jgf4qwu.fsf@oldenburg.str.redhat.com/ +https://lore.kernel.org/autofs/878r5r4qy5.fsf@oldenburg.str.redhat.com/ + +Fix argument type for ldap_parse_page_control in configure probe, +to suppress an incompatible-pointer-types error. + +Submitted upstream: + + <https://lore.kernel.org/autofs/874jgf4qwu.fsf@oldenburg.str.redhat.com/> + +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -427,7 +427,7 @@ AC_LINK_IFELSE( + struct berval *c; + int ret; + LDAPControl **clp; +- ret = ldap_parse_page_control(ld,clp,ct,c); ]])], ++ ret = ldap_parse_page_control(ld,clp,ct,&c); ]])], + [ af_have_ldap_parse_page_control=yes + AC_MSG_RESULT(yes) ], + [ AC_MSG_RESULT(no) ]) + +Add casts to SASL callbacks to avoid incompatible-pointer-types +errors. + +Submitted upstream: + + <https://lore.kernel.org/autofs/878r5r4qy5.fsf@oldenburg.str.redhat.com/> + +--- a/modules/cyrus-sasl.c ++++ b/modules/cyrus-sasl.c +@@ -109,17 +109,17 @@ static int getpass_func(sasl_conn_t *, void *, int, sasl_secret_t **); + static int getuser_func(void *, int, const char **, unsigned *); + + static sasl_callback_t callbacks[] = { +- { SASL_CB_USER, &getuser_func, NULL }, +- { SASL_CB_AUTHNAME, &getuser_func, NULL }, +- { SASL_CB_PASS, &getpass_func, NULL }, ++ { SASL_CB_USER, (int(*)(void)) &getuser_func, NULL }, ++ { SASL_CB_AUTHNAME, (int(*)(void)) &getuser_func, NULL }, ++ { SASL_CB_PASS, (int(*)(void)) &getpass_func, NULL }, + { SASL_CB_LIST_END, NULL, NULL }, + }; + + static sasl_callback_t debug_callbacks[] = { +- { SASL_CB_LOG, &sasl_log_func, NULL }, +- { SASL_CB_USER, &getuser_func, NULL }, +- { SASL_CB_AUTHNAME, &getuser_func, NULL }, +- { SASL_CB_PASS, &getpass_func, NULL }, ++ { SASL_CB_LOG, (int(*)(void)) &sasl_log_func, NULL }, ++ { SASL_CB_USER, (int(*)(void)) &getuser_func, NULL }, ++ { SASL_CB_AUTHNAME, (int(*)(void)) &getuser_func, NULL }, ++ { SASL_CB_PASS, (int(*)(void)) &getpass_func, NULL }, + { SASL_CB_LIST_END, NULL, NULL }, + }; + diff --git a/net-fs/autofs/files/autofs5-auto.master b/net-fs/autofs/files/autofs5-auto.master new file mode 100644 index 000000000000..8ad09274584b --- /dev/null +++ b/net-fs/autofs/files/autofs5-auto.master @@ -0,0 +1,23 @@ +# Sample auto.master file +# This is an automounter map and it has the following format +# key [ -mount-options-separated-by-comma ] location +# For details of the format look at autofs(5). +# +#/misc /etc/autofs/auto.misc +#/net /etc/autofs/auto.net +# +# NOTE: mounts done from a hosts map will be mounted with the +# "nosuid" and "nodev" options unless the "suid" and "dev" +# options are explicitly given. +# +#/net -hosts +# +# Include central master map if it can be found using +# nsswitch sources. +# +# Note that if there are entries for /net or /misc (as +# above) in the included master map any keys that are the +# same will not be seen as the first read key seen takes +# precedence. +# +#+auto.master diff --git a/net-fs/autofs/files/autofs5.initd b/net-fs/autofs/files/autofs5.initd new file mode 100644 index 000000000000..1b9b0fadd8bb --- /dev/null +++ b/net-fs/autofs/files/autofs5.initd @@ -0,0 +1,69 @@ +#!/sbin/openrc-run +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +DAEMON=/usr/sbin/automount +PIDFILE=/var/run/autofs.pid +DEVICE=autofs + +depend() { + need localmount + use ypbind nfsclient slapd net +} + +extra_started_commands="reload" + +start() { + ebegin "Starting automounter" + + # Ensure autofs support is loaded + grep -q autofs /proc/filesystems || modprobe -q autofs4 + if [ $? -ne 0 ]; then + eend 1 "No autofs support available in kernel" + return 1 + fi + + # Check misc device + if [ -n "${USE_MISC_DEVICE}" -a "${USE_MISC_DEVICE}" = "yes" ]; then + sleep 1 + if [ -e "/proc/misc" ]; then + MINOR=$(awk "/${DEVICE}/ {print \$1}" /proc/misc) + if [ -n "${MINOR}" -a ! -c "/dev/${DEVICE}" ]; then + mknod -m 0600 "/dev/${DEVICE}" c 10 ${MINOR} + if [ $? -ne 0 ]; then + eend 1 "Could not create '/dev/${DEVICE}'" + return 1 + fi + fi + fi + if [ -x /sbin/restorecon -a -c "/dev/${DEVICE}" ]; then + /sbin/restorecon "/dev/${DEVICE}" + if [ $? -ne 0 ]; then + eend 1 "Failed to execute '/sbin/restorecon \"/dev/${DEVICE}\"'" + return 1 + fi + fi + else + [ -c "/dev/${DEVICE}" ] && rm -rf "/dev/${DEVICE}" + fi + + start-stop-daemon --start --exec ${DAEMON} -- -p ${PIDFILE} ${OPTIONS} + + eend $? +} + +stop() { + ebegin "Stopping automounter" + start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE} + eend $? +} + +reload() { + ebegin "Reloading automounter" + if [ ! -r "${PIDFILE}" ]; then + eend 1 "automount not running" + else + kill -s HUP $(cat "${PIDFILE}") 2> /dev/null + eend $? + fi +} diff --git a/net-fs/autofs/metadata.xml b/net-fs/autofs/metadata.xml new file mode 100644 index 000000000000..dda226dc4b9e --- /dev/null +++ b/net-fs/autofs/metadata.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>dlan@gentoo.org</email> + <name>Yixun Lan</name> + </maintainer> + <use> + <flag name="ldap">Install LDAP module</flag> + <flag name="libtirpc">Use TiRPC library instead of SunRPC</flag> + <flag name="mount-locking"> + Enable locking to prevent corruption of /etc/mtab in the presence of + concurrent auto-mounting. If enabled, recursive auto-mounting (eg. using + autofs to bind or loop mount a filesystem which is itself auto-mounted) + is not possible. + </flag> + <flag name="sasl">Enable SASL support in the LDAP module</flag> + </use> + <upstream> + <remote-id type="cpe">cpe:/a:ibm:autofs</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-fs/btfs/Manifest b/net-fs/btfs/Manifest new file mode 100644 index 000000000000..1f944b2285e4 --- /dev/null +++ b/net-fs/btfs/Manifest @@ -0,0 +1 @@ +DIST btfs-2.24.tar.gz 24328 BLAKE2B d143d25fd78706e60e7ad46053371140bc73a15e313ad35258aedc350614efe72c3662418da2ca61eb8c36a6f153db3477cdc0b5f290afd0eb361739b9d33f3d SHA512 33339d9eefe6836c8c96c4ea0fb6ee99150df5500f4d1dce107c20df72e0d2959152fca0901676cec1eebf1de39a69dc46ea96442aecd234c9fb4e7618337b0c diff --git a/net-fs/btfs/btfs-2.24.ebuild b/net-fs/btfs/btfs-2.24.ebuild new file mode 100644 index 000000000000..29eed55b8503 --- /dev/null +++ b/net-fs/btfs/btfs-2.24.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) +inherit autotools python-r1 + +DESCRIPTION="Bittorrent filesystem based on FUSE" +HOMEPAGE="https://github.com/johang/btfs" +SRC_URI="https://github.com/johang/btfs/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~x86" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +DEPEND=" + >=sys-fs/fuse-2.8.0:0 + >=net-misc/curl-7.22.0 + dev-libs/boost:= + >=net-libs/libtorrent-rasterbar-0.16.0:= +" +RDEPEND=" + ${DEPEND} + ${PYTHON_DEPS} +" +BDEPEND="virtual/pkgconfig" + +src_prepare() { + default + + # Don't install btplay via make + sed -i '/^SUBDIRS =/s/scripts//' Makefile.am || die + + eautoreconf +} + +src_install() { + default + + python_foreach_impl python_doscript scripts/btplay +} diff --git a/net-fs/btfs/metadata.xml b/net-fs/btfs/metadata.xml new file mode 100644 index 000000000000..d4b61e591cba --- /dev/null +++ b/net-fs/btfs/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <!-- maintainer-needed --> + <upstream> + <remote-id type="github">johang/btfs</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-fs/cifs-utils/Manifest b/net-fs/cifs-utils/Manifest new file mode 100644 index 000000000000..985daab574cb --- /dev/null +++ b/net-fs/cifs-utils/Manifest @@ -0,0 +1,4 @@ +DIST cifs-utils-7.0.tar.bz2 418638 BLAKE2B 514d35f243d0ef7b866068a9a53a4b1704d2856d491d56aa469e8e3919b4030cb920a7f60d08851b0a23d28a020d1ddf7daa8b9ac412f1567a0a60d2f6ee6774 SHA512 4c57741af0c4567a78f352c73caca998881666a5ed36536275cfa775efd66ff1a44ebe539a8ed96c409c5b08a1378266964ce667a27e9fc7f2d43999c63dd0eb +DIST cifs-utils-7.3.tar.bz2 423716 BLAKE2B 59cf39ed2bf14d1fff54b6ad3b2fa410dd20b7e49ff9e87a95521d7e72cd4c5fe506f7026db2f42c53f4f79ed8f2492e3aa98b6349b000c7e2457cfea695c94d SHA512 7e341f5f5f53c3d533350cbd58983fddc428921ef8f8da6dea7b58884786b778fcc24ec23d0ebafc944ca54b9978213425fa6270e5c28934efb3383c0b66745a +DIST cifs-utils-7.4.tar.bz2 389033 BLAKE2B 57e03bb050b2345229dd4e0de22ac7baae7dcf080fba54c1dc339d8ecc6e60254e30feaa160568f8465698769ee513447c77de3bf8b0cd9c234ec4590e8e4270 SHA512 36fb64ed531e983752be243be488392ba52c3797ac638147a75998b8965448009e95d7ccda187c7d50d753b0ddb87a464a83044064b099d49fffe03a0b6ba739 +DIST cifs-utils-7.5.tar.bz2 423849 BLAKE2B ddabbaaa122252640d9e69f7c180b53c33d0d02d14b26d96f1fc52858e3d6a3d491c64cec9bc9e0367dedfbc041fa7098d1de6aa3dc991e655ef45c919e3b1a3 SHA512 d44b26ca3224160bcb4fc712eb6c6d09fcfee196197d46481e95333494eaae1a4851712fba9b922c203e3cd301c481b433ff49ec396428c12ff7db3c628ce9e9 diff --git a/net-fs/cifs-utils/cifs-utils-7.0-r1.ebuild b/net-fs/cifs-utils/cifs-utils-7.0-r1.ebuild new file mode 100644 index 000000000000..4a828cc70277 --- /dev/null +++ b/net-fs/cifs-utils/cifs-utils-7.0-r1.ebuild @@ -0,0 +1,146 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) + +inherit autotools bash-completion-r1 flag-o-matic linux-info pam python-single-r1 + +DESCRIPTION="Tools for Managing Linux CIFS Client Filesystems" +HOMEPAGE="https://wiki.samba.org/index.php/LinuxCIFS_utils https://git.samba.org/cifs-utils.git/?p=cifs-utils.git" +SRC_URI="https://ftp.samba.org/pub/linux-cifs/${PN}/${P}.tar.bz2" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86" +IUSE="+acl +ads +caps creds pam +python systemd" + +RDEPEND=" + ads? ( + sys-apps/keyutils:= + sys-libs/talloc + virtual/krb5 + ) + caps? ( sys-libs/libcap-ng ) + creds? ( sys-apps/keyutils:= ) + pam? ( + sys-apps/keyutils:= + sys-libs/pam + ) + python? ( ${PYTHON_DEPS} ) +" +DEPEND="${RDEPEND}" +BDEPEND="dev-python/docutils" +PDEPEND=" + acl? ( >=net-fs/samba-4.0.0_alpha1 ) +" + +REQUIRED_USE=" + python? ( ${PYTHON_REQUIRED_USE} ) +" + +DOCS="doc/linux-cifs-client-guide.odt" + +PATCHES=( + "${FILESDIR}/${PN}-6.12-ln_in_destdir.patch" #766594 + "${FILESDIR}/${PN}-6.15-musl.patch" + "${FILESDIR}/${PN}-7.0-no-clobber-fortify-source.patch" + "${FILESDIR}/${PN}-7.0-musl.patch" +) + +pkg_setup() { + linux-info_pkg_setup + + if ! linux_config_exists || ! linux_chkconfig_present CIFS; then + ewarn "You must enable CIFS support in your kernel config, " + ewarn "to be able to mount samba shares. You can find it at" + ewarn + ewarn " File systems" + ewarn " Network File Systems" + ewarn " CIFS support" + ewarn + ewarn "and recompile your kernel ..." + fi + + use python && python-single-r1_pkg_setup +} + +src_prepare() { + default + + if has_version app-crypt/heimdal ; then + # https://bugs.gentoo.org/612584 + eapply "${FILESDIR}/${PN}-6.7-heimdal.patch" + fi + + eautoreconf +} + +src_configure() { + # bug #927809 + filter-flags -fno-semantic-interposition + + local myeconfargs=( + --enable-man + --enable-smbinfo + $(use_enable acl cifsacl cifsidmap) + $(use_enable ads cifsupcall) + $(use_with caps libcap) + $(use_enable creds cifscreds) + $(use_enable pam) + $(use_with pam pamdir $(getpam_mod_dir)) + $(use_enable python pythontools) + # mount.cifs can get passwords from systemd + $(use_enable systemd) + ) + ROOTSBINDIR="${EPREFIX}"/sbin \ + econf "${myeconfargs[@]}" +} + +src_install() { + default + + # remove empty directories + find "${ED}" -type d -empty -delete || die + + if use acl ; then + dodir /etc/cifs-utils + dosym ../../usr/$(get_libdir)/cifs-utils/idmapwb.so \ + /etc/cifs-utils/idmap-plugin + dodir /etc/request-key.d + echo 'create cifs.idmap * * /usr/sbin/cifs.idmap %k' \ + > "${ED}/etc/request-key.d/cifs.idmap.conf" + fi + + if use ads ; then + dodir /etc/request-key.d + echo 'create dns_resolver * * /usr/sbin/cifs.upcall %k' \ + > "${ED}/etc/request-key.d/cifs.upcall.conf" + echo 'create cifs.spnego * * /usr/sbin/cifs.upcall %k' \ + > "${ED}/etc/request-key.d/cifs.spnego.conf" + fi + + dobashcomp bash-completion/smbinfo + use python && python_fix_shebang "${ED}" +} + +pkg_postinst() { + # Inform about set-user-ID bit of mount.cifs + ewarn "setuid use flag was dropped due to multiple security implications" + ewarn "such as CVE-2009-2948, CVE-2011-3585 and CVE-2012-1586" + ewarn "You are free to set setuid flags by yourself" + + # Inform about upcall usage + if use acl ; then + einfo "The cifs.idmap utility has been enabled by creating the" + einfo "configuration file /etc/request-key.d/cifs.idmap.conf" + einfo "This enables you to get and set CIFS acls." + fi + + if use ads ; then + einfo "The cifs.upcall utility has been enabled by creating the" + einfo "configuration file /etc/request-key.d/cifs.upcall.conf" + einfo "This enables you to mount DFS shares." + fi +} diff --git a/net-fs/cifs-utils/cifs-utils-7.3.ebuild b/net-fs/cifs-utils/cifs-utils-7.3.ebuild new file mode 100644 index 000000000000..699b34fd5518 --- /dev/null +++ b/net-fs/cifs-utils/cifs-utils-7.3.ebuild @@ -0,0 +1,145 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) + +inherit autotools bash-completion-r1 flag-o-matic linux-info pam python-single-r1 + +DESCRIPTION="Tools for Managing Linux CIFS Client Filesystems" +HOMEPAGE="https://wiki.samba.org/index.php/LinuxCIFS_utils https://git.samba.org/cifs-utils.git/?p=cifs-utils.git" +SRC_URI="https://ftp.samba.org/pub/linux-cifs/${PN}/${P}.tar.bz2" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +IUSE="+acl +ads +caps creds pam +python systemd" + +RDEPEND=" + sys-libs/talloc + ads? ( + sys-apps/keyutils:= + virtual/krb5 + ) + caps? ( sys-libs/libcap-ng ) + creds? ( sys-apps/keyutils:= ) + pam? ( + sys-apps/keyutils:= + sys-libs/pam + ) + python? ( ${PYTHON_DEPS} ) +" +DEPEND="${RDEPEND}" +BDEPEND="dev-python/docutils" +PDEPEND=" + acl? ( >=net-fs/samba-4.0.0_alpha1 ) +" + +REQUIRED_USE=" + python? ( ${PYTHON_REQUIRED_USE} ) +" + +DOCS="doc/linux-cifs-client-guide.odt" + +PATCHES=( + "${FILESDIR}/${PN}-7.3-no-clobber-fortify-source.patch" + "${FILESDIR}/${PN}-7.0-musl.patch" +) + +pkg_setup() { + linux-info_pkg_setup + + if ! linux_config_exists || ! linux_chkconfig_present CIFS; then + ewarn "You must enable CIFS support in your kernel config, " + ewarn "to be able to mount samba shares. You can find it at" + ewarn + ewarn " File systems" + ewarn " Network File Systems" + ewarn " CIFS support" + ewarn + ewarn "and recompile your kernel ..." + fi + + use python && python-single-r1_pkg_setup +} + +src_prepare() { + default + + if has_version app-crypt/heimdal ; then + # bug #612584 + eapply "${FILESDIR}/${PN}-6.7-heimdal.patch" + fi + + eautoreconf +} + +src_configure() { + # bug #927809 + filter-flags -fno-semantic-interposition + + local myeconfargs=( + --enable-man + --enable-smbinfo + $(use_enable acl cifsacl cifsidmap) + $(use_enable ads cifsupcall) + $(use_with caps libcap) + $(use_with caps libcap-ng) + $(use_enable creds cifscreds) + $(use_enable pam) + $(use_with pam pamdir $(getpam_mod_dir)) + $(use_enable python pythontools) + # mount.cifs can get passwords from systemd + $(use_enable systemd) + ) + + ROOTSBINDIR="${EPREFIX}"/sbin econf "${myeconfargs[@]}" +} + +src_install() { + default + + # remove empty directories + find "${ED}" -type d -empty -delete || die + + if use acl ; then + dodir /etc/cifs-utils + dosym ../../usr/$(get_libdir)/cifs-utils/idmapwb.so \ + /etc/cifs-utils/idmap-plugin + dodir /etc/request-key.d + echo 'create cifs.idmap * * /usr/sbin/cifs.idmap %k' \ + > "${ED}/etc/request-key.d/cifs.idmap.conf" + fi + + if use ads ; then + dodir /etc/request-key.d + echo 'create dns_resolver * * /usr/sbin/cifs.upcall %k' \ + > "${ED}/etc/request-key.d/cifs.upcall.conf" + echo 'create cifs.spnego * * /usr/sbin/cifs.upcall %k' \ + > "${ED}/etc/request-key.d/cifs.spnego.conf" + fi + + dobashcomp bash-completion/smbinfo + use python && python_fix_shebang "${ED}" +} + +pkg_postinst() { + # Inform about set-user-ID bit of mount.cifs + ewarn "setuid use flag was dropped due to multiple security implications" + ewarn "such as CVE-2009-2948, CVE-2011-3585 and CVE-2012-1586" + ewarn "You are free to set setuid flags by yourself" + + # Inform about upcall usage + if use acl ; then + einfo "The cifs.idmap utility has been enabled by creating the" + einfo "configuration file /etc/request-key.d/cifs.idmap.conf" + einfo "This enables you to get and set CIFS acls." + fi + + if use ads ; then + einfo "The cifs.upcall utility has been enabled by creating the" + einfo "configuration file /etc/request-key.d/cifs.upcall.conf" + einfo "This enables you to mount DFS shares." + fi +} diff --git a/net-fs/cifs-utils/cifs-utils-7.4.ebuild b/net-fs/cifs-utils/cifs-utils-7.4.ebuild new file mode 100644 index 000000000000..cb4b4ef44fb2 --- /dev/null +++ b/net-fs/cifs-utils/cifs-utils-7.4.ebuild @@ -0,0 +1,144 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) + +inherit autotools bash-completion-r1 flag-o-matic linux-info pam python-single-r1 + +DESCRIPTION="Tools for Managing Linux CIFS Client Filesystems" +HOMEPAGE="https://wiki.samba.org/index.php/LinuxCIFS_utils https://git.samba.org/cifs-utils.git/?p=cifs-utils.git" +SRC_URI="https://ftp.samba.org/pub/linux-cifs/${PN}/${P}.tar.bz2" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86" +IUSE="+acl +ads +caps creds pam +python systemd" + +RDEPEND=" + sys-libs/talloc + ads? ( + sys-apps/keyutils:= + virtual/krb5 + ) + caps? ( sys-libs/libcap-ng ) + creds? ( sys-apps/keyutils:= ) + pam? ( + sys-apps/keyutils:= + sys-libs/pam + ) + python? ( ${PYTHON_DEPS} ) +" +DEPEND="${RDEPEND}" +BDEPEND="dev-python/docutils" +PDEPEND=" + acl? ( >=net-fs/samba-4.0.0_alpha1 ) +" + +REQUIRED_USE=" + python? ( ${PYTHON_REQUIRED_USE} ) +" + +DOCS="doc/linux-cifs-client-guide.odt" + +PATCHES=( + "${FILESDIR}/${PN}-7.3-no-clobber-fortify-source.patch" +) + +pkg_setup() { + linux-info_pkg_setup + + if ! linux_config_exists || ! linux_chkconfig_present CIFS; then + ewarn "You must enable CIFS support in your kernel config, " + ewarn "to be able to mount samba shares. You can find it at" + ewarn + ewarn " File systems" + ewarn " Network File Systems" + ewarn " CIFS support" + ewarn + ewarn "and recompile your kernel ..." + fi + + use python && python-single-r1_pkg_setup +} + +src_prepare() { + default + + if has_version app-crypt/heimdal ; then + # bug #612584 + eapply "${FILESDIR}/${PN}-6.7-heimdal.patch" + fi + + eautoreconf +} + +src_configure() { + # bug #927809 + filter-flags -fno-semantic-interposition + + local myeconfargs=( + --enable-man + --enable-smbinfo + $(use_enable acl cifsacl cifsidmap) + $(use_enable ads cifsupcall) + $(use_with caps libcap) + $(use_with caps libcap-ng) + $(use_enable creds cifscreds) + $(use_enable pam) + $(use_with pam pamdir $(getpam_mod_dir)) + $(use_enable python pythontools) + # mount.cifs can get passwords from systemd + $(use_enable systemd) + ) + + ROOTSBINDIR="${EPREFIX}"/sbin econf "${myeconfargs[@]}" +} + +src_install() { + default + + # remove empty directories + find "${ED}" -type d -empty -delete || die + + if use acl ; then + dodir /etc/cifs-utils + dosym ../../usr/$(get_libdir)/cifs-utils/idmapwb.so \ + /etc/cifs-utils/idmap-plugin + dodir /etc/request-key.d + echo 'create cifs.idmap * * /usr/sbin/cifs.idmap %k' \ + > "${ED}/etc/request-key.d/cifs.idmap.conf" + fi + + if use ads ; then + dodir /etc/request-key.d + echo 'create dns_resolver * * /usr/sbin/cifs.upcall %k' \ + > "${ED}/etc/request-key.d/cifs.upcall.conf" + echo 'create cifs.spnego * * /usr/sbin/cifs.upcall %k' \ + > "${ED}/etc/request-key.d/cifs.spnego.conf" + fi + + dobashcomp bash-completion/smbinfo + use python && python_fix_shebang "${ED}" +} + +pkg_postinst() { + # Inform about set-user-ID bit of mount.cifs + ewarn "setuid use flag was dropped due to multiple security implications" + ewarn "such as CVE-2009-2948, CVE-2011-3585 and CVE-2012-1586" + ewarn "You are free to set setuid flags by yourself" + + # Inform about upcall usage + if use acl ; then + einfo "The cifs.idmap utility has been enabled by creating the" + einfo "configuration file /etc/request-key.d/cifs.idmap.conf" + einfo "This enables you to get and set CIFS acls." + fi + + if use ads ; then + einfo "The cifs.upcall utility has been enabled by creating the" + einfo "configuration file /etc/request-key.d/cifs.upcall.conf" + einfo "This enables you to mount DFS shares." + fi +} diff --git a/net-fs/cifs-utils/cifs-utils-7.5.ebuild b/net-fs/cifs-utils/cifs-utils-7.5.ebuild new file mode 100644 index 000000000000..8d64b5d1ec89 --- /dev/null +++ b/net-fs/cifs-utils/cifs-utils-7.5.ebuild @@ -0,0 +1,144 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) + +inherit autotools bash-completion-r1 flag-o-matic linux-info pam python-single-r1 + +DESCRIPTION="Tools for Managing Linux CIFS Client Filesystems" +HOMEPAGE="https://wiki.samba.org/index.php/LinuxCIFS_utils https://git.samba.org/cifs-utils.git/?p=cifs-utils.git" +SRC_URI="https://ftp.samba.org/pub/linux-cifs/${PN}/${P}.tar.bz2" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86" +IUSE="+acl +ads +caps creds pam +python systemd" + +RDEPEND=" + sys-libs/talloc + ads? ( + sys-apps/keyutils:= + virtual/krb5 + ) + caps? ( sys-libs/libcap-ng ) + creds? ( sys-apps/keyutils:= ) + pam? ( + sys-apps/keyutils:= + sys-libs/pam + ) + python? ( ${PYTHON_DEPS} ) +" +DEPEND="${RDEPEND}" +BDEPEND="dev-python/docutils" +PDEPEND=" + acl? ( >=net-fs/samba-4.0.0_alpha1 ) +" + +REQUIRED_USE=" + python? ( ${PYTHON_REQUIRED_USE} ) +" + +DOCS="doc/linux-cifs-client-guide.odt" + +PATCHES=( + "${FILESDIR}/${PN}-7.3-no-clobber-fortify-source.patch" +) + +pkg_setup() { + linux-info_pkg_setup + + if ! linux_config_exists || ! linux_chkconfig_present CIFS; then + ewarn "You must enable CIFS support in your kernel config, " + ewarn "to be able to mount samba shares. You can find it at" + ewarn + ewarn " File systems" + ewarn " Network File Systems" + ewarn " CIFS support" + ewarn + ewarn "and recompile your kernel ..." + fi + + use python && python-single-r1_pkg_setup +} + +src_prepare() { + default + + if has_version app-crypt/heimdal ; then + # bug #612584 + eapply "${FILESDIR}/${PN}-6.7-heimdal.patch" + fi + + eautoreconf +} + +src_configure() { + # bug #927809 + filter-flags -fno-semantic-interposition + + local myeconfargs=( + --enable-man + --enable-smbinfo + $(use_enable acl cifsacl cifsidmap) + $(use_enable ads cifsupcall) + $(use_with caps libcap) + $(use_with caps libcap-ng) + $(use_enable creds cifscreds) + $(use_enable pam) + $(use_with pam pamdir $(getpam_mod_dir)) + $(use_enable python pythontools) + # mount.cifs can get passwords from systemd + $(use_enable systemd) + ) + + ROOTSBINDIR="${EPREFIX}"/sbin econf "${myeconfargs[@]}" +} + +src_install() { + default + + # remove empty directories + find "${ED}" -type d -empty -delete || die + + if use acl ; then + dodir /etc/cifs-utils + dosym ../../usr/$(get_libdir)/cifs-utils/idmapwb.so \ + /etc/cifs-utils/idmap-plugin + dodir /etc/request-key.d + echo 'create cifs.idmap * * /usr/sbin/cifs.idmap %k' \ + > "${ED}/etc/request-key.d/cifs.idmap.conf" + fi + + if use ads ; then + dodir /etc/request-key.d + echo 'create dns_resolver * * /usr/sbin/cifs.upcall %k' \ + > "${ED}/etc/request-key.d/cifs.upcall.conf" + echo 'create cifs.spnego * * /usr/sbin/cifs.upcall %k' \ + > "${ED}/etc/request-key.d/cifs.spnego.conf" + fi + + dobashcomp bash-completion/smbinfo + use python && python_fix_shebang "${ED}" +} + +pkg_postinst() { + # Inform about set-user-ID bit of mount.cifs + ewarn "setuid use flag was dropped due to multiple security implications" + ewarn "such as CVE-2009-2948, CVE-2011-3585 and CVE-2012-1586" + ewarn "You are free to set setuid flags by yourself" + + # Inform about upcall usage + if use acl ; then + einfo "The cifs.idmap utility has been enabled by creating the" + einfo "configuration file /etc/request-key.d/cifs.idmap.conf" + einfo "This enables you to get and set CIFS acls." + fi + + if use ads ; then + einfo "The cifs.upcall utility has been enabled by creating the" + einfo "configuration file /etc/request-key.d/cifs.upcall.conf" + einfo "This enables you to mount DFS shares." + fi +} diff --git a/net-fs/cifs-utils/files/cifs-utils-6.12-ln_in_destdir.patch b/net-fs/cifs-utils/files/cifs-utils-6.12-ln_in_destdir.patch new file mode 100644 index 000000000000..a5f7be668ac3 --- /dev/null +++ b/net-fs/cifs-utils/files/cifs-utils-6.12-ln_in_destdir.patch @@ -0,0 +1,22 @@ +Fixed an inverted race condition when installing with MAKEOPTS="-j1" + +jer found this: + install-root_sbinPROGRAMS is called from install-data-am but + install-exec-hook is called from install-exec-am + +So moving the failing ln call into install-data-hook for now... + +--- cifs-utils-6.12/Makefile.am ++++ cifs-utils-6.12/Makefile.am +@@ -117,10 +117,8 @@ + + SUBDIRS = contrib + +-install-exec-hook: install-sbinPROGRAMS ++install-data-hook: install-sbinPROGRAMS + (cd $(DESTDIR)$(ROOTSBINDIR) && ln -sf mount.cifs mount.smb3) +- +-install-data-hook: + if CONFIG_MAN + ( cd $(DESTDIR)$(man8dir) && ln -sf mount.cifs.8 mount.smb3.8) + endif diff --git a/net-fs/cifs-utils/files/cifs-utils-6.15-musl.patch b/net-fs/cifs-utils/files/cifs-utils-6.15-musl.patch new file mode 100644 index 000000000000..f17cc68bdaca --- /dev/null +++ b/net-fs/cifs-utils/files/cifs-utils-6.15-musl.patch @@ -0,0 +1,80 @@ +https://marc.info/?l=linux-cifs&m=165604639613381&w=2 + +From c267ecf6a1c2152e640897d30cc0e8f637a8ef76 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Fri, 24 Jun 2022 05:25:23 +0100 +Subject: [PATCH 1/2] getcifsacl, setcifsacl: add missing <linux/limits.h> + include for XATTR_SIZE_MAX + +Needed to build on musl. It only works on glibc because of transitive includes +(which could break in future). + +Example failure: +``` +getcifsacl.c: In function 'getcifsacl': +getcifsacl.c:429:24: error: 'XATTR_SIZE_MAX' undeclared (first use in this function) + 429 | if (bufsize >= XATTR_SIZE_MAX) { + | ^~~~~~~~~~~~~~ +``` + +Bug: https://bugs.gentoo.org/842195 +Signed-off-by: Sam James <sam@gentoo.org> +--- a/getcifsacl.c ++++ b/getcifsacl.c +@@ -34,6 +34,7 @@ + #include <errno.h> + #include <limits.h> + #include <ctype.h> ++#include <linux/limits.h> + #include <sys/xattr.h> + #include "cifsacl.h" + #include "idmap_plugin.h" +--- a/setcifsacl.c ++++ b/setcifsacl.c +@@ -48,6 +48,7 @@ + #include <errno.h> + #include <limits.h> + #include <ctype.h> ++#include <linux/limits.h> + #include <sys/xattr.h> + + #include "cifsacl.h" +From d1a36cc4caa541d1f0f9a3426a5202b680cf7ff8 Mon Sep 17 00:00:00 2001 +From: Sam James <sam@gentoo.org> +Date: Fri, 24 Jun 2022 05:26:54 +0100 +Subject: [PATCH 2/2] getcifsacl, setcifsacl: add missing <endian.h> include + for le32toh + +Needed to fix build on musl libc. It only works by chance on glibc +because of transitive includes (which could break at any time). + +Example failure: +``` +getcifsacl.c: In function 'print_ace': +getcifsacl.c:284:16: warning: implicit declaration of function 'le16toh' [-Wimplicit-function-declaration] + 284 | size = le16toh(pace->size); + | ^~~~~~~ +``` + +Bug: https://bugs.gentoo.org/842195 +Signed-off-by: Sam James <sam@gentoo.org> +--- a/getcifsacl.c ++++ b/getcifsacl.c +@@ -23,6 +23,7 @@ + #include "config.h" + #endif /* HAVE_CONFIG_H */ + ++#include <endian.h> + #include <string.h> + #include <getopt.h> + #include <stdint.h> +--- a/setcifsacl.c ++++ b/setcifsacl.c +@@ -38,6 +38,7 @@ + #include "config.h" + #endif /* HAVE_CONFIG_H */ + ++#include <endian.h> + #include <string.h> + #include <getopt.h> + #include <stdint.h> diff --git a/net-fs/cifs-utils/files/cifs-utils-6.7-heimdal.patch b/net-fs/cifs-utils/files/cifs-utils-6.7-heimdal.patch new file mode 100644 index 000000000000..f8fea48fb4b4 --- /dev/null +++ b/net-fs/cifs-utils/files/cifs-utils-6.7-heimdal.patch @@ -0,0 +1,27 @@ +https://bugs.gentoo.org/612584 + +--- cifs-utils-6.7/cifs.upcall.c ++++ cifs-utils-6.7/cifs.upcall.c +@@ -75,11 +75,13 @@ + #define KRB5_KEY_LENGTH(k) ((k)->keyvalue.length) + #define KRB5_KEY_DATA(k) ((k)->keyvalue.data) + #define KRB5_KEY_DATA_CAST void ++#define KRB5_FREE_STRING(c,k) krb5_xfree(k) + #else /* MIT */ + #define KRB5_KEY_TYPE(k) ((k)->enctype) + #define KRB5_KEY_LENGTH(k) ((k)->length) + #define KRB5_KEY_DATA(k) ((k)->contents) + #define KRB5_KEY_DATA_CAST krb5_octet ++#define KRB5_FREE_STRING(c,k) krb5_free_string(c,k) + #endif + + #ifdef HAVE_LIBCAP_NG +@@ -358,7 +360,7 @@ + syslog(LOG_DEBUG, "%s: krb5_cc_get_full_name failed: %d\n", __func__, ret); + } else { + syslog(LOG_DEBUG, "%s: default ccache is %s\n", __func__, cachename); +- krb5_free_string(context, cachename); ++ KRB5_FREE_STRING(context, cachename); + } + + if (!get_tgt_time(cc)) { diff --git a/net-fs/cifs-utils/files/cifs-utils-7.0-musl.patch b/net-fs/cifs-utils/files/cifs-utils-7.0-musl.patch new file mode 100644 index 000000000000..cca3a9366049 --- /dev/null +++ b/net-fs/cifs-utils/files/cifs-utils-7.0-musl.patch @@ -0,0 +1,63 @@ +https://lore.kernel.org/linux-cifs/CALMA0xaVdk3qwkb-92QqF2+6z+=oxbBWDR1hYEoE2WUc7jVGkw@mail.gmail.com/T/#u + +From abd3d9a2d4f8a5dc4d90daddc7cf0c62d954f03a Mon Sep 17 00:00:00 2001 +From: "Z. Liu" <zhixu.liu@gmail.com> +Date: Fri, 2 May 2025 23:08:41 +0800 +Subject: [PATCH] getcifsacl, setcifsacl: use <libgen.h> for basename + +basename() is defined in <libgen.h> only in musl, while glibc defines it +in <string.h> too, which is not standard behavior. + +Signed-off-by: Z. Liu <zhixu.liu@gmail.com> + +diff --git a/getcifsacl.c b/getcifsacl.c +index 97471e9..6c6356f 100644 +--- a/getcifsacl.c ++++ b/getcifsacl.c +@@ -33,6 +33,7 @@ + #include <stdlib.h> + #include <stddef.h> + #include <errno.h> ++#include <libgen.h> + #include <limits.h> + #include <ctype.h> + #include <linux/limits.h> +diff --git a/setcifsacl.c b/setcifsacl.c +index b199118..3cb603c 100644 +--- a/setcifsacl.c ++++ b/setcifsacl.c +@@ -47,6 +47,7 @@ + #include <stdio.h> + #include <stdlib.h> + #include <errno.h> ++#include <libgen.h> + #include <limits.h> + #include <ctype.h> + #include <linux/limits.h> +-- +2.45.2 + +From ae644b56a4446f520a75217f9288775e127ab2c8 Mon Sep 17 00:00:00 2001 +From: "Z. Liu" <zhixu.liu@gmail.com> +Date: Tue, 13 May 2025 07:31:46 +0800 +Subject: [PATCH] cifscreds: use <libgen.h> for basename + +fix another implicit declaration of function 'basename' in musl + +Signed-off-by: Z. Liu <zhixu.liu@gmail.com> + +diff --git a/cifscreds.c b/cifscreds.c +index f552bc8..295059f 100644 +--- a/cifscreds.c ++++ b/cifscreds.c +@@ -29,6 +29,7 @@ + #include <keyutils.h> + #include <getopt.h> + #include <errno.h> ++#include <libgen.h> + #include "cifskey.h" + #include "mount.h" + #include "resolve_host.h" +-- +2.45.2 + diff --git a/net-fs/cifs-utils/files/cifs-utils-7.0-no-clobber-fortify-source.patch b/net-fs/cifs-utils/files/cifs-utils-7.0-no-clobber-fortify-source.patch new file mode 100644 index 000000000000..07661cf9dd02 --- /dev/null +++ b/net-fs/cifs-utils/files/cifs-utils-7.0-no-clobber-fortify-source.patch @@ -0,0 +1,11 @@ +Don't clobber toolchain defaults. + +https://bugs.gentoo.org/890278 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,4 +1,4 @@ +-AM_CFLAGS = -Wall -Wextra -D_FORTIFY_SOURCE=2 $(PIE_CFLAGS) $(RELRO_CFLAGS) ++AM_CFLAGS = -Wall -Wextra $(PIE_CFLAGS) $(RELRO_CFLAGS) + ACLOCAL_AMFLAGS = -I aclocal + + root_sbindir = $(ROOTSBINDIR) diff --git a/net-fs/cifs-utils/files/cifs-utils-7.3-no-clobber-fortify-source.patch b/net-fs/cifs-utils/files/cifs-utils-7.3-no-clobber-fortify-source.patch new file mode 100644 index 000000000000..7925664084a3 --- /dev/null +++ b/net-fs/cifs-utils/files/cifs-utils-7.3-no-clobber-fortify-source.patch @@ -0,0 +1,11 @@ +Don't clobber toolchain defaults. + +https://bugs.gentoo.org/890278 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,4 +1,4 @@ +-AM_CFLAGS = -Wall -Wextra -D_FORTIFY_SOURCE=2 $(PIE_CFLAGS) $(RELRO_CFLAGS) ++AM_CFLAGS = -Wall -Wextra $(PIE_CFLAGS) $(RELRO_CFLAGS) + ACLOCAL_AMFLAGS = -I aclocal + + root_exec_sbindir = $(ROOTSBINDIR) diff --git a/net-fs/cifs-utils/metadata.xml b/net-fs/cifs-utils/metadata.xml new file mode 100644 index 000000000000..8ae7effff581 --- /dev/null +++ b/net-fs/cifs-utils/metadata.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>samba@gentoo.org</email> + <name>Samba Team</name> + </maintainer> + <longdescription> + The in-kernel CIFS filesystem relies on a set of user-space + tools. That package of tools is called cifs-utils. Although not + really part of Samba proper, these tools were originally part of + the Samba package. For several reasons, shipping these tools as + part of Samba was problematic and it was deemed better to split + them off into their own package + </longdescription> + <upstream> + <remote-id type="cpe">cpe:/a:samba:cifs-utils</remote-id> + </upstream> + <use> + <flag name="ads">Enable Active Directory support and create cifs.idmap binary - idmap support</flag> + <flag name="caps">Enable <pkg>sys-libs/libcap-ng</pkg> support</flag> + <flag name="creds">cifs credentials support</flag> + <flag name="python">Enable support for python and install python tools</flag> + </use> +</pkgmetadata> diff --git a/net-fs/curlftpfs/Manifest b/net-fs/curlftpfs/Manifest new file mode 100644 index 000000000000..a90160793868 --- /dev/null +++ b/net-fs/curlftpfs/Manifest @@ -0,0 +1 @@ +DIST curlftpfs-0.9.2.tar.gz 365503 BLAKE2B 2175d5ecd0846a78038a813f76db99a911dff6e52aa170e59ae19d895961b0e9f5ba7b888288408daabc3a6c2b58590ab8b1c5424ea6b4b3875c460b089d6ddb SHA512 df07c418d175f766c89525017fc56e79726061eee0c3a6607ded0e1bf24f64f1475ba0e546157b65892194e3c4414c120822bf8fb175437e68366f82de216067 diff --git a/net-fs/curlftpfs/curlftpfs-0.9.2-r5.ebuild b/net-fs/curlftpfs/curlftpfs-0.9.2-r5.ebuild new file mode 100644 index 000000000000..06bf9879ed9d --- /dev/null +++ b/net-fs/curlftpfs/curlftpfs-0.9.2-r5.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools flag-o-matic + +DESCRIPTION="File system for accessing ftp hosts based on FUSE" +HOMEPAGE="https://curlftpfs.sourceforge.net/" +SRC_URI="https://downloads.sourceforge.net/${PN}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 arm ~arm64 x86" +RESTRICT="test" # bug 258460 + +RDEPEND=" + >=net-misc/curl-7.17.0 + >=sys-fs/fuse-2.2:0= + >=dev-libs/glib-2.0 +" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}"/${P}-64bit_filesize.patch + "${FILESDIR}"/${PN}-0.9.2-darwin.patch + "${FILESDIR}"/${PN}-0.9.2-memleak.patch + "${FILESDIR}"/${PN}-0.9.2-memleak-nocache.patch + "${FILESDIR}"/${PN}-0.9.2-fix-escaping.patch + "${FILESDIR}"/${PN}-0.9.2-__off_t.patch +) + +src_prepare() { + default + + # automake-1.13.1 obsoletes AM_* bit #469818 + sed -i -e 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.ac || die + + eautoreconf +} + +src_configure() { + # -Werror=lto-type-mismatch + # https://bugs.gentoo.org/861299 + # https://sourceforge.net/p/curlftpfs/bugs/76/ + filter-lto + + default +} + +src_install() { + default + dodoc README +} diff --git a/net-fs/curlftpfs/files/curlftpfs-0.9.2-64bit_filesize.patch b/net-fs/curlftpfs/files/curlftpfs-0.9.2-64bit_filesize.patch new file mode 100644 index 000000000000..256c74923708 --- /dev/null +++ b/net-fs/curlftpfs/files/curlftpfs-0.9.2-64bit_filesize.patch @@ -0,0 +1,11 @@ +--- a/ftpfs.c 2009-11-28 14:28:05.000000000 +0300 ++++ b/ftpfs.c 2009-11-28 14:28:19.000000000 +0300 +@@ -503,7 +503,7 @@ + + curl_easy_setopt_or_die(fh->write_conn, CURLOPT_URL, fh->full_path); + curl_easy_setopt_or_die(fh->write_conn, CURLOPT_UPLOAD, 1); +- curl_easy_setopt_or_die(fh->write_conn, CURLOPT_INFILESIZE, -1); ++ curl_easy_setopt_or_die(fh->write_conn, CURLOPT_INFILESIZE, (curl_off_t)-1); + curl_easy_setopt_or_die(fh->write_conn, CURLOPT_READFUNCTION, write_data_bg); + curl_easy_setopt_or_die(fh->write_conn, CURLOPT_READDATA, fh); + curl_easy_setopt_or_die(fh->write_conn, CURLOPT_LOW_SPEED_LIMIT, 1); diff --git a/net-fs/curlftpfs/files/curlftpfs-0.9.2-__off_t.patch b/net-fs/curlftpfs/files/curlftpfs-0.9.2-__off_t.patch new file mode 100644 index 000000000000..796acf09155c --- /dev/null +++ b/net-fs/curlftpfs/files/curlftpfs-0.9.2-__off_t.patch @@ -0,0 +1,15 @@ +musl targetsdon't define __foo_t + +https://bugs.gentoo.org/716764 +--- a/configure.ac ++++ b/configure.ac +@@ -22,6 +22,9 @@ case $host_os in + darwin*) + CFLAGS="$CFLAGS -D__off_t=off_t" + ;; ++ *musl*) ++ CFLAGS="$CFLAGS -D__off_t=off_t" ++ ;; + esac + CFLAGS="$CFLAGS -Wall -W -Wno-sign-compare -D_REENTRANT $GLIB_CFLAGS $FUSE_CFLAGS $LIBCURL_CPPFLAGS" + LIBS="$GLIB_LIBS $FUSE_LIBS $LIBCURL" diff --git a/net-fs/curlftpfs/files/curlftpfs-0.9.2-darwin.patch b/net-fs/curlftpfs/files/curlftpfs-0.9.2-darwin.patch new file mode 100644 index 000000000000..81265920531b --- /dev/null +++ b/net-fs/curlftpfs/files/curlftpfs-0.9.2-darwin.patch @@ -0,0 +1,16 @@ +https://sourceforge.net/tracker/?func=detail&atid=816359&aid=2799820&group_id=160565 + +--- a/configure.ac 2008-04-23 15:37:42 +0400 ++++ b/configure.ac 2009-06-02 09:46:05 +0400 +@@ -18,6 +18,11 @@ + AC_MSG_ERROR(["We need libcurl with support for FTP protocol."]) + fi + ++case $host_os in ++ darwin*) ++ CFLAGS="$CFLAGS -D__off_t=off_t" ++ ;; ++esac + CFLAGS="$CFLAGS -Wall -W -Wno-sign-compare -D_REENTRANT $GLIB_CFLAGS $FUSE_CFLAGS $LIBCURL_CPPFLAGS" + LIBS="$GLIB_LIBS $FUSE_LIBS $LIBCURL" + diff --git a/net-fs/curlftpfs/files/curlftpfs-0.9.2-fix-escaping.patch b/net-fs/curlftpfs/files/curlftpfs-0.9.2-fix-escaping.patch new file mode 100644 index 000000000000..df15bddd562f --- /dev/null +++ b/net-fs/curlftpfs/files/curlftpfs-0.9.2-fix-escaping.patch @@ -0,0 +1,420 @@ +fix handling of special symbols in file operations. + +Path fixes at least following cases: + - attempt to enter directory named '#' + - attempt to open file named '#' + - attempt to dereference link named '#' + - attempt to chown file / dir named '#' + +The fix is basically following mechanical conversion: +--- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, something); ++++ something_uri = path_to_uri(something); ++++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, something_uri); +=== curl_easy_perform(); ++++ free_uri(something_uri); + +What is not yet converted is ftp hostname. + +Reported-by: Jaakko Perttilä +Gentoo-bug: http://bugs.gentoo.org/458110 +Based-on-patch: https://github.com/jomat/curlftpfs/commit/da20298fd0d0dcefc7d6d69ffecbc5544e783cfe +Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> +diff --git a/ftpfs.c b/ftpfs.c +index ffd0b28..f21a267 100644 +--- a/ftpfs.c ++++ b/ftpfs.c +@@ -257,6 +257,7 @@ static int ftpfs_getdir(const char* path, fuse_cache_dirh_t h, + int err = 0; + CURLcode curl_res; + char* dir_path = get_fulldir_path(path); ++ char* dir_path_uri = path_to_uri(dir_path); + + DEBUG(1, "ftpfs_getdir: %s\n", dir_path); + struct buffer buf; +@@ -264,7 +265,7 @@ static int ftpfs_getdir(const char* path, fuse_cache_dirh_t h, + + pthread_mutex_lock(&ftpfs.lock); + cancel_previous_multi(); +- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, dir_path); ++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, dir_path_uri); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &buf); + curl_res = curl_easy_perform(ftpfs.connection); + pthread_mutex_unlock(&ftpfs.lock); +@@ -278,6 +279,7 @@ static int ftpfs_getdir(const char* path, fuse_cache_dirh_t h, + NULL, NULL, NULL, 0, h, filler); + } + ++ free_uri(dir_path_uri); + free(dir_path); + buf_free(&buf); + return op_return(err, "ftpfs_getdir"); +@@ -287,6 +289,7 @@ static int ftpfs_getattr(const char* path, struct stat* sbuf) { + int err; + CURLcode curl_res; + char* dir_path = get_dir_path(path); ++ char* dir_path_uri = path_to_uri(dir_path); + + DEBUG(2, "ftpfs_getattr: %s dir_path=%s\n", path, dir_path); + struct buffer buf; +@@ -294,7 +297,7 @@ static int ftpfs_getattr(const char* path, struct stat* sbuf) { + + pthread_mutex_lock(&ftpfs.lock); + cancel_previous_multi(); +- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, dir_path); ++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, dir_path_uri); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &buf); + curl_res = curl_easy_perform(ftpfs.connection); + pthread_mutex_unlock(&ftpfs.lock); +@@ -309,6 +312,7 @@ static int ftpfs_getattr(const char* path, struct stat* sbuf) { + err = parse_dir((char*)buf.p, dir_path + strlen(ftpfs.host) - 1, + name, sbuf, NULL, 0, NULL, NULL); + ++ free_uri(dir_path_uri); + free(dir_path); + buf_free(&buf); + if (err) return op_return(-ENOENT, "ftpfs_getattr"); +@@ -329,6 +333,7 @@ static size_t ftpfs_read_chunk(const char* full_path, char* rbuf, + int running_handles = 0; + int err = 0; + struct ftpfs_file* fh = get_ftpfs_file(fi); ++ char* full_path_uri = path_to_uri(full_path); /* TODO: optimize bu pushing up conversion to context */ + + DEBUG(2, "ftpfs_read_chunk: %s %p %zu %lld %p %p\n", + full_path, rbuf, size, offset, fi, fh); +@@ -355,7 +360,7 @@ static size_t ftpfs_read_chunk(const char* full_path, char* rbuf, + + cancel_previous_multi(); + +- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path); ++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path_uri); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &fh->buf); + if (offset) { + char range[15]; +@@ -444,6 +449,7 @@ static size_t ftpfs_read_chunk(const char* full_path, char* rbuf, + + pthread_mutex_unlock(&ftpfs.lock); + ++ free_uri(full_path_uri); + if (err) return CURLFTPFS_BAD_READ; + return size; + } +@@ -497,11 +503,12 @@ int write_thread_ctr = 0; + static void *ftpfs_write_thread(void *data) { + struct ftpfs_file *fh = data; + char range[15]; +- ++ char* full_path_uri = path_to_uri(fh->full_path); /* TODO: optimize bu pushing up conversion to context */ ++ + DEBUG(2, "enter streaming write thread #%d path=%s pos=%lld\n", ++write_thread_ctr, fh->full_path, fh->pos); + + +- curl_easy_setopt_or_die(fh->write_conn, CURLOPT_URL, fh->full_path); ++ curl_easy_setopt_or_die(fh->write_conn, CURLOPT_URL, full_path_uri); + curl_easy_setopt_or_die(fh->write_conn, CURLOPT_UPLOAD, 1); + curl_easy_setopt_or_die(fh->write_conn, CURLOPT_INFILESIZE, (curl_off_t)-1); + curl_easy_setopt_or_die(fh->write_conn, CURLOPT_READFUNCTION, write_data_bg); +@@ -541,6 +548,8 @@ static void *ftpfs_write_thread(void *data) { + + sem_post(&fh->data_written); /* ftpfs_write may return */ + ++ free_uri(full_path_uri); ++ + return NULL; + } + +@@ -621,16 +630,19 @@ static void free_ftpfs_file(struct ftpfs_file *fh) { + } + + static int buffer_file(struct ftpfs_file *fh) { ++ char* full_path_uri = path_to_uri(fh->full_path); /* TODO: optimize bu pushing up conversion to context */ + // If we want to write to the file, we have to load it all at once, + // modify it in memory and then upload it as a whole as most FTP servers + // don't support resume for uploads. + pthread_mutex_lock(&ftpfs.lock); + cancel_previous_multi(); +- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, fh->full_path); ++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path_uri); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &fh->buf); + CURLcode curl_res = curl_easy_perform(ftpfs.connection); + pthread_mutex_unlock(&ftpfs.lock); + ++ free_uri(full_path_uri); ++ + if (curl_res != 0) { + return -EACCES; + } +@@ -643,10 +655,11 @@ static int create_empty_file(const char * path) + int err = 0; + + char *full_path = get_full_path(path); ++ char* full_path_uri = path_to_uri(full_path); + + pthread_mutex_lock(&ftpfs.lock); + cancel_previous_multi(); +- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path); ++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path_uri); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_INFILESIZE, 0); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_UPLOAD, 1); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_READDATA, NULL); +@@ -656,7 +669,9 @@ static int create_empty_file(const char * path) + + if (curl_res != 0) { + err = -EPERM; +- } ++ } ++ ++ free_uri(full_path_uri); + free(full_path); + return err; + } +@@ -875,6 +890,7 @@ static int ftpfs_chmod(const char* path, mode_t mode) { + + struct curl_slist* header = NULL; + char* full_path = get_dir_path(path); ++ char* full_path_uri = path_to_uri(full_path); + char* filename = get_file_name(path); + char* cmd = g_strdup_printf("SITE CHMOD %.3o %s", mode_c, filename); + struct buffer buf; +@@ -885,7 +901,7 @@ static int ftpfs_chmod(const char* path, mode_t mode) { + pthread_mutex_lock(&ftpfs.lock); + cancel_previous_multi(); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_POSTQUOTE, header); +- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path); ++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path_uri); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &buf); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_NOBODY, ftpfs.safe_nobody); + CURLcode curl_res = curl_easy_perform(ftpfs.connection); +@@ -896,12 +912,13 @@ static int ftpfs_chmod(const char* path, mode_t mode) { + if (curl_res != 0) { + err = -EPERM; + } +- ++ + buf_free(&buf); + curl_slist_free_all(header); ++ free_uri(full_path_uri); + free(full_path); + free(filename); +- free(cmd); ++ free(cmd); + return op_return(err, "ftpfs_chmod"); + } + +@@ -912,6 +929,7 @@ static int ftpfs_chown(const char* path, uid_t uid, gid_t gid) { + + struct curl_slist* header = NULL; + char* full_path = get_dir_path(path); ++ char* full_path_uri = path_to_uri(full_path); + char* filename = get_file_name(path); + char* cmd = g_strdup_printf("SITE CHUID %i %s", uid, filename); + char* cmd2 = g_strdup_printf("SITE CHGID %i %s", gid, filename); +@@ -924,7 +942,7 @@ static int ftpfs_chown(const char* path, uid_t uid, gid_t gid) { + pthread_mutex_lock(&ftpfs.lock); + cancel_previous_multi(); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_POSTQUOTE, header); +- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path); ++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path_uri); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &buf); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_NOBODY, ftpfs.safe_nobody); + CURLcode curl_res = curl_easy_perform(ftpfs.connection); +@@ -938,6 +956,7 @@ static int ftpfs_chown(const char* path, uid_t uid, gid_t gid) { + + buf_free(&buf); + curl_slist_free_all(header); ++ free_uri(full_path_uri); + free(full_path); + free(filename); + free(cmd); +@@ -1001,6 +1020,7 @@ static int ftpfs_rmdir(const char* path) { + int err = 0; + struct curl_slist* header = NULL; + char* full_path = get_dir_path(path); ++ char* full_path_uri = path_to_uri(full_path); + char* filename = get_file_name(path); + char* cmd = g_strdup_printf("RMD %s", filename); + struct buffer buf; +@@ -1014,7 +1034,7 @@ static int ftpfs_rmdir(const char* path) { + pthread_mutex_lock(&ftpfs.lock); + cancel_previous_multi(); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_POSTQUOTE, header); +- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path); ++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path_uri); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &buf); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_NOBODY, ftpfs.safe_nobody); + CURLcode curl_res = curl_easy_perform(ftpfs.connection); +@@ -1028,6 +1048,7 @@ static int ftpfs_rmdir(const char* path) { + + buf_free(&buf); + curl_slist_free_all(header); ++ free_uri(full_path_uri); + free(full_path); + free(filename); + free(cmd); +@@ -1038,6 +1059,7 @@ static int ftpfs_mkdir(const char* path, mode_t mode) { + int err = 0; + struct curl_slist* header = NULL; + char* full_path = get_dir_path(path); ++ char* full_path_uri = path_to_uri(full_path); + char* filename = get_file_name(path); + char* cmd = g_strdup_printf("MKD %s", filename); + struct buffer buf; +@@ -1048,7 +1070,7 @@ static int ftpfs_mkdir(const char* path, mode_t mode) { + pthread_mutex_lock(&ftpfs.lock); + cancel_previous_multi(); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_POSTQUOTE, header); +- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path); ++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path_uri); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &buf); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_NOBODY, ftpfs.safe_nobody); + CURLcode curl_res = curl_easy_perform(ftpfs.connection); +@@ -1062,6 +1084,7 @@ static int ftpfs_mkdir(const char* path, mode_t mode) { + + buf_free(&buf); + curl_slist_free_all(header); ++ free_uri(full_path_uri); + free(full_path); + free(filename); + free(cmd); +@@ -1076,6 +1099,7 @@ static int ftpfs_unlink(const char* path) { + int err = 0; + struct curl_slist* header = NULL; + char* full_path = get_dir_path(path); ++ char* full_path_uri = path_to_uri(full_path); + char* filename = get_file_name(path); + char* cmd = g_strdup_printf("DELE %s", filename); + struct buffer buf; +@@ -1086,7 +1110,7 @@ static int ftpfs_unlink(const char* path) { + pthread_mutex_lock(&ftpfs.lock); + cancel_previous_multi(); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_POSTQUOTE, header); +- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path); ++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, full_path_uri); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &buf); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_NOBODY, ftpfs.safe_nobody); + CURLcode curl_res = curl_easy_perform(ftpfs.connection); +@@ -1100,6 +1124,7 @@ static int ftpfs_unlink(const char* path) { + + buf_free(&buf); + curl_slist_free_all(header); ++ free_uri(full_path_uri); + free(full_path); + free(filename); + free(cmd); +@@ -1301,6 +1326,7 @@ static int ftpfs_readlink(const char *path, char *linkbuf, size_t size) { + int err; + CURLcode curl_res; + char* dir_path = get_dir_path(path); ++ char* dir_path_uri = path_to_uri(dir_path); + + DEBUG(2, "dir_path: %s %s\n", path, dir_path); + struct buffer buf; +@@ -1308,7 +1334,7 @@ static int ftpfs_readlink(const char *path, char *linkbuf, size_t size) { + + pthread_mutex_lock(&ftpfs.lock); + cancel_previous_multi(); +- curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, dir_path); ++ curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_URL, dir_path_uri); + curl_easy_setopt_or_die(ftpfs.connection, CURLOPT_WRITEDATA, &buf); + curl_res = curl_easy_perform(ftpfs.connection); + pthread_mutex_unlock(&ftpfs.lock); +@@ -1323,6 +1349,7 @@ static int ftpfs_readlink(const char *path, char *linkbuf, size_t size) { + err = parse_dir((char*)buf.p, dir_path + strlen(ftpfs.host) - 1, + name, NULL, linkbuf, size, NULL, NULL); + ++ free_uri(dir_path_uri); + free(dir_path); + buf_free(&buf); + if (err) return op_return(-ENOENT, "ftpfs_readlink"); +diff --git a/path_utils.c b/path_utils.c +index db3d7e4..214b5e6 100644 +--- a/path_utils.c ++++ b/path_utils.c +@@ -92,3 +92,72 @@ char* get_dir_path(const char* path) { + + return ret; + } ++ ++/* ++ * the chars not needed to be escaped: ++ * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" ++ */ ++static inline int is_unreserved_rfc3986(char c) ++{ ++ int is_locase_alpha = (c >= 'a' && c <= 'z'); ++ int is_upcase_alpha = (c >= 'a' && c <= 'z'); ++ int is_digit = (c >= '0' && c <= '9'); ++ int is_special = c == '-' ++ || c == '.' ++ || c == '_' ++ || c == '~'; ++ int is_unreserved = is_locase_alpha ++ || is_upcase_alpha ++ || is_digit ++ || is_special; ++ ++ return is_unreserved; ++} ++ ++static inline int is_unreserved(char c) ++{ ++ return is_unreserved_rfc3986(c) || c == '/'; ++} ++ ++char* path_to_uri(const char* path) ++{ ++ static const char hex[] = "0123456789ABCDEF"; ++ size_t path_len = strlen(path); ++ size_t host_len = strlen(ftpfs.host); ++ /* at worst: c -> %XX */ ++ char * encoded_path = malloc (3 * path_len + 1); ++ const char * s = path; ++ char * d = encoded_path; ++ ++ /* ++ * 'path' is always prefixed with 'ftpfs.host' ++ */ ++ memcpy (d, ftpfs.host, host_len); ++ s += host_len; ++ d += host_len; ++ ++ for (; *s; ++s) ++ { ++ char c = *s; ++ if (is_unreserved (c)) ++ { ++ *d++ = c; ++ } ++ else ++ { ++ unsigned int hi = ((unsigned)c >> 4) & 0xF; ++ unsigned int lo = ((unsigned)c >> 0) & 0xF; ++ *d++ = '%'; ++ *d++ = hex[hi]; ++ *d++ = hex[lo]; ++ } ++ } ++ *d = '\0'; ++ ++ return encoded_path; ++} ++ ++void free_uri(char* path) ++{ ++ free(path); ++} +diff --git a/path_utils.h b/path_utils.h +index 084ae4d..e3e9bca 100644 +--- a/path_utils.h ++++ b/path_utils.h +@@ -6,4 +6,11 @@ char* get_full_path(const char* path); + char* get_fulldir_path(const char* path); + char* get_dir_path(const char* path); + ++/* ++ * Transforms UNIX path to RFC3986 encoded path ++ * (CURLOPT_URL accepts only such paths) ++ */ ++char* path_to_uri(const char* path); ++void free_uri(char* path); ++ + #endif /* __CURLFTPFS_PATH_UTILS_H__ */ diff --git a/net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak-nocache.patch b/net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak-nocache.patch new file mode 100644 index 000000000000..344233c2b83e --- /dev/null +++ b/net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak-nocache.patch @@ -0,0 +1,60 @@ +Picked-from: http://pkgs.fedoraproject.org/cgit/curlftpfs.git/tree/curlftpfs-0.9.2-memleak-cached%23591299.patch?h=f18 + +@@ -, +, @@ +--- + cache.c | 2 1 + 1 - 0 ! + ftpfs-ls.c | 19 15 + 4 - 0 ! + 2 files changed, 16 insertions(+), 5 deletions(-) +--- b/cache.c ++++ b/cache.c +@@ -25,7 +25,7 @@ struct cache { + time_t last_cleaned; + }; + +-static struct cache cache; ++struct cache cache; + + struct node { + struct stat stat; +--- b/ftpfs-ls.c ++++ b/ftpfs-ls.c +@@ -25,6 +25,13 @@ + #include "charset_utils.h" + #include "ftpfs-ls.h" + ++struct cache { ++ int on; ++ char incomplete[]; ++}; ++ ++extern struct cache cache; ++ + static int parse_dir_unix(const char *line, + struct stat *sbuf, + char *file, +@@ -243,8 +250,10 @@ int parse_dir(const char* list, const ch + reallink = g_strdup(link); + } + int linksize = strlen(reallink); +- cache_add_link(full_path, reallink, linksize+1); +- DEBUG(1, "cache_add_link: %s %s\n", full_path, reallink); ++ if (cache.on) { ++ cache_add_link(full_path, reallink, linksize+1); ++ DEBUG(1, "cache_add_link: %s %s\n", full_path, reallink); ++ } + if (linkbuf && linklen) { + if (linksize > linklen) linksize = linklen - 1; + strncpy(linkbuf, reallink, linksize); +@@ -257,8 +266,10 @@ int parse_dir(const char* list, const ch + DEBUG(1, "filler: %s\n", file); + filler(h, file, &stat_buf); + } else { +- DEBUG(1, "cache_add_attr: %s\n", full_path); +- cache_add_attr(full_path, &stat_buf); ++ if (cache.on) { ++ DEBUG(1, "cache_add_attr: %s\n", full_path); ++ cache_add_attr(full_path, &stat_buf); ++ } + } + + DEBUG(2, "comparing %s %s\n", name, file); diff --git a/net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak.patch b/net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak.patch new file mode 100644 index 000000000000..27163ac229e0 --- /dev/null +++ b/net-fs/curlftpfs/files/curlftpfs-0.9.2-memleak.patch @@ -0,0 +1,24 @@ +Picked-from: https://github.com/jomat/curlftpfs/commit/b8ce5599a17a1f9e00c93cff3a81fe88f51e8bd3 +Upstream-bug: https://sourceforge.net/tracker/?func=detail&aid=2924678&group_id=160565&atid=816357 + +commit b8ce5599a17a1f9e00c93cff3a81fe88f51e8bd3 +Author: jomat <jomat@copete.de> +Date: Sun Oct 16 18:41:37 2011 +0000 + + added patch agains memory leak + + see also https://sourceforge.net/tracker/?func=detail&aid=2924678&group_id=160565&atid=816357 + +diff --git a/ftpfs.c b/ftpfs.c +index 0346354..96146f7 100644 +--- a/ftpfs.c ++++ b/ftpfs.c +@@ -615,6 +615,8 @@ static void free_ftpfs_file(struct ftpfs_file *fh) { + sem_destroy(&fh->data_need); + sem_destroy(&fh->data_written); + sem_destroy(&fh->ready); ++ if (fh->buf.size) { buf_free(&fh->buf); } ++ if (fh->stream_buf.size) { buf_free(&fh->stream_buf); } + free(fh); + } + diff --git a/net-fs/curlftpfs/metadata.xml b/net-fs/curlftpfs/metadata.xml new file mode 100644 index 000000000000..65da072a10f6 --- /dev/null +++ b/net-fs/curlftpfs/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <!-- maintainer-needed --> + <upstream> + <remote-id type="sourceforge">curlftpfs</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-fs/cvmfs/Manifest b/net-fs/cvmfs/Manifest new file mode 100644 index 000000000000..be3b05e098e3 --- /dev/null +++ b/net-fs/cvmfs/Manifest @@ -0,0 +1,3 @@ +DIST cvmfs-2.12.7.tar.gz 76792875 BLAKE2B 402bf915c1d71e1c49bf52e9312cf1a19ad9f85b7672b824b067aedaa5ba3d14827b838573e8a63bc51108ae9d28e8930385a47322336f88df6b1efd7a3e4a0b SHA512 a13a1faa9c37433d6d287d29ac56f45a34a564aaaf6df97fe58e79dad57769f01f10048a7e66b90347b7e791bac9d4cbdefb01d07f9ee7c8d61d7ff0833e8e69 +DIST cvmfs-2.13.1.tar.gz 68403758 BLAKE2B f0d7ff3ff458fa0c2fe7388d72eaa57d5acd3344be8aab00fec51f81bbca40242831746d14636e8f4417afa67ec3acd866315c230d04e0dea938adedc6b3f6c2 SHA512 fa21787a062cc28b745e5b7731a00439d0e9bf54a5dad50884daf9824c6bf646484d5091a3911000f95a02bdf8234628685d70e6cc1fdae51d5968e8d6a5e502 +DIST cvmfs-2.13.3.tar.gz 68265114 BLAKE2B 74e0e3e4f0e18f2746ad4a1d2fa269eb1e5979d6c7915e1e30d02b71af01b3986b45996e0fadac4d1f99a14c2c1eec80e1ea657e280e07ce57acd5773e540876 SHA512 299d19d799720d79ede88cc64b65408262ab4363a9ae43b7591ffbb781af286fba88772e1baa02254f3cf9a1c7fd4714b2e7206b8c6352f59d078a52eded5c2c diff --git a/net-fs/cvmfs/cvmfs-2.12.7.ebuild b/net-fs/cvmfs/cvmfs-2.12.7.ebuild new file mode 100644 index 000000000000..004447f6817e --- /dev/null +++ b/net-fs/cvmfs/cvmfs-2.12.7.ebuild @@ -0,0 +1,105 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake linux-info bash-completion-r1 + +DESCRIPTION="HTTP read-only file system for distributing software" +HOMEPAGE="https://cernvm.cern.ch/fs/" +SRC_URI="https://ecsft.cern.ch/dist/cvmfs/${P}/source.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" + +KEYWORDS="amd64 x86" +IUSE="server" + +CDEPEND=" + acct-group/cvmfs + acct-user/cvmfs + app-arch/libarchive + dev-cpp/gtest + dev-cpp/sparsehash + dev-db/sqlite:3= + dev-libs/leveldb:0= + dev-libs/openssl:0= + dev-libs/protobuf:0= + net-dns/c-ares:0= + net-libs/pacparser:0= + net-misc/curl:0[adns] + sys-apps/attr + sys-fs/fuse:0= + sys-fs/fuse:3= + sys-libs/libcap:0= + virtual/zlib:= +" + +RDEPEND="${CDEPEND} + app-admin/sudo + net-fs/autofs +" + +DEPEND="${CDEPEND} + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-2.10.1-gentoo.patch + "${FILESDIR}"/${PN}-2.12.7-protobuf.patch +) + +pkg_setup() { + if use server; then + CONFIG_CHECK="~OVERLAY_FS" + ERROR_AUFS_FS="CONFIG_OVERLAY_FS: is required to be set" + linux-info_pkg_setup + fi +} + +src_prepare() { + cmake_src_prepare + # gentoo stuff + rm bootstrap.sh || die + sed -i -e "s:/usr/bin/systemctl:/bin/systemctl:g" \ + -e "/^INSTALL_BASE/s:=.*\$:=${EPREFIX}/usr:" \ + -e "s:/bin/pidof:/usr/bin/pidof:g" cvmfs/cvmfs_config || die + sed -i -e 's/COPYING//' -e "s:cvmfs-\${CernVM-FS_VERSION_STRING}:${PF}:" \ + CMakeLists.txt || die + eapply_user +} + +src_configure() { + local mycmakeargs=( + -DBUILTIN_EXTERNALS=OFF + -DBUILD_CVMFS=ON + -DBUILD_LIBCVMFS=OFF # static library used only for development + -DBUILD_DOCUMENTATION=OFF + -DBUILD_GEOAPI=OFF # only used for stratum 1 servers + -DBUILD_LIBCVMFS_CACHE=OFF # for exotic cache configs + -DBUILD_PRELOADER=OFF # special purpose utility for HPCs + -DBUILD_RECEIVER=OFF # for distributed publishers only + -DBUILD_SERVER=$(usex server) + -DINSTALL_BASH_COMPLETION=OFF + -DINSTALL_MOUNT_SCRIPTS=ON + -DINSTALL_PUBLIC_KEYS=ON + ) + + cmake_src_configure +} + +src_install() { + cmake_src_install + newbashcomp cvmfs/bash_completion/cvmfs.bash_completion cvmfs_config + bashcomp_alias cvmfs_config cvmfs_server + dodoc doc/*.md + keepdir /var/lib/cvmfs + use server && keepdir /var/lib/cvmfs-server +} + +pkg_config() { + einfo "Setting up CernVM-FS client" + cvmfs_config setup + einfo "Now edit ${EROOT}/etc/cvmfs/default.local" + einfo "and restart the autofs service" +} diff --git a/net-fs/cvmfs/cvmfs-2.13.1.ebuild b/net-fs/cvmfs/cvmfs-2.13.1.ebuild new file mode 100644 index 000000000000..cb878665a84d --- /dev/null +++ b/net-fs/cvmfs/cvmfs-2.13.1.ebuild @@ -0,0 +1,104 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake linux-info bash-completion-r1 + +DESCRIPTION="HTTP read-only file system for distributing software" +HOMEPAGE="https://cernvm.cern.ch/fs/" +SRC_URI="https://ecsft.cern.ch/dist/cvmfs/${P}/source.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" + +KEYWORDS="amd64 x86" +IUSE="server" + +CDEPEND=" + acct-group/cvmfs + acct-user/cvmfs + app-arch/libarchive + dev-cpp/gtest + dev-cpp/sparsehash + dev-db/sqlite:3= + dev-libs/leveldb:0= + dev-libs/openssl:0= + dev-libs/protobuf:0= + net-dns/c-ares:0= + net-libs/pacparser:0= + net-misc/curl:0[adns] + sys-apps/attr + sys-fs/fuse:0= + sys-fs/fuse:3= + sys-libs/libcap:0= + virtual/zlib:= +" + +RDEPEND="${CDEPEND} + app-admin/sudo + net-fs/autofs +" + +DEPEND="${CDEPEND} + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-2.10.1-gentoo.patch +) + +pkg_setup() { + if use server; then + CONFIG_CHECK="~OVERLAY_FS" + ERROR_AUFS_FS="CONFIG_OVERLAY_FS: is required to be set" + linux-info_pkg_setup + fi +} + +src_prepare() { + cmake_src_prepare + # gentoo stuff + rm bootstrap.sh || die + sed -i -e "s:/usr/bin/systemctl:/bin/systemctl:g" \ + -e "/^INSTALL_BASE/s:=.*\$:=${EPREFIX}/usr:" \ + -e "s:/bin/pidof:/usr/bin/pidof:g" cvmfs/cvmfs_config || die + sed -i -e 's/COPYING//' -e "s:cvmfs-\${CernVM-FS_VERSION_STRING}:${PF}:" \ + CMakeLists.txt || die + eapply_user +} + +src_configure() { + local mycmakeargs=( + -DBUILTIN_EXTERNALS=OFF + -DBUILD_CVMFS=ON + -DBUILD_LIBCVMFS=OFF # static library used only for development + -DBUILD_DOCUMENTATION=OFF + -DBUILD_GEOAPI=OFF # only used for stratum 1 servers + -DBUILD_LIBCVMFS_CACHE=OFF # for exotic cache configs + -DBUILD_PRELOADER=OFF # special purpose utility for HPCs + -DBUILD_RECEIVER=OFF # for distributed publishers only + -DBUILD_SERVER=$(usex server) + -DINSTALL_BASH_COMPLETION=OFF + -DINSTALL_MOUNT_SCRIPTS=ON + -DINSTALL_PUBLIC_KEYS=ON + ) + + cmake_src_configure +} + +src_install() { + cmake_src_install + newbashcomp cvmfs/bash_completion/cvmfs.bash_completion cvmfs_config + bashcomp_alias cvmfs_config cvmfs_server + dodoc doc/*.md + keepdir /var/lib/cvmfs + use server && keepdir /var/lib/cvmfs-server +} + +pkg_config() { + einfo "Setting up CernVM-FS client" + cvmfs_config setup + einfo "Now edit ${EROOT}/etc/cvmfs/default.local" + einfo "and restart the autofs service" +} diff --git a/net-fs/cvmfs/cvmfs-2.13.3.ebuild b/net-fs/cvmfs/cvmfs-2.13.3.ebuild new file mode 100644 index 000000000000..587773adf58b --- /dev/null +++ b/net-fs/cvmfs/cvmfs-2.13.3.ebuild @@ -0,0 +1,103 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake linux-info bash-completion-r1 + +DESCRIPTION="HTTP read-only file system for distributing software" +HOMEPAGE="https://cernvm.cern.ch/fs/" +SRC_URI="https://ecsft.cern.ch/dist/cvmfs/${P}/source.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" + +KEYWORDS="~amd64 ~x86" +IUSE="server" + +CDEPEND=" + acct-group/cvmfs + acct-user/cvmfs + app-arch/libarchive + dev-cpp/gtest + dev-cpp/sparsehash + dev-db/sqlite:3= + dev-libs/leveldb:0= + dev-libs/openssl:0= + dev-libs/protobuf:0= + net-dns/c-ares:0= + net-libs/pacparser:0= + net-misc/curl:0[adns] + sys-apps/attr + sys-fs/fuse:0= + sys-fs/fuse:3= + sys-libs/libcap:0= + virtual/zlib:= +" + +RDEPEND="${CDEPEND} + app-admin/sudo + net-fs/autofs +" + +DEPEND="${CDEPEND} + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-2.10.1-gentoo.patch +) + +pkg_setup() { + if use server; then + CONFIG_CHECK="~OVERLAY_FS" + ERROR_AUFS_FS="CONFIG_OVERLAY_FS: is required to be set" + linux-info_pkg_setup + fi +} + +src_prepare() { + cmake_src_prepare + # gentoo stuff + sed -i -e "s:/usr/bin/systemctl:/bin/systemctl:g" \ + -e "/^INSTALL_BASE/s:=.*\$:=${EPREFIX}/usr:" \ + -e "s:/bin/pidof:/usr/bin/pidof:g" cvmfs/cvmfs_config || die + sed -i -e 's/COPYING//' -e "s:cvmfs-\${CernVM-FS_VERSION_STRING}:${PF}:" \ + CMakeLists.txt || die + eapply_user +} + +src_configure() { + local mycmakeargs=( + -DBUILTIN_EXTERNALS=OFF + -DBUILD_CVMFS=ON + -DBUILD_LIBCVMFS=OFF # static library used only for development + -DBUILD_DOCUMENTATION=OFF + -DBUILD_GEOAPI=OFF # only used for stratum 1 servers + -DBUILD_LIBCVMFS_CACHE=OFF # for exotic cache configs + -DBUILD_PRELOADER=OFF # special purpose utility for HPCs + -DBUILD_RECEIVER=OFF # for distributed publishers only + -DBUILD_SERVER=$(usex server) + -DINSTALL_BASH_COMPLETION=OFF + -DINSTALL_MOUNT_SCRIPTS=ON + -DINSTALL_PUBLIC_KEYS=ON + ) + + cmake_src_configure +} + +src_install() { + cmake_src_install + newbashcomp cvmfs/bash_completion/cvmfs.bash_completion cvmfs_config + bashcomp_alias cvmfs_config cvmfs_server + dodoc doc/*.md + keepdir /var/lib/cvmfs + use server && keepdir /var/lib/cvmfs-server +} + +pkg_config() { + einfo "Setting up CernVM-FS client" + cvmfs_config setup + einfo "Now edit ${EROOT}/etc/cvmfs/default.local" + einfo "and restart the autofs service" +} diff --git a/net-fs/cvmfs/files/cvmfs-2.10.1-gentoo.patch b/net-fs/cvmfs/files/cvmfs-2.10.1-gentoo.patch new file mode 100644 index 000000000000..d988b6e67313 --- /dev/null +++ b/net-fs/cvmfs/files/cvmfs-2.10.1-gentoo.patch @@ -0,0 +1,85 @@ + +Patch to unbundle dependencies to build in Gentoo. + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 96d509739..1b214f5a6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -337,6 +337,10 @@ endif () + find_package (OpenSSL REQUIRED) + set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${OPENSSL_INCLUDE_DIR}) + ++set(Libcrypto_LIBRARIES OpenSSL::Crypto) ++set(Libcrypto_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR}) ++add_definitions(-DLIBRESSL_VERSION_NUMBER=1) ++ + find_package (Libcrypto REQUIRED) + # We do not add the Libcrypto include directories to INCLUDE_DIRECTORIES + # to avoid a clash with the system openssl. We only use it for libcvmfs_crypto +-- + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -343,7 +343,7 @@ set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${GTEST_INCLUDE_DIRS}) + find_package (GMock REQUIRED) + set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${GMOCK_INCLUDE_DIRS}) + +-find_package (VJSON REQUIRED) ++add_subdirectory(externals/vjson) + set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${VJSON_INCLUDE_DIRS}) + + find_package (LibArchive REQUIRED) +diff --git a/externals/vjson/CMakeLists.txt b/externals/vjson/CMakeLists.txt +new file mode 100644 +index 000000000..c1f82ce03 +--- /dev/null ++++ b/externals/vjson/CMakeLists.txt +@@ -0,0 +1,8 @@ ++project(VJSON) ++ ++add_library(cvmfs_vjson STATIC src/block_allocator.cpp src/json.cpp) ++set_property(TARGET cvmfs_vjson PROPERTY POSITION_INDEPENDENT_CODE TRUE) ++target_include_directories(cvmfs_vjson PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src) ++set(VJSON_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/src PARENT_SCOPE) ++set(VJSON_LIBRARY $<TARGET_FILE:cvmfs_vjson> PARENT_SCOPE) ++set(VJSON_LIBRARIES cvmfs_vjson PARENT_SCOPE) +-- + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -356,7 +356,7 @@ if (BUILD_CVMFS OR BUILD_LIBCVMFS OR BUILD_SERVER OR BUILD_SERVER_DEBUG OR + find_package (ZLIB REQUIRED) + set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${ZLIB_INCLUDE_DIRS}) + +- find_package (SHA3 REQUIRED) ++ add_subdirectory(externals/sha3) + set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${SHA3_INCLUDE_DIRS}) + endif () + +diff --git a/externals/sha3/CMakeLists.txt b/externals/sha3/CMakeLists.txt +new file mode 100644 +index 000000000..7efa79b65 +--- /dev/null ++++ b/externals/sha3/CMakeLists.txt +@@ -0,0 +1,19 @@ ++project(SHA3) ++ ++add_library(cvmfs_sha3 STATIC ++ src/64opt/KeccakF-1600-opt64.c ++ src/KeccakHash.c ++ src/KeccakSponge.c ++ src/SnP-FBWL-default.c ++) ++ ++set_property(TARGET cvmfs_sha3 PROPERTY POSITION_INDEPENDENT_CODE TRUE) ++ ++target_include_directories(cvmfs_sha3 PUBLIC ++ ${CMAKE_CURRENT_SOURCE_DIR}/src ++ ${CMAKE_CURRENT_SOURCE_DIR}/src/64opt ++) ++ ++set(SHA3_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/64opt PARENT_SCOPE) ++set(SHA3_LIBRARY $<TARGET_FILE:cvmfs_sha3> PARENT_SCOPE) ++set(SHA3_LIBRARIES cvmfs_sha3 PARENT_SCOPE) +-- + diff --git a/net-fs/cvmfs/files/cvmfs-2.12.7-protobuf.patch b/net-fs/cvmfs/files/cvmfs-2.12.7-protobuf.patch new file mode 100644 index 000000000000..29e5dfc17234 --- /dev/null +++ b/net-fs/cvmfs/files/cvmfs-2.12.7-protobuf.patch @@ -0,0 +1,27 @@ + + Fix build with protobuf >= 30 + https://protobuf.dev/support/migration/#string_view-return-type + +--- a/cvmfs/cache_extern.cc ++++ b/cvmfs/cache_extern.cc +@@ -538,7 +538,7 @@ void *ExternalCacheManager::MainRead(void *data) { + continue; + } else { + PANIC(kLogSyslogErr | kLogDebug, "unexpected message %s", +- msg->GetTypeName().c_str()); ++ msg->GetTypeName().data()); + } + + RpcInFlight rpc_inflight; +diff --git a/cvmfs/cache_plugin/channel.cc b/cvmfs/cache_plugin/channel.cc +index 4c52d7604..e74d3aa8a 100644 +--- a/cvmfs/cache_plugin/channel.cc ++++ b/cvmfs/cache_plugin/channel.cc +@@ -550,7 +550,7 @@ bool CachePlugin::HandleRequest(int fd_con) { + } else { + LogCvmfs(kLogCache, kLogSyslogErr | kLogDebug, + "unexpected message from client: %s", +- msg_typed->GetTypeName().c_str()); ++ msg_typed->GetTypeName().data()); + return false; + } diff --git a/net-fs/cvmfs/metadata.xml b/net-fs/cvmfs/metadata.xml new file mode 100644 index 000000000000..a48d2699f689 --- /dev/null +++ b/net-fs/cvmfs/metadata.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>amadio@gentoo.org</email> + <name>Guilherme Amadio</name> + </maintainer> + <longdescription lang="en"> + The CernVM-File System (CernVM-FS) provides a scalable, reliable and low- + maintenance software distribution service. It was developed to assist High + Energy Physics (HEP) collaborations to deploy software on the worldwide- + distributed computing infrastructure used to run data processing applications. + CernVM-FS is implemented as a POSIX read-only file system in user space (a + FUSE module). Files and directories are hosted on standard web servers and + mounted in the universal namespace /cvmfs. Internally, CernVM-FS uses content- + addressable storage and Merkle trees in order to maintain file data and + meta-data. CernVM-FS uses outgoing HTTP connections only, thereby it avoids + most of the firewall issues of other network file systems. It transfers data + and meta-data on demand and verifies data integrity by cryptographic hashes. + </longdescription> + <use> + <flag name="server">Install the cvmfsd program and init script</flag> + </use> + <upstream> + <remote-id type="github">cvmfs/cvmfs</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-fs/davfs2/Manifest b/net-fs/davfs2/Manifest new file mode 100644 index 000000000000..eca8254e1459 --- /dev/null +++ b/net-fs/davfs2/Manifest @@ -0,0 +1,4 @@ +DIST davfs2-1.7.1.tar.gz 480381 BLAKE2B 7c5f38f221e2dcfb07ce335a34638b7eb4bfe4a7c500e1a3cf3b36e42df35e92d4dad1e01f4ef1e55e5e9b7eb5f87ad1f940219f4a493f41066224ac76d3304f SHA512 187a2ccd8946fbd659cbb96165fe5523c9c4f2ba855087bc0493ebce198a5ec581543576f0dd2a8e5da96c4abcc10bb83fcb3d5b573aa72bd1871a9f3914c364 +DIST davfs2-1.7.1.tar.gz.sig 566 BLAKE2B b9a2cd97fe362c3dde45bc78c70e72e84ce14995f638cf05424be981a833cc3afaddb6dd3c7baf8d56adbe55fce129508273bf84807c64a1e01dde488f0537f4 SHA512 6ad6f0bb27c7099b545b15130f63bb0520c4ba0b989ec49ea8df28f0c3d2fb59fa1c6fe4e3486033a4fdfb79ffee76f07d662ea15936fa6bc3bed206e1fdef91 +DIST davfs2-1.7.3.tar.gz 435946 BLAKE2B 1814eb3ecfb6d01e9295cc978183dfa5a463c4ce76db7ab11f9f5c74539d8409d4a4a018565ca47f4519879a40331873232f3e4e438aba2b7a832da189df3f83 SHA512 300c49bb2556c1c0dc63ffbc8b19882f480d3184fe25d8e599092a2ae194a76d206b69dbb7691c26e1ea9c7852ffb651621d30d3ef4a226f9b286d5cfcbd378c +DIST davfs2-1.7.3.tar.gz.sig 566 BLAKE2B 7b54acab1d55051b0842d6bf242fce874a80b2aadb0dc912a54e6fa515d879a40ac4db7aa98ba9d659adeae2f5ede6a662d490c885ae39a63af1c95bb7bd0878 SHA512 094edfa2c23ecef82ba880b8fecb2dabbf97ae2465cdd5d9f481671144a9117e881f4c25030e8f96741d393e44f8d1af94e4b33a485e79ae59a52fa1e9de7e6b diff --git a/net-fs/davfs2/davfs2-1.7.1.ebuild b/net-fs/davfs2/davfs2-1.7.1.ebuild new file mode 100644 index 000000000000..c3457ab3040a --- /dev/null +++ b/net-fs/davfs2/davfs2-1.7.1.ebuild @@ -0,0 +1,61 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/alisarctl.asc +inherit autotools verify-sig + +DESCRIPTION="Linux FUSE (or coda) driver that allows you to mount a WebDAV resource" +HOMEPAGE="https://savannah.nongnu.org/projects/davfs2" +SRC_URI=" + mirror://nongnu/${PN}/${P}.tar.gz + verify-sig? ( mirror://nongnu/${PN}/${P}.tar.gz.sig ) +" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="amd64 ~arm ~arm64 ppc x86" +IUSE="nls verify-sig" +RESTRICT="test" + +DEPEND=" + net-libs/neon:=" +RDEPEND=" + ${DEPEND} + acct-group/davfs2 + acct-user/davfs2 + nls? ( + virtual/libintl + virtual/libiconv + )" +BDEPEND=" + nls? ( sys-devel/gettext ) + verify-sig? ( sec-keys/openpgp-keys-alisarctl ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-1.7.1-man-page-compression.patch # backport + "${FILESDIR}"/${PN}-1.7.1-neon-version-support.patch +) + +src_prepare() { + default + eautoreconf +} + +src_configure() { + econf --enable-largefile $(use_enable nls) +} + +pkg_postinst() { + elog + elog "Quick setup:" + elog " (as root)" + elog " # gpasswd -a \${your_user} davfs2" + elog " # echo 'https://path/to/dav /home/\${your_user}/dav davfs rw,user,noauto 0 0' >> /etc/fstab" + elog " (as user)" + elog " \$ mkdir -p ~/dav" + elog " \$ mount ~/dav" + elog +} diff --git a/net-fs/davfs2/davfs2-1.7.3.ebuild b/net-fs/davfs2/davfs2-1.7.3.ebuild new file mode 100644 index 000000000000..a3024bcb2cef --- /dev/null +++ b/net-fs/davfs2/davfs2-1.7.3.ebuild @@ -0,0 +1,65 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/alisarctl.asc +inherit autotools verify-sig + +DESCRIPTION="Linux FUSE (or coda) driver that allows you to mount a WebDAV resource" +HOMEPAGE="https://github.com/alisarctl/davfs2" +SRC_URI=" + mirror://nongnu/${PN}/${P}.tar.gz + verify-sig? ( mirror://nongnu/${PN}/${P}.tar.gz.sig ) +" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~x86" +IUSE="nls verify-sig" +RESTRICT="test" + +DEPEND=" + net-libs/neon:=" +RDEPEND=" + ${DEPEND} + acct-group/davfs2 + acct-user/davfs2 + nls? ( + virtual/libintl + virtual/libiconv + )" +BDEPEND=" + nls? ( sys-devel/gettext ) + verify-sig? ( sec-keys/openpgp-keys-alisarctl ) +" + +src_prepare() { + default + + # apply the patch by sed, upstream uses meson now + # see https://github.com/alisarctl/davfs2/pull/28 + sed -i -E '/AC_CHECK_HEADERS\(\[error.h/{ + s/error\.h[[:space:]]*//g + a\ + AC_CHECK_HEADER([error.h], [AC_CHECK_FUNC([error], AC_DEFINE([HAVE_ERROR_H], [1], [Define if error.h is usable]))]) +}' configure.ac || die + + eautoreconf +} + +src_configure() { + econf --enable-largefile $(use_enable nls) +} + +pkg_postinst() { + elog + elog "Quick setup:" + elog " (as root)" + elog " # gpasswd -a \${your_user} davfs2" + elog " # echo 'https://path/to/dav /home/\${your_user}/dav davfs rw,user,noauto 0 0' >> /etc/fstab" + elog " (as user)" + elog " \$ mkdir -p ~/dav" + elog " \$ mount ~/dav" + elog +} diff --git a/net-fs/davfs2/files/davfs2-1.7.1-man-page-compression.patch b/net-fs/davfs2/files/davfs2-1.7.1-man-page-compression.patch new file mode 100644 index 000000000000..a6992f67c3cf --- /dev/null +++ b/net-fs/davfs2/files/davfs2-1.7.1-man-page-compression.patch @@ -0,0 +1,75 @@ +https://github.com/alisarctl/davfs2/pull/1 + +From 789656d8c8144d4781795658524b3f8b15fb0d11 Mon Sep 17 00:00:00 2001 +From: David Seifert <soap@gentoo.org> +Date: Wed, 20 Nov 2024 19:49:53 +0100 +Subject: [PATCH] Do not compress manpages + +* In general, manpage compression should be left to packagers. +--- + man/Makefile.am | 7 ++----- + man/de/Makefile.am | 7 ++----- + man/es/Makefile.am | 5 +---- + 3 files changed, 5 insertions(+), 14 deletions(-) + +diff --git a/man/Makefile.am b/man/Makefile.am +index ea10e83..d1f34db 100644 +--- a/man/Makefile.am ++++ b/man/Makefile.am +@@ -42,13 +42,10 @@ edit = sed \ + -e 's|@USER[@]|$(dav_user)|g' \ + -e 's|@GROUP[@]|$(dav_group)|g' + +-manual5_DATA = davfs2.conf.5.gz +-manual8_DATA = mount.davfs.8.gz umount.davfs.8.gz ++manual5_DATA = davfs2.conf.5 ++manual8_DATA = mount.davfs.8 umount.davfs.8 + + EXTRA_DIST = davfs2.conf.5 mount.davfs.8 umount.davfs.8 \ + davfs2.conf.5.pot mount.davfs.8.pot umount.davfs.8.pot \ + po4a.conf template.translator + CLEANFILES = $(manual5_DATA) $(manual8_DATA) +- +-%.gz: % +- $(edit) $< | gzip -9 > $@ +diff --git a/man/de/Makefile.am b/man/de/Makefile.am +index 6965857..8489c9f 100644 +--- a/man/de/Makefile.am ++++ b/man/de/Makefile.am +@@ -40,14 +40,11 @@ edit = sed \ + -e 's|@USER[@]|$(dav_user)|g' \ + -e 's|@GROUP[@]|$(dav_group)|g' + +-manual5_DATA = davfs2.conf.5.gz +-manual8_DATA = mount.davfs.8.gz umount.davfs.8.gz ++manual5_DATA = davfs2.conf.5 ++manual8_DATA = mount.davfs.8 umount.davfs.8 + + EXTRA_DIST = davfs2.conf.5 mount.davfs.8 umount.davfs.8 \ + davfs2.conf.5.po mount.davfs.8.po umount.davfs.8.po \ + davfs2.conf.5.translator mount.davfs.8.translator \ + umount.davfs.8.translator + CLEANFILES = $(manual5_DATA) $(manual8_DATA) +- +-%.gz: % +- $(edit) $< | gzip -9 > $@ +diff --git a/man/es/Makefile.am b/man/es/Makefile.am +index 4a427b6..2ccf0d8 100644 +--- a/man/es/Makefile.am ++++ b/man/es/Makefile.am +@@ -40,7 +40,7 @@ edit = sed \ + -e 's|@USER[@]|$(dav_user)|g' \ + -e 's|@GROUP[@]|$(dav_group)|g' + +-manual5_DATA = davfs2.conf.5.gz ++manual5_DATA = davfs2.conf.5 + #manual8_DATA = mount.davfs.8.gz umount.davfs.8.gz + + #EXTRA_DIST = davfs2.conf.5 mount.davfs.8 umount.davfs.8 \ +@@ -49,6 +49,3 @@ manual5_DATA = davfs2.conf.5.gz + # umount.davfs.8.translator + EXTRA_DIST = davfs2.conf.5 davfs2.conf.5.po + CLEANFILES = $(manual5_DATA) $(manual8_DATA) +- +-%.gz: % +- $(edit) $< | gzip -9 > $@ diff --git a/net-fs/davfs2/files/davfs2-1.7.1-neon-version-support.patch b/net-fs/davfs2/files/davfs2-1.7.1-neon-version-support.patch new file mode 100644 index 000000000000..e4c3aaaa9b3e --- /dev/null +++ b/net-fs/davfs2/files/davfs2-1.7.1-neon-version-support.patch @@ -0,0 +1,11 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -37,7 +37,7 @@ + # Checks for libraries. + AM_GNU_GETTEXT_VERSION(0.19.8) + AM_GNU_GETTEXT([external]) +-NE_REQUIRE_VERSIONS([0], [27 28 29 30 31 32 33]) ++NE_REQUIRE_VERSIONS([0], [27 28 29 30 31 32 33 34]) + DAV_CHECK_NEON + + # Checks for header files. diff --git a/net-fs/davfs2/metadata.xml b/net-fs/davfs2/metadata.xml new file mode 100644 index 000000000000..84e0ef13479b --- /dev/null +++ b/net-fs/davfs2/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person" proxied="yes"> + <email>zhixu.liu@gmail.com</email> + <name>Z. Liu</name> + </maintainer> + <maintainer type="project" proxied="proxy"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <upstream> + <remote-id type="savannah-nongnu">davfs2</remote-id> + <remote-id type="github">alisarctl/davfs2</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-fs/httpdirfs/Manifest b/net-fs/httpdirfs/Manifest new file mode 100644 index 000000000000..9a51f4d4d3fa --- /dev/null +++ b/net-fs/httpdirfs/Manifest @@ -0,0 +1 @@ +DIST httpdirfs-1.2.7.tar.gz 81749 BLAKE2B 41c7506e139b098ca00fed03318d7b4cc17c152992644c489a7dd58818ed64a99084b271fee8756b4a1bda355b32cb5b0e37819bb7b7cc1958fc8fd7c6d87f68 SHA512 75765347a2e0284eb16e088d605dc53b6d748c3f7aca7aa1cf5d96d13f5ae6460d5596aa13cbe80e5da525aa792e4d2eb0232f49ae49b78ba300448023a771e4 diff --git a/net-fs/httpdirfs/httpdirfs-1.2.7.ebuild b/net-fs/httpdirfs/httpdirfs-1.2.7.ebuild new file mode 100644 index 000000000000..dad9319e21b2 --- /dev/null +++ b/net-fs/httpdirfs/httpdirfs-1.2.7.ebuild @@ -0,0 +1,25 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit meson + +DESCRIPTION="Filesystem to mount HTTP directory listings, with a permanent cache" +HOMEPAGE="https://github.com/fangfufu/httpdirfs" +SRC_URI="https://github.com/fangfufu/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~amd64" + +DEPEND=" + dev-libs/expat + dev-libs/gumbo:= + dev-libs/openssl:= + net-misc/curl + sys-apps/util-linux + sys-fs/fuse:3 +" +RDEPEND="${DEPEND}" +BDEPEND="sys-apps/help2man" diff --git a/net-fs/httpdirfs/metadata.xml b/net-fs/httpdirfs/metadata.xml new file mode 100644 index 000000000000..9c84739e6cb8 --- /dev/null +++ b/net-fs/httpdirfs/metadata.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <!-- maintainer-needed --> + <upstream> + <remote-id type="github">fangfufu/httpdirfs</remote-id> + </upstream> + <longdescription lang="en"> + A filesystem which allows you to mount HTTP directory listings, with a permanent cache. + Now with Airsonic / Subsonic support! + Have you ever wanted to mount those HTTP directory listings as if it was a partition? + Look no further, this is your solution. + HTTPDirFS stands for Hyper Text Transfer Protocol Directory Filesystem. + The performance of the program is excellent. + HTTP connections are reused due to the use of curl-multi interface. + The FUSE component runs in multithreaded mode. + There is a permanent cache system which can cache all the file segments you have downloaded, + so you don't need to these segments again if you access them later. + This feature is triggered by the --cache flag. + This makes this filesystem much faster than rclone mount. + The support for Airsonic / Subsonic server has also been added. + This allows you to mount a remote music collection locally. + </longdescription> +</pkgmetadata> diff --git a/net-fs/ksmbd-tools/Manifest b/net-fs/ksmbd-tools/Manifest new file mode 100644 index 000000000000..b50d2e3d6720 --- /dev/null +++ b/net-fs/ksmbd-tools/Manifest @@ -0,0 +1,2 @@ +DIST ksmbd-tools-3.5.3.tar.gz 464499 BLAKE2B 3810a8af5528bfa56274fdc31386d07f28cd3762191df3343beb411974ee623f3b225d780955512aee64c0ae34f97a6bca4b3fef4c15f46d651e154fcf79b88f SHA512 aa3331dba8fc4b970a38e23d1569e9ec5bd8bba9cf6cf0d0b1618f0b0cd28fc1fc3d0c0446f9f628e38762a273b0d09050fbe331a79e06af986733ad6ec6d9a2 +DIST ksmbd-tools-3.5.6.tar.gz 465352 BLAKE2B 1b7a81cc0960717f622e191d5ff8b7cfe80c4d750af6d1f753023596147be43af59b974c75294e2c4f84f2084d381e8a509e224994709c715d46d665e1edc811 SHA512 78e59a08b95d38dcf24045d5e3185861a090d4a6f2ac3b4bcef9e27f2239469a5f1fbc9cefe57ed4cea7157c5c04e0610457638f61b08a84805028c59fcb1f8c diff --git a/net-fs/ksmbd-tools/files/ksmbd-tools-3.5.6-systemd-network-online.patch b/net-fs/ksmbd-tools/files/ksmbd-tools-3.5.6-systemd-network-online.patch new file mode 100644 index 000000000000..1b9b74dc3a64 --- /dev/null +++ b/net-fs/ksmbd-tools/files/ksmbd-tools-3.5.6-systemd-network-online.patch @@ -0,0 +1,33 @@ +From 5d33b8871420e4ad8754931177ce935c38bd5323 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert <floppym@gentoo.org> +Date: Thu, 2 Apr 2026 15:04:17 -0400 +Subject: [PATCH] ksmbd.service: remove network-online.target dependency + +The network does not need to be fully online to start a deamon that +listens on the wildcard address. + +If the admin alters the default configuratin to listen on specific +interfaces or addresses, they can alter the systemd unit accordingly. + +Signed-off-by: Mike Gilbert <floppym@gentoo.org> +--- + ksmbd.service.in | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/ksmbd.service.in b/ksmbd.service.in +index 280dce84ce99..8ce47d80c4e4 100644 +--- a/ksmbd.service.in ++++ b/ksmbd.service.in +@@ -1,8 +1,7 @@ + [Unit] + Description=ksmbd userspace daemon + Requires=modprobe@ksmbd.service +-Wants=network-online.target +-After=modprobe@ksmbd.service network.target network-online.target ++After=modprobe@ksmbd.service network.target + + [Service] + Type=forking +-- +2.53.0 + diff --git a/net-fs/ksmbd-tools/files/ksmbd.confd b/net-fs/ksmbd-tools/files/ksmbd.confd new file mode 100644 index 000000000000..cc014a04559d --- /dev/null +++ b/net-fs/ksmbd-tools/files/ksmbd.confd @@ -0,0 +1,8 @@ +# /etc/conf.d/ksmbd: config file for /etc/init.d/ksmbd +# + +# Full path to config file. /etc/ksmbd/ksmbd.conf is default if not set. +#KSMBD_CONF="/etc/ksmbd/ksmbd.conf" + +# Extra options to pass to ksmbd.mountd(8) at startup +#KSMBD_OPTS="" diff --git a/net-fs/ksmbd-tools/files/ksmbd.initd-r1 b/net-fs/ksmbd-tools/files/ksmbd.initd-r1 new file mode 100644 index 000000000000..82375f1ad8d3 --- /dev/null +++ b/net-fs/ksmbd-tools/files/ksmbd.initd-r1 @@ -0,0 +1,41 @@ +#!/sbin/openrc-run +# Copyright 2021-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +KSMBD_CONF="${KSMBD_CONF:-/etc/ksmbd/ksmbd.conf}" +KSMBD_OPTS="${KSMBD_OPTS:-}" + +depend() { + need localmount + use net +} + +description="ksmbd userspace daemon" + +command="/usr/sbin/ksmbd.mountd" +command_control="/usr/sbin/ksmbd.control" +command_args="--config=${KSMBD_CONF} ${KSMBD_OPTS}" + +extra_started_commands="reload" + +required_files="${KSMBD_CONF}" + +reload() { + ebegin "Reloading ${RC_SVCNAME}" + "${command_control}" --reload + eend $? +} + +start_pre() { + /sbin/modprobe -q ksmbd || return 0 +} + +stop() { + ebegin "Stopping ${RC_SVCNAME}" + "${command_control}" --shutdown + eend $? +} + +stop_post() { + /sbin/modprobe -r -q ksmbd || return 0 +} diff --git a/net-fs/ksmbd-tools/ksmbd-tools-3.5.3.ebuild b/net-fs/ksmbd-tools/ksmbd-tools-3.5.3.ebuild new file mode 100644 index 000000000000..d9390a74cd5f --- /dev/null +++ b/net-fs/ksmbd-tools/ksmbd-tools-3.5.3.ebuild @@ -0,0 +1,66 @@ +# Copyright 2022-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit eapi9-ver linux-info meson systemd + +DESCRIPTION="cifsd/ksmbd kernel server userspace utilities" +HOMEPAGE="https://github.com/cifsd-team/ksmbd-tools" +SRC_URI="https://github.com/cifsd-team/ksmbd-tools/releases/download/${PV}/${P}.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv" + +DEPEND=" + dev-libs/glib:2 + dev-libs/libnl:3 +" + +RDEPEND="${DEPEND}" +BDEPEND="virtual/pkgconfig" + +pkg_setup() { + # we don't want to die() here to be able to build binpkgs + kernel_is -lt 5 15 && eerror "kernel >= 5.15 required for ${PN}" + CONFIG_CHECK="~SMB_SERVER" + ERROR_SMB_SERVER="CONFIG_SMB_SERVER is not set: ksmbd is not enabled in kernel, ${PN} will not work" + # use krb5 && CONFIG_CHECK+=" ~SMB_SERVER_KERBEROS5" + linux-info_pkg_setup +} + +src_configure() { + local emesonargs=( + -Drundir="${EPREFIX}"/run + -Dsystemdsystemunitdir="$(systemd_get_systemunitdir)" + # TODO: add kerberos support, explicitly disable for now + -Dkrb5=disabled + ) + + meson_src_configure +} + +src_install() { + meson_src_install + + local DOCS=( README.md ksmbd.conf.example ) + einstalldocs + + insinto /etc/ksmbd + doins ksmbd.conf.example + + newinitd "${FILESDIR}/ksmbd.initd-r1" ksmbd + newconfd "${FILESDIR}/ksmbd.confd" ksmbd + + dosym ksmbd.addshare /usr/sbin/smbshareadd + dosym ksmbd.adduser /usr/sbin/smbuseradd +} + +pkg_postinst() { + if ver_replacing -lt 3.4.6; then + ewarn "Upgrade from version <${CATEGORY}/${PN}-3.4.6 detected" + ewarn "${PN} config file moved to ${EPREFIX}/etc/ksmbd/ksmbd.conf" + ewarn "Please migrate from old ${EPREFIX}/etc/ksmbd/smb.conf" + fi +} diff --git a/net-fs/ksmbd-tools/ksmbd-tools-3.5.6.ebuild b/net-fs/ksmbd-tools/ksmbd-tools-3.5.6.ebuild new file mode 100644 index 000000000000..1292ee49aac9 --- /dev/null +++ b/net-fs/ksmbd-tools/ksmbd-tools-3.5.6.ebuild @@ -0,0 +1,57 @@ +# Copyright 2022-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit linux-info meson systemd + +DESCRIPTION="cifsd/ksmbd kernel server userspace utilities" +HOMEPAGE="https://github.com/cifsd-team/ksmbd-tools" +SRC_URI="https://github.com/cifsd-team/ksmbd-tools/releases/download/${PV}/${P}.tar.gz" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv" +IUSE="kerberos" + +DEPEND=" + >=dev-libs/glib-2.58:2 + dev-libs/libnl:3 + kerberos? ( virtual/krb5 ) +" + +RDEPEND="${DEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}/ksmbd-tools-3.5.6-systemd-network-online.patch" +) + +pkg_setup() { + # we don't want to die() here to be able to build binpkgs + kernel_is -lt 5 15 && eerror "kernel >= 5.15 required for ${PN}" + CONFIG_CHECK="~SMB_SERVER" + ERROR_SMB_SERVER="CONFIG_SMB_SERVER is not set: ksmbd is not enabled in kernel, ${PN} will not work" + use kerberos && CONFIG_CHECK+=" ~SMB_SERVER_KERBEROS5" + linux-info_pkg_setup +} + +src_configure() { + local emesonargs=( + -Drundir="${EPREFIX}"/run + -Dsystemdsystemunitdir="$(systemd_get_systemunitdir)" + $(meson_feature kerberos krb5) + ) + + meson_src_configure +} + +src_install() { + meson_src_install + + local DOCS=( README.md ksmbd.conf.example ) + einstalldocs + + newinitd "${FILESDIR}/ksmbd.initd-r1" ksmbd + newconfd "${FILESDIR}/ksmbd.confd" ksmbd +} diff --git a/net-fs/ksmbd-tools/metadata.xml b/net-fs/ksmbd-tools/metadata.xml new file mode 100644 index 000000000000..95fefc230460 --- /dev/null +++ b/net-fs/ksmbd-tools/metadata.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>floppym@gentoo.org</email> + <name>Mike Gilbert</name> + </maintainer> + <upstream> + <remote-id type="github">cifsd-team/ksmbd-tools</remote-id> + </upstream> + <longdescription lang="en"> + KSMBD is a linux kernel server which implements SMB3 protocol in kernel space for sharing files over network. + ksmbd.mountd is userspace process to transfer user account and password that are registered using ksmbd.adduser (part of this package). + Further it allows sharing information parameters that parsed from smb.conf to ksmbd in kernel. + </longdescription> +</pkgmetadata> diff --git a/net-fs/libnfs/Manifest b/net-fs/libnfs/Manifest new file mode 100644 index 000000000000..d846fae3408c --- /dev/null +++ b/net-fs/libnfs/Manifest @@ -0,0 +1,2 @@ +DIST libnfs-5.0.2.tar.gz 281154 BLAKE2B 9de3d02e5ae4d41eacda152678e6552708b33d4e88cc6fc5f7b16c887f911fc5a5e834952505438220c961f71a8b70540be3254d5889a4336200d5633dce313e SHA512 6dcf4ea8a01b35beb53694625d20fbebd858a88725c2742671878ad6fe7877999f93d262fb58a435b00c283c3e6fb6fa7222d04bb4540bf674b7ce196e9424f5 +DIST libnfs-5.0.3.tar.gz 291079 BLAKE2B 4ce19c317bfd47110d9f42bb2dfb27bfba90bb9a11d1c3c5d63ce1188db3a08a97ffa82a31b0de04e59f41c570eef1eff96e80390ee78b0267e2a89d032c9c9c SHA512 1581c4a599e7b2a837553df2a4e1e4255a726907cd54ce3e82b0b725c79e2fd15d7ed921dbe9519d73204f5ca735d27b347888d3f1162c4c2144e9d72e327ff1 diff --git a/net-fs/libnfs/libnfs-5.0.2.ebuild b/net-fs/libnfs/libnfs-5.0.2.ebuild new file mode 100644 index 000000000000..ad0a7e94d965 --- /dev/null +++ b/net-fs/libnfs/libnfs-5.0.2.ebuild @@ -0,0 +1,57 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://github.com/sahlberg/${PN}.git" + inherit git-r3 +else + SRC_URI="https://github.com/sahlberg/${PN}/archive/${P}.tar.gz" + KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 x86" + S="${WORKDIR}"/${PN}-${P} +fi + +DESCRIPTION="Client library for accessing NFS shares over a network" +HOMEPAGE="https://github.com/sahlberg/libnfs" + +LICENSE="LGPL-2.1 GPL-3" +SLOT="0/14" # sub-slot matches SONAME major +IUSE="examples static-libs utils" + +# net-libs/rpcsvc-proto for rpcgen called in build system +BDEPEND="net-libs/rpcsvc-proto + virtual/pkgconfig" + +src_prepare() { + default + + eautoreconf +} + +src_configure() { + local myeconfargs=( + --disable-werror + $(use_enable static-libs static) + $(use_enable utils) + ) + + econf "${myeconfargs[@]}" +} + +src_install() { + default + + if use examples; then + # --enable-examples configure switch just compiles them + # better install sources instead + exeinto /usr/share/doc/${PF}/examples/ + for program in $(grep PROGRAMS examples/Makefile.am | cut -d= -f2); do + doexe examples/${program}.c + done + fi + + find "${ED}" -name "*.la" -delete || die +} diff --git a/net-fs/libnfs/libnfs-5.0.3.ebuild b/net-fs/libnfs/libnfs-5.0.3.ebuild new file mode 100644 index 000000000000..fdbc53bdb293 --- /dev/null +++ b/net-fs/libnfs/libnfs-5.0.3.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://github.com/sahlberg/${PN}.git" + inherit git-r3 +else + SRC_URI="https://github.com/sahlberg/${PN}/archive/${P}.tar.gz" + KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 x86" + S="${WORKDIR}"/${PN}-${P} +fi + +DESCRIPTION="Client library for accessing NFS shares over a network" +HOMEPAGE="https://github.com/sahlberg/libnfs" + +LICENSE="LGPL-2.1 GPL-3" +SLOT="0/14" # sub-slot matches SONAME major +IUSE="examples static-libs utils" + +# net-libs/rpcsvc-proto for rpcgen called in build system +BDEPEND=" + net-libs/rpcsvc-proto + virtual/pkgconfig +" + +src_prepare() { + default + + eautoreconf +} + +src_configure() { + local myeconfargs=( + --disable-werror + $(use_enable static-libs static) + $(use_enable utils) + ) + + econf "${myeconfargs[@]}" +} + +src_install() { + default + + if use examples; then + # --enable-examples configure switch just compiles them + # better install sources instead + exeinto /usr/share/doc/${PF}/examples/ + for program in $(grep PROGRAMS examples/Makefile.am | cut -d= -f2); do + doexe examples/${program}.c + done + fi + + find "${ED}" -name "*.la" -delete || die +} diff --git a/net-fs/libnfs/libnfs-9999.ebuild b/net-fs/libnfs/libnfs-9999.ebuild new file mode 100644 index 000000000000..954d8da6cd2d --- /dev/null +++ b/net-fs/libnfs/libnfs-9999.ebuild @@ -0,0 +1,57 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools + +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://github.com/sahlberg/${PN}.git" + inherit git-r3 +else + SRC_URI="https://github.com/sahlberg/${PN}/archive/${P}.tar.gz" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~x86" + S="${WORKDIR}"/${PN}-${P} +fi + +DESCRIPTION="Client library for accessing NFS shares over a network" +HOMEPAGE="https://github.com/sahlberg/libnfs" + +LICENSE="LGPL-2.1 GPL-3" +SLOT="0/14" # sub-slot matches SONAME major +IUSE="examples static-libs utils" + +# net-libs/rpcsvc-proto for rpcgen called in build system +BDEPEND="net-libs/rpcsvc-proto + virtual/pkgconfig" + +src_prepare() { + default + + eautoreconf +} + +src_configure() { + local myeconfargs=( + --disable-werror + $(use_enable static-libs static) + $(use_enable utils) + ) + + econf "${myeconfargs[@]}" +} + +src_install() { + default + + if use examples; then + # --enable-examples configure switch just compiles them + # better install sources instead + exeinto /usr/share/doc/${PF}/examples/ + for program in $(grep PROGRAMS examples/Makefile.am | cut -d= -f2); do + doexe examples/${program}.c + done + fi + + find "${ED}" -name "*.la" -delete || die +} diff --git a/net-fs/libnfs/metadata.xml b/net-fs/libnfs/metadata.xml new file mode 100644 index 000000000000..bf9e0ef24654 --- /dev/null +++ b/net-fs/libnfs/metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>base-system@gentoo.org</email> + <name>Gentoo Base System</name> + </maintainer> + <use> + <flag name="utils">Build/install nfs-{cat,ls,cp} utils</flag> + </use> + <upstream> + <remote-id type="github">sahlberg/libnfs</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-fs/mc/Manifest b/net-fs/mc/Manifest new file mode 100644 index 000000000000..176d3570112a --- /dev/null +++ b/net-fs/mc/Manifest @@ -0,0 +1,4 @@ +DIST mc-2025.07.21.05.28.08-vendor.tar.xz 4665728 BLAKE2B e622d7f4ba7dec1b996dd23acf8e69c061ba0cb95d54cde4dc7d4f1dd2cefe3f0928fe2b50a35e2797f917015b2fab460db167257a012383ee562e04be53a297 SHA512 baf16d5e6f43f535e8f00e9e9b4939bb5201e09a6de15307e5b1b18d2d6bf2e80521ad79882bad3fa58ea6639a3ba696a7dbe742cfb37dc863a15a5eaab4a33f +DIST mc-2025.07.21.05.28.08.tar.gz 563585 BLAKE2B 599df8801cff77d9eafc073b11d5d27349f191b17a9c37813b1a33d0c6c37de3ecb5a5e4e91bd7e831ace61ecdddfd0a21d8f12f7cb54470a769de3c1251ee3f SHA512 f159a8bae6a1e342f58b983c3c69471e94de4dffc87225898e114eb8fb3654e2ea0616ecbb96245f4e2dad612b296a696b3249b20faafe66e708d96694244ce6 +DIST mc-2025.08.13.08.35.41-vendor.tar.xz 4686384 BLAKE2B 0a6446715461fd93e4028ee26641cf477e181406521b1c2a71a5db8383eb66150e0edcd5f1746718f586acf606cb4d45efd20166058922b91e9e19be57d75585 SHA512 0a9b53456052655020373e797ec1f2ddfecf6884b93a8d12c1aa246320f8b1cc0459287474a7a71e5f97a55e11d97a0afeff93a43bcfa11a631553142be91fa8 +DIST mc-2025.08.13.08.35.41.tar.gz 564218 BLAKE2B b1a6eb525ffad9a57ef515b093eabc002cde680bf67bd780db4fb258b31ea8bbc529e702d8dbe556ff0169b9d89d2efa64afab862696513e5235d30ffd7e4dd4 SHA512 e54fbcf7ef0f718a6356ff591dec3bb4bd58603622ade99b7adcead66dce0ff5d36a07b20ee6b99d5c4ecc540d0b9a32293d82e5767e60f98635a7471436af97 diff --git a/net-fs/mc/mc-2025.07.21.05.28.08.ebuild b/net-fs/mc/mc-2025.07.21.05.28.08.ebuild new file mode 100644 index 000000000000..f834159a9ef9 --- /dev/null +++ b/net-fs/mc/mc-2025.07.21.05.28.08.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit go-module + +MY_PV="$(ver_cut 1-3)T$(ver_cut 4-7)Z" +MY_PV=${MY_PV//./-} +YEAR="$(ver_cut 1)" +COMMIT_ID="ee72571936f15b0e65dc8b4a231a4dd445e5ccb6" + +DESCRIPTION="Minio client provides alternatives for ls, cat on cloud storage and filesystems" +HOMEPAGE="https://github.com/minio/mc" +SRC_URI="https://github.com/minio/mc/archive/RELEASE.${MY_PV}.tar.gz -> ${P}.tar.gz" +SRC_URI+=" https://github.com/gentoo-zh/gentoo-deps/releases/download/${P}/${P}-vendor.tar.xz" + +S="${WORKDIR}/${PN}-RELEASE.${MY_PV}" +LICENSE="Apache-2.0 BSD MIT MPL-2.0" +SLOT="0" +KEYWORDS="amd64" +RESTRICT="test" # bug #927667, fails with network-sandbox + +src_compile() { + # go run buildscripts/gen-ldflags.go + local ldflags=" \ + -X github.com/minio/mc/cmd.Version=${MY_PV} \ + -X github.com/minio/mc/cmd.CopyrightYear=${YEAR} \ + -X github.com/minio/mc/cmd.ReleaseTag=RELEASE.${MY_PV} \ + -X github.com/minio/mc/cmd.CommitID=${COMMIT_ID}" + ego build -trimpath --ldflags "${ldflags}" +} + +src_install() { + newbin mc minio-client + dodoc README.md CONTRIBUTING.md +} diff --git a/net-fs/mc/mc-2025.08.13.08.35.41.ebuild b/net-fs/mc/mc-2025.08.13.08.35.41.ebuild new file mode 100644 index 000000000000..1afda4bfce3a --- /dev/null +++ b/net-fs/mc/mc-2025.08.13.08.35.41.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit go-module + +MY_PV="$(ver_cut 1-3)T$(ver_cut 4-7)Z" +MY_PV=${MY_PV//./-} +YEAR="$(ver_cut 1)" +COMMIT_ID="7394ce0dd2a80935aded936b09fa12cbb3cb8096" + +DESCRIPTION="Minio client provides alternatives for ls, cat on cloud storage and filesystems" +HOMEPAGE="https://github.com/minio/mc" +SRC_URI="https://github.com/minio/mc/archive/RELEASE.${MY_PV}.tar.gz -> ${P}.tar.gz" +SRC_URI+=" https://github.com/gentoo-zh/gentoo-deps/releases/download/${P}/${P}-vendor.tar.xz" + +S="${WORKDIR}/${PN}-RELEASE.${MY_PV}" +LICENSE="Apache-2.0 BSD MIT MPL-2.0" +SLOT="0" +KEYWORDS="amd64" +RESTRICT="test" # bug #927667, fails with network-sandbox + +src_compile() { + # go run buildscripts/gen-ldflags.go + local ldflags=" \ + -X github.com/minio/mc/cmd.Version=${MY_PV} \ + -X github.com/minio/mc/cmd.CopyrightYear=${YEAR} \ + -X github.com/minio/mc/cmd.ReleaseTag=RELEASE.${MY_PV} \ + -X github.com/minio/mc/cmd.CommitID=${COMMIT_ID}" + ego build -trimpath --ldflags "${ldflags}" +} + +src_install() { + newbin mc minio-client + dodoc README.md CONTRIBUTING.md +} diff --git a/net-fs/mc/metadata.xml b/net-fs/mc/metadata.xml new file mode 100644 index 000000000000..8403a0702907 --- /dev/null +++ b/net-fs/mc/metadata.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person" proxied="yes"> + <email>peeweep@0x0.ee</email> + <name>jinqiang zhang</name> + </maintainer> + <maintainer type="project" proxied="proxy"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <upstream> + <remote-id type="github">minio/mc</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-fs/metadata.xml b/net-fs/metadata.xml new file mode 100644 index 000000000000..688c254b3bce --- /dev/null +++ b/net-fs/metadata.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE catmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<catmetadata> + <longdescription lang="en"> + The net-fs category contains network filesystem packages. + </longdescription> + <longdescription lang="de"> + Die Kategorie net-fs enthült Netzwerkdateisysteme. + </longdescription> + <longdescription lang="es"> + La categoría net-fs contiene paquetes de sistemas de ficheros en red. + </longdescription> + <longdescription lang="ja"> + net-fsカテゴリーにはネットワーク・ファイルシステムのパッケージが含まれています。 + </longdescription> + <longdescription lang="nl"> + De net-fs categorie bevat netwerk-bestandssystemen. + </longdescription> + <longdescription lang="vi"> + Nhóm net-fs chứa các gói hệ tập tin mạng. + </longdescription> + <longdescription lang="it"> + La categoria net-fs contiene pacchetti per i filesystem di rete. + </longdescription> + <longdescription lang="pt"> + A categoria net-fs contém pacotes para sistemas de arquivos de + rede. + </longdescription> + <longdescription lang="pl"> + Kategoria net-fs zawiera pakiety związane z NFS, sieciowym systemem + plików. + </longdescription> +</catmetadata> diff --git a/net-fs/netatalk/Manifest b/net-fs/netatalk/Manifest new file mode 100644 index 000000000000..fed37e954ab4 --- /dev/null +++ b/net-fs/netatalk/Manifest @@ -0,0 +1 @@ +DIST netatalk-3.1.18.tar.xz 974852 BLAKE2B ba69e0bc08455dff46d8aa83fa1a2eda6eac60a0ab7a1b22bba8c47abb57ac70bd2879ec496c5e5f3da40a461e93fcecdf7c3e489daff18e995961f59d4fdc99 SHA512 06c56754afacbf9c71dc2ab7b80c231f5c25f522967e1d825b4e9e129233528bd1e7101144239b52636b9efe7f1f86a37749da8a8af611169155bca9711798d0 diff --git a/net-fs/netatalk/files/netatalk-3.1.17-disable-ld-library-path.patch b/net-fs/netatalk/files/netatalk-3.1.17-disable-ld-library-path.patch new file mode 100644 index 000000000000..21cb119994fc --- /dev/null +++ b/net-fs/netatalk/files/netatalk-3.1.17-disable-ld-library-path.patch @@ -0,0 +1,34 @@ +there's no need to set LD_LIBRARY_PATH in order to perform link tests, and +it's actually undesirable as it'll cause the toolchain to search a different +path than the ones it's configured to (host lib wise). + +https://bugs.gentoo.org/564350 + +--- a/macros/db3-check.m4 ++++ b/macros/db3-check.m4 +@@ -142,15 +142,7 @@ if test "x$bdb_required" = "xyes"; then + CPPFLAGS="-I${bdbdir}/include${subdir} $CPPFLAGS" + LDFLAGS="-L$bdblibdir $LDFLAGS" + +- dnl -- Uses version set by NETATALK_BDB_HEADER to try to run +- dnl -- a conftest that checks that header/lib version match +- dnl -- $shlibpath_var is set by LIBTOOL, its value is +- dnl -- LD_LIBRARY_PATH on many platforms. This will be fairly +- dnl -- portable hopefully. Reference: +- dnl -- http://lists.gnu.org/archive/html/autoconf/2009-03/msg00040.html +- test "$cross_compiling" = yes || eval export $shlibpath_var=$bdblibdir + NETATALK_BDB_TRY_LINK +- eval export $shlibpath_var=$saved_shlibpath_var + + if test x"${atalk_cv_bdb_version}" = x"yes"; then + BDB_CFLAGS="-I${bdbdir}/include${subdir}" +@@ -174,9 +166,7 @@ if test "x$bdb_required" = "xyes"; then + CPPFLAGS="-I${bdbdir}/include${subdir} $CPPFLAGS" + LDFLAGS="-L$bdblibdir $LDFLAGS" + +- test "$cross_compiling" = yes || eval export $shlibpath_var=$bdblibdir + NETATALK_BDB_TRY_LINK +- eval export $shlibpath_var=$saved_shlibpath_var + + if test x"${atalk_cv_bdb_version}" = x"yes"; then + BDB_CFLAGS="-I${bdbdir}/include${subdir}" diff --git a/net-fs/netatalk/files/netatalk-3.1.17-gentoo.patch b/net-fs/netatalk/files/netatalk-3.1.17-gentoo.patch new file mode 100644 index 000000000000..eada14a0d28e --- /dev/null +++ b/net-fs/netatalk/files/netatalk-3.1.17-gentoo.patch @@ -0,0 +1,112 @@ + Makefile.am | 6 ------ + etc/netatalk/Makefile.am | 5 +++-- + etc/netatalk/afp_avahi.c | 2 +- + etc/uams/Makefile.am | 20 ++++++++++---------- + libatalk/dsi/Makefile.am | 3 ++- + libatalk/vfs/Makefile.am | 1 + + macros/netatalk.m4 | 1 - + 7 files changed, 17 insertions(+), 21 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index ec7f14d..b87fd8a 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -11,9 +11,3 @@ EXTRA_DIST = CONTRIBUTORS COPYRIGHT COPYING NEWS VERSION abigen.sh + ACLOCAL_AMFLAGS = -I macros + AUTOMAKE_OPTIONS = foreign + +-if RUN_LDCONFIG +-install-exec-hook: +- @printf "Running ldconfig to ensure libraries installed in system library directories are added to the dynamic linker cache ... " +- @-@NETA_LDCONFIG@ +- @printf "done\n" +-endif +diff --git a/etc/netatalk/Makefile.am b/etc/netatalk/Makefile.am +index 5392b9d..3e62e2d 100644 +--- a/etc/netatalk/Makefile.am ++++ b/etc/netatalk/Makefile.am +@@ -27,6 +28,5 @@ netatalk_CFLAGS += \ + +-netatalk_LDFLAGS = @LIBEVENT_LDFLAGS@ -levent +- +-netatalk_CFLAGS += @LIBEVENT_CFLAGS@ ++netatalk_CPPFLAGS = @LIBEVENT_CFLAGS@ ++netatalk_LDADD += @LIBEVENT_LDFLAGS@ -levent + + noinst_HEADERS = afp_zeroconf.h afp_avahi.h afp_mdns.h +diff --git a/etc/netatalk/afp_avahi.c b/etc/netatalk/afp_avahi.c +index d6b55dc..dade1e0 100644 +--- a/etc/netatalk/afp_avahi.c ++++ b/etc/netatalk/afp_avahi.c +@@ -164,8 +164,8 @@ static void register_stuff(void) { + return; + + fail: +- time(NULL); + // avahi_threaded_poll_quit(ctx->threaded_poll); ++ return; + } + + /* Called when publishing of service data completes */ +diff --git a/etc/uams/Makefile.am b/etc/uams/Makefile.am +index 23fd3d1..0e882ea 100644 +--- a/etc/uams/Makefile.am ++++ b/etc/uams/Makefile.am +@@ -95,16 +95,16 @@ uams_dhx_pam_la_CFLAGS = @SSL_CFLAGS@ @PAM_CFLAGS@ + uams_dhx2_pam_la_CFLAGS = @LIBGCRYPT_CFLAGS@ @PAM_CFLAGS@ + uams_gss_la_CFLAGS = @GSSAPI_CFLAGS@ @KRB5_CFLAGS@ + +-uams_guest_la_LDFLAGS = -module -avoid-version +-uams_randnum_la_LDFLAGS = -module -avoid-version @SSL_LIBS@ +-uams_passwd_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ +-uams_pam_la_LDFLAGS = -module -avoid-version @PAM_LIBS@ +-uams_pgp_la_LDFLAGS = -module -avoid-version @SSL_LIBS@ +-uams_dhx_passwd_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ @SSL_LIBS@ +-uams_dhx_pam_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ @SSL_LIBS@ @PAM_LIBS@ +-uams_dhx2_passwd_la_LDFLAGS = -module -avoid-version @CRYPT_LIBS@ @LIBGCRYPT_LIBS@ +-uams_dhx2_pam_la_LDFLAGS = -module -avoid-version @LIBGCRYPT_LIBS@ @PAM_LIBS@ +-uams_gss_la_LDFLAGS = -module -avoid-version @GSSAPI_LIBS@ @KRB5_LIBS@ ++uams_guest_la_LDFLAGS = -shared -module -avoid-version ++uams_randnum_la_LDFLAGS = -shared -module -avoid-version @SSL_LIBS@ ++uams_passwd_la_LDFLAGS = -shared -module -avoid-version @CRYPT_LIBS@ ++uams_pam_la_LDFLAGS = -shared -module -avoid-version @PAM_LIBS@ ++uams_pgp_la_LDFLAGS = -shared -module -avoid-version @SSL_LIBS@ ++uams_dhx_passwd_la_LDFLAGS = -shared -module -avoid-version @CRYPT_LIBS@ @SSL_LIBS@ ++uams_dhx_pam_la_LDFLAGS = -shared -module -avoid-version @CRYPT_LIBS@ @SSL_LIBS@ @PAM_LIBS@ ++uams_dhx2_passwd_la_LDFLAGS = -shared -module -avoid-version @CRYPT_LIBS@ @LIBGCRYPT_LIBS@ ++uams_dhx2_pam_la_LDFLAGS = -shared -module -avoid-version @LIBGCRYPT_LIBS@ @PAM_LIBS@ ++uams_gss_la_LDFLAGS = -shared -module -avoid-version @GSSAPI_LIBS@ @KRB5_LIBS@ + + # + # module compilation +diff --git a/libatalk/dsi/Makefile.am b/libatalk/dsi/Makefile.am +index 34fa76e..dbde336 100644 +--- a/libatalk/dsi/Makefile.am ++++ b/libatalk/dsi/Makefile.am +@@ -1,3 +1,4 @@ + noinst_LTLIBRARIES = libdsi.la + + libdsi_la_SOURCES = dsi_attn.c dsi_close.c dsi_cmdreply.c dsi_getsess.c dsi_getstat.c dsi_init.c dsi_opensess.c dsi_read.c dsi_tcp.c dsi_tickle.c dsi_write.c dsi_stream.c ++libdsi_la_LIBADD = $(WRAP_LIBS) +diff --git a/libatalk/vfs/Makefile.am b/libatalk/vfs/Makefile.am +index aa62aeb..8ac2045 100644 +--- a/libatalk/vfs/Makefile.am ++++ b/libatalk/vfs/Makefile.am +@@ -6,4 +6,5 @@ libvfs_la_SOURCES = vfs.c unix.c ea_ad.c ea_sys.c extattr.c + + if HAVE_ACLS + libvfs_la_SOURCES += acl.c ++libvfs_la_LIBADD = $(ACL_LIBS) + endif +diff --git a/macros/netatalk.m4 b/macros/netatalk.m4 +index ea2bbff..40ab817 100644 +--- a/macros/netatalk.m4 ++++ b/macros/netatalk.m4 +@@ -790,7 +790,6 @@ save_CFLAGS="$CFLAGS" + save_LDFLAGS="$LDFLAGS" + save_LIBS="$LIBS" + CFLAGS="" +-LDFLAGS="" + LIBS="" + LDAP_CFLAGS="" + LDAP_LDFLAGS="" diff --git a/net-fs/netatalk/metadata.xml b/net-fs/netatalk/metadata.xml new file mode 100644 index 000000000000..263e2e0c82d3 --- /dev/null +++ b/net-fs/netatalk/metadata.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <!-- maintainer-needed --> + <use> + <flag name="pgp">Add support pgp authentication module</flag> + <flag name="quota">Add support for user quota on various filesystems</flag> + <flag name="shadow">Add shadow support</flag> + <flag name="tracker">Add support for spotlight like tracker</flag> + <flag name="ssl"> + Use <pkg>dev-libs/openssl</pkg> to provide DHX User Access + Modules. These are not used with most recent versions of OS X + and can be kept disabled without risks. + </flag> + </use> + <upstream> + <remote-id type="sourceforge">netatalk</remote-id> + <remote-id type="github">Netatalk/netatalk</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-fs/netatalk/netatalk-3.1.18.ebuild b/net-fs/netatalk/netatalk-3.1.18.ebuild new file mode 100644 index 000000000000..2ef5d9bc17df --- /dev/null +++ b/net-fs/netatalk/netatalk-3.1.18.ebuild @@ -0,0 +1,169 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools eapi9-ver flag-o-matic pam systemd + +DESCRIPTION="Open Source AFP server" +HOMEPAGE="https://netatalk.sourceforge.net/" +SRC_URI="https://github.com/Netatalk/netatalk/releases/download/netatalk-${PV//./-}/netatalk-${PV}.tar.xz" + +LICENSE="GPL-2 BSD" +SLOT="0/18.0" +KEYWORDS="amd64 arm ~ppc ~ppc64 x86" +IUSE="acl cracklib dbus debug kerberos ldap pam pgp quota +shadow ssl tracker tcpd zeroconf" + +RDEPEND=" + !app-editors/yudit + dev-libs/libevent:= + >=dev-libs/libgcrypt-1.2.3:= + sys-apps/coreutils + >=sys-libs/db-4.2.52:= + sys-libs/tdb + virtual/libcrypt:= + acl? ( + sys-apps/attr + sys-apps/acl + ) + cracklib? ( sys-libs/cracklib ) + dbus? ( sys-apps/dbus dev-libs/dbus-glib ) + kerberos? ( virtual/krb5 ) + ldap? ( net-nds/openldap:= ) + pam? ( sys-libs/pam ) + ssl? ( dev-libs/openssl:0= ) + tcpd? ( sys-apps/tcp-wrappers ) + tracker? ( app-misc/tinysparql:3= ) + zeroconf? ( net-dns/avahi[dbus] ) +" +DEPEND="${RDEPEND}" +BDEPEND=" + app-alternatives/yacc + app-alternatives/lex +" + +RESTRICT="test" + +REQUIRED_USE=" + ldap? ( acl ) + tracker? ( dbus )" + +PATCHES=( + "${FILESDIR}"/${PN}-3.1.17-gentoo.patch + "${FILESDIR}"/${PN}-3.1.17-disable-ld-library-path.patch # bug #564350 +) + +src_prepare() { + default + append-flags -fno-strict-aliasing + + sed \ + -e "s:shell_utils::g" \ + -i contrib/Makefile.am || die + + eautoreconf +} + +src_configure() { + local myeconfargs=() + + # Ignore --with-init-style=gentoo, we install the init.d by hand and we avoid having + # to sed the Makefiles to not do rc-update. + # TODO: + # * systemd: --with-init-style=systemd + myeconfargs+=( + $(use_enable debug) + $(use_enable debug debugging) + $(use_enable pgp pgp-uam) + $(use_enable kerberos krbV-uam) + $(use_enable quota) + $(use_enable tcpd tcp-wrappers) + $(use_enable zeroconf) + $(use_with acl acls) + $(use_with cracklib) + $(use_with dbus afpstats) + $(use_with kerberos) + $(use_with ldap) + $(use_with pam) + $(use_with shadow) + $(use_with ssl ssl-dir) + $(use_with tracker dbus-daemon "${EPREFIX}/usr/bin/dbus-daemon") + $(use_with tracker tracker-pkgconfig-version $(ver_cut 1 $(best_version app-misc/tinysparql | sed 's:app-misc/tracker-::g')).0) + --disable-static + --enable-overwrite + --disable-afs + --with-bdb=/usr + --with-uams-path=/usr/$(get_libdir)/${PN} + --with-init-style=gentoo-openrc + --without-tdb + --with-lockfile=/run/lock/${PN} + ) + + econf "${myeconfargs[@]}" +} + +src_install() { + default + + if use zeroconf; then + sed -i -e '/avahi-daemon/s:use:need:g' "${ED}"/etc/init.d/${PN} || die + else + sed -i -e '/avahi-daemon/d' "${ED}"/etc/init.d/${PN} || die + fi + + # The pamd file isn't what we need, use pamd_mimic_system + rm -rf "${ED}/etc/pam.d" || die + + if use pam; then + pamd_mimic_system netatalk auth account password session + fi + + sed \ + -e "s|:SBINDIR:|${EPREFIX}/usr/sbin|g" \ + -e "s|:PATH_NETATALK_LOCK:|/run/lock/netatalk|g" \ + distrib/initscripts/service.systemd.tmpl \ + > "${T}"/service.systemd || die + systemd_newunit "${T}"/service.systemd ${PN}.service + + # no static archives + find "${ED}" -name '*.la' -delete || die +} + +pkg_postinst() { + if ver_replacing -lt 3; then + local fle + for fle in afp_signature.conf afp_voluuid.conf; do + if [[ -f "${ROOT}"/etc/netatalk/${fle} ]]; then + if [[ ! -f "${ROOT}"/var/lib/netatalk/${fle} ]]; then + mv \ + "${ROOT}"/etc/netatalk/${fle} \ + "${ROOT}"/var/lib/netatalk/ + fi + fi + done + + elog + elog "Starting from version 3.0 only uses a single init script again" + elog "Please update your runlevels accordingly" + elog + elog "Dependencies should be resolved automatically depending on settings" + elog "but please report issues with this on https://bugs.gentoo.org/ if" + elog "you find any." + elog + elog "Following config files are obsolete now:" + elog "afpd.conf, netatalk.conf, AppleVolumes.default and afp_ldap.conf" + elog "in favour of" + elog "/etc/afp.conf" + elog + elog "Please convert your existing configs before you restart your daemon" + elog + elog "The new AppleDouble default backend is appledouble = ea" + elog "Existing entries will be updated on access, but can do an offline" + elog "conversion with" + elog "dbd -ruve /path/to/Volume" + elog + elog "For general notes on the upgrade, please visit" + elog "http://netatalk.sourceforge.net/3.0/htmldocs/upgrade.html" + elog + fi +} diff --git a/net-fs/nfs-utils/Manifest b/net-fs/nfs-utils/Manifest new file mode 100644 index 000000000000..b77fd3af1574 --- /dev/null +++ b/net-fs/nfs-utils/Manifest @@ -0,0 +1,3 @@ +DIST nfs-utils-2.6.4.tar.bz2 979652 BLAKE2B 45f6e9c98e8148e82684526c2ab0f8976b2a46fd869d91f03cf9afffbaad64b77dc1729a50b74d30c5d65bfe213a1da2f54e3d3e19539b61994f7b65671a26ab SHA512 e5fde25c54f594d00e69c9aeff8abc22663b994ecd37d8516751be98b51b12c61ffec47ee128794e170ec773f0649cb594df1ca104ec4dba561823db423f8533 +DIST nfs-utils-2.7.1.tar.bz2 1001424 BLAKE2B 176c5559c23c2761c1f2beed068fda8bdd39ac9fa09b4b223552c1455152c410d8925adf8d0023300d4355338e9dc8f6b2774ba71488e795945e5f1fee2b305c SHA512 9e55d4a0d672dbb0e20f8ea0213355a0bec054124c2a9437b3e4b81214c24ef5adb43914bd8606d4af14801ec8e6a4f849c9a97d76ae0879566792bbc960845a +DIST nfs-utils-2.8.5.tar.bz2 1001261 BLAKE2B 68ab063257222107e79f792c92103a98779e3401284395bef1f2a3cf37bfc73c984e8e5d60ee820882cb92fbb371dd5a72ffa28738274b66e8f269324cdf3e19 SHA512 a42612c5611f7de5fe8170f3059b96e4c15ab8ad2be19aa83f9117efa4207b3fec0629ea11864ee9b8ff267dcb5328a5295e8995a6f2cf500361ab38f91ad65a diff --git a/net-fs/nfs-utils/files/exports b/net-fs/nfs-utils/files/exports new file mode 100644 index 000000000000..5102ef27c150 --- /dev/null +++ b/net-fs/nfs-utils/files/exports @@ -0,0 +1 @@ +# /etc/exports: NFS file systems being exported. See exports(5). diff --git a/net-fs/nfs-utils/files/nfs-utils-2.5.2-no-werror.patch b/net-fs/nfs-utils/files/nfs-utils-2.5.2-no-werror.patch new file mode 100644 index 000000000000..a7226db24920 --- /dev/null +++ b/net-fs/nfs-utils/files/nfs-utils-2.5.2-no-werror.patch @@ -0,0 +1,68 @@ +From 6ab8c7c186bd4a547a0ca435ecabe10ee50039c5 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger <vapier@gentoo.org> +Date: Thu, 22 Oct 2020 19:44:34 +0200 +Subject: [PATCH] Don't build with -Werror flags + +https://bugs.gentoo.org/656984 + +Signed-off-by: Lars Wendler <polynomial-c@gentoo.org> +--- + configure.ac | 34 +--------------------------------- + 1 file changed, 1 insertion(+), 33 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 50847d8a..6bc18e93 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -631,47 +631,15 @@ AC_SUBST(CPPFLAGS_FOR_BUILD) + AC_SUBST(LDFLAGS_FOR_BUILD) + + my_am_cflags="\ +- -pipe \ + -Wall \ + -Wextra \ + $rpcgen_cflags \ +- -Werror=missing-prototypes \ +- -Werror=missing-declarations \ +- -Werror=format=2 \ +- -Werror=undef \ +- -Werror=missing-include-dirs \ +- -Werror=strict-aliasing=2 \ +- -Werror=init-self \ +- -Werror=implicit-function-declaration \ +- -Werror=return-type \ +- -Werror=switch \ +- -Werror=overflow \ +- -Werror=parentheses \ +- -Werror=aggregate-return \ +- -Werror=unused-result \ + -fno-strict-aliasing \ + " + +-AC_DEFUN([CHECK_CCSUPPORT], [ +- my_save_cflags="$CFLAGS" +- CFLAGS="-Werror $1" +- AC_MSG_CHECKING([whether CC supports $1]) +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], +- [AC_MSG_RESULT([yes])] +- [$2+=$1], +- [AC_MSG_RESULT([no])] +- ) +- CFLAGS="$my_save_cflags" +-]) +- +-CHECK_CCSUPPORT([-Werror=format-overflow=2], [flg1]) +-CHECK_CCSUPPORT([-Werror=int-conversion], [flg2]) +-CHECK_CCSUPPORT([-Werror=incompatible-pointer-types], [flg3]) +-CHECK_CCSUPPORT([-Werror=misleading-indentation], [flg4]) +-CHECK_CCSUPPORT([-Wno-cast-function-type], [flg5]) + AX_GCC_FUNC_ATTRIBUTE([format]) + +-AC_SUBST([AM_CFLAGS], ["$my_am_cflags $flg1 $flg2 $flg3 $flg4 $flg5"]) ++AC_SUBST([AM_CFLAGS], ["$my_am_cflags"]) + + # Make sure that $ACLOCAL_FLAGS are used during a rebuild + AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \$(ACLOCAL_FLAGS)"]) +-- +2.29.0 + diff --git a/net-fs/nfs-utils/files/nfs-utils-2.6.4-C99-inline.patch b/net-fs/nfs-utils/files/nfs-utils-2.6.4-C99-inline.patch new file mode 100644 index 000000000000..2797249523f6 --- /dev/null +++ b/net-fs/nfs-utils/files/nfs-utils-2.6.4-C99-inline.patch @@ -0,0 +1,26 @@ +C99 `inline` is not guaranteed to emit an external definition +https://www.greenend.org.uk/rjk/tech/inline.html +Bug: https://bugs.gentoo.org/922958 + +--- a/utils/exportd/exportd.c ++++ b/utils/exportd/exportd.c +@@ -53,7 +53,7 @@ + */ + inline static void set_signals(void); + +-inline void ++inline static void + cleanup_lockfiles (void) + { + unlink(etab.lockfn); +--- a/utils/mountd/mountd.c ++++ b/utils/mountd/mountd.c +@@ -111,7 +111,7 @@ + nfs_svc_unregister(MOUNTPROG, MOUNTVERS_NFSV3); + } + +-static void ++inline static void + cleanup_lockfiles (void) + { + unlink(etab.lockfn); diff --git a/net-fs/nfs-utils/files/nfs-utils-2.6.4-includes.patch b/net-fs/nfs-utils/files/nfs-utils-2.6.4-includes.patch new file mode 100644 index 000000000000..0312ac1a8b37 --- /dev/null +++ b/net-fs/nfs-utils/files/nfs-utils-2.6.4-includes.patch @@ -0,0 +1,41 @@ +https://bugs.gentoo.org/922373 +https://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=bb25f3f594ddf85e5826e931eaaa35874f6a4204 + +From bb25f3f594ddf85e5826e931eaaa35874f6a4204 Mon Sep 17 00:00:00 2001 +From: Petr Vorel <pvorel@suse.cz> +Date: Wed, 3 Jan 2024 19:07:43 -0500 +Subject: [PATCH] reexport/{fsidd,reexport}.c: Re-add missing includes + +Older uClibc-ng requires <unistd.h> for close(2), unlink(2) and write(2), +<sys/un.h> for struct sockaddr_un. + +Fixes: 1a4edb2a ("reexport/fsidd.c: Remove unused headers") +Fixes: bdc79f02 ("support/reexport.c: Remove unused headers") + +Reviewed-by: Giulio Benetti <giulio.benetti@benettiengineering.com> +Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com> +Signed-off-by: Petr Vorel <pvorel@suse.cz> +Signed-off-by: Steve Dickson <steved@redhat.com> +--- a/support/reexport/fsidd.c ++++ b/support/reexport/fsidd.c +@@ -7,6 +7,8 @@ + #include <dlfcn.h> + #endif + #include <event2/event.h> ++#include <sys/un.h> ++#include <unistd.h> + + #include "conffile.h" + #include "reexport_backend.h" +--- a/support/reexport/reexport.c ++++ b/support/reexport/reexport.c +@@ -7,6 +7,7 @@ + #endif + #include <sys/types.h> + #include <sys/vfs.h> ++#include <unistd.h> + #include <errno.h> + + #include "nfsd_path.h" +-- +1.8.3.1 diff --git a/net-fs/nfs-utils/files/nfs-utils-udev-sysctl.patch b/net-fs/nfs-utils/files/nfs-utils-udev-sysctl.patch new file mode 100644 index 000000000000..156a3067bb3c --- /dev/null +++ b/net-fs/nfs-utils/files/nfs-utils-udev-sysctl.patch @@ -0,0 +1,32 @@ +Gentoo installs sysctl in /usr/sbin + +https://bugs.gentoo.org/907688 + +--- a/systemd/60-nfs.rules ++++ b/systemd/60-nfs.rules +@@ -2,20 +2,20 @@ + + # sunrpc module supports "sunrpc.*" sysctls + ACTION=="add", SUBSYSTEM=="module", KERNEL=="sunrpc", \ +- RUN+="/sbin/sysctl -q --pattern ^sunrpc --system" ++ RUN+="/usr/sbin/sysctl -q --pattern ^sunrpc --system" + + # rpcrdma module supports sunrpc.svc_rdma.* + ACTION=="add", SUBSYSTEM=="module", KERNEL=="rpcrdma", \ +- RUN+="/sbin/sysctl -q --pattern ^sunrpc.svc_rdma --system" ++ RUN+="/usr/sbin/sysctl -q --pattern ^sunrpc.svc_rdma --system" + + # lockd module supports "fs.nfs.nlm*" and "fs.nfs.nsm*" sysctls + ACTION=="add", SUBSYSTEM=="module", KERNEL=="lockd", \ +- RUN+="/sbin/sysctl -q --pattern ^fs.nfs.n[sl]m --system" ++ RUN+="/usr/sbin/sysctl -q --pattern ^fs.nfs.n[sl]m --system" + + # nfsv4 module supports "fs.nfs.*" sysctls (nfs_callback_tcpport and idmap_cache_timeout) + ACTION=="add", SUBSYSTEM=="module", KERNEL=="nfsv4", \ +- RUN+="/sbin/sysctl -q --pattern ^fs.nfs.(nfs_callback_tcpport|idmap_cache_timeout) --system" ++ RUN+="/usr/sbin/sysctl -q --pattern ^fs.nfs.(nfs_callback_tcpport|idmap_cache_timeout) --system" + + # nfs module supports "fs.nfs.*" sysctls + ACTION=="add", SUBSYSTEM=="module", KERNEL=="nfs", \ +- RUN+="/sbin/sysctl -q --pattern ^fs.nfs --system" ++ RUN+="/usr/sbin/sysctl -q --pattern ^fs.nfs --system" diff --git a/net-fs/nfs-utils/files/nfs.initd b/net-fs/nfs-utils/files/nfs.initd new file mode 100644 index 000000000000..88a13a85db38 --- /dev/null +++ b/net-fs/nfs-utils/files/nfs.initd @@ -0,0 +1,155 @@ +#!/sbin/openrc-run +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +extra_started_commands="reload" + +# The binary locations +exportfs=/usr/sbin/exportfs +mountd=/usr/sbin/rpc.mountd +nfsd=/usr/sbin/rpc.nfsd +smnotify=/usr/sbin/sm-notify + +depend() { + local myneed="" + # XXX: no way to detect NFSv4 is desired and so need rpc.idmapd + myneed="${myneed} $( + awk '!/^[[:space:]]*#/ { + # clear the path to avoid spurious matches + $1 = ""; + if ($0 ~ /[(][^)]*sec=(krb|spkm)[^)]*[)]/) { + print "rpc.svcgssd" + exit 0 + } + }' /etc/exports /etc/exports.d/*.exports 2>/dev/null + )" + config /etc/exports /etc/exports.d/*.exports + need portmap + need rpc.statd ${myneed} ${NFS_NEEDED_SERVICES} + use ypbind net dns rpc.rquotad rpc.idmapd rpc.svcgssd + after quota +} + +mkdir_nfsdirs() { + local d + for d in v4recovery v4root ; do + d="/var/lib/nfs/${d}" + [ ! -d "${d}" ] && mkdir -p "${d}" + done +} + +waitfor_exportfs() { + local pid=$1 + ( sleep ${EXPORTFS_TIMEOUT:-30}; kill -9 ${pid} 2>/dev/null ) & + wait $1 +} + +mount_nfsd() { + if [ -e /proc/modules ] ; then + # Make sure nfs support is loaded in the kernel #64709 + if ! grep -qs nfsd /proc/filesystems ; then + modprobe -q nfsd + fi + # Restart idmapd if needed #220747 + if grep -qs nfsd /proc/modules ; then + killall -q --signal=HUP rpc.idmapd + fi + fi + + # This is the new "kernel 2.6 way" to handle the exports file + if grep -qs nfsd /proc/filesystems ; then + if ! mountinfo -q /proc/fs/nfsd ; then + ebegin "Mounting nfsd filesystem in /proc" + mount -t nfsd -o nodev,noexec,nosuid nfsd /proc/fs/nfsd + eend $? + fi + + local o + for o in ${OPTS_NFSD} ; do + echo "${o#*=}" > "/proc/fs/nfsd/${o%%=*}" + done + fi +} + +start_it() { + ebegin "Starting NFS $1" + shift + "$@" + eend $? + ret=$((ret + $?)) +} +start() { + mount_nfsd + mkdir_nfsdirs + + # Exportfs likes to hang if networking isn't working. + # If that's the case, then try to kill it so the + # bootup process can continue. + if grep -qs '^[[:space:]]*"\?/' /etc/exports /etc/exports.d/*.exports ; then + ebegin "Exporting NFS directories" + ${exportfs} -r & + waitfor_exportfs $! + eend $? + fi + + local ret=0 + start_it mountd ${mountd} ${OPTS_RPC_MOUNTD} + start_it daemon ${nfsd} ${OPTS_RPC_NFSD} + [ -x "${smnotify}" ] && start_it smnotify ${smnotify} ${OPTS_SMNOTIFY} + return ${ret} +} + +stop() { + local ret=0 + + ebegin "Stopping NFS mountd" + start-stop-daemon --stop --exec ${mountd} + eend $? + ret=$((ret + $?)) + + ebegin "Stopping NFS daemon" + # Do not attempt to signal kernel nfsd threads directly, #924309 + ${nfsd} 0 + eend $? + ret=$((ret + $?)) + + # When restarting the NFS server, running "exportfs -ua" probably + # isn't what the user wants. Running it causes all entries listed + # in xtab to be removed from the kernel export tables, and the + # xtab file is cleared. This effectively shuts down all NFS + # activity, leaving all clients holding stale NFS filehandles, + # *even* when the NFS server has restarted. + # + # That's what you would want if you were shutting down the NFS + # server for good, or for a long period of time, but not when the + # NFS server will be running again in short order. In this case, + # then "exportfs -r" will reread the xtab, and all the current + # clients will be able to resume NFS activity, *without* needing + # to umount/(re)mount the filesystem. + if [ "${RC_CMD}" != "restart" ] ; then + ebegin "Unexporting NFS directories" + # Exportfs likes to hang if networking isn't working. + # If that's the case, then try to kill it so the + # shutdown process can continue. + ${exportfs} -ua & + waitfor_exportfs $! + eend $? + fi + + return ${ret} +} + +reload() { + # Exportfs likes to hang if networking isn't working. + # If that's the case, then try to kill it so the + # bootup process can continue. + ebegin "Reloading /etc/exports" + ${exportfs} -r 1>&2 & + waitfor_exportfs $! + eend $? +} + +restart() { + svc_stop + svc_start +} diff --git a/net-fs/nfs-utils/files/nfsclient.initd b/net-fs/nfs-utils/files/nfsclient.initd new file mode 100644 index 000000000000..e278cbde0539 --- /dev/null +++ b/net-fs/nfs-utils/files/nfsclient.initd @@ -0,0 +1,34 @@ +#!/sbin/openrc-run +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs + +depend() { + local opts myneed="" + if [ -e /etc/fstab ] ; then + for opts in $(fstabinfo -o -t nfs,nfs4) ; do + case $opts in + *sec=krb*|*sec=spkm*) myneed="$myneed rpc.gssd" ;; + esac + done + fi + config /etc/fstab + need portmap + need rpc.statd rpc.idmapd ${myneed} + use ypbind dns +} + +start() { + if [ -x /usr/sbin/sm-notify ] ; then + ebegin "Starting NFS sm-notify" + /usr/sbin/sm-notify ${OPTS_SMNOTIFY} + eend $? + fi + + # Make sure nfs support is loaded in the kernel #64709 + if [ -e /proc/modules ] && ! grep -qs 'nfs$' /proc/filesystems ; then + modprobe -q nfs + fi + return 0 +} diff --git a/net-fs/nfs-utils/files/rpc.gssd.initd b/net-fs/nfs-utils/files/rpc.gssd.initd new file mode 100644 index 000000000000..7bfe920b3d54 --- /dev/null +++ b/net-fs/nfs-utils/files/rpc.gssd.initd @@ -0,0 +1,24 @@ +#!/sbin/openrc-run +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs + +depend() { + use ypbind net + need portmap + need rpc.pipefs + after quota +} + +start() { + ebegin "Starting gssd" + start-stop-daemon --start --exec /usr/sbin/rpc.gssd -- ${OPTS_RPC_GSSD} + eend $? +} + +stop() { + ebegin "Stopping gssd" + start-stop-daemon --stop --exec /usr/sbin/rpc.gssd + eend $? +} diff --git a/net-fs/nfs-utils/files/rpc.idmapd.initd b/net-fs/nfs-utils/files/rpc.idmapd.initd new file mode 100644 index 000000000000..9cb36000b5ed --- /dev/null +++ b/net-fs/nfs-utils/files/rpc.idmapd.initd @@ -0,0 +1,26 @@ +#!/sbin/openrc-run +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs + +rpc_bin=/usr/sbin/rpc.idmapd + +depend() { + use ypbind net + need portmap + need rpc.pipefs + after quota +} + +start() { + ebegin "Starting idmapd" + ${rpc_bin} ${OPTS_RPC_IDMAPD} + eend $? "make sure DNOTIFY support is enabled ..." +} + +stop() { + ebegin "Stopping idmapd" + start-stop-daemon --stop --exec ${rpc_bin} + eend $? +} diff --git a/net-fs/nfs-utils/files/rpc.pipefs.initd b/net-fs/nfs-utils/files/rpc.pipefs.initd new file mode 100644 index 000000000000..f971a49b393e --- /dev/null +++ b/net-fs/nfs-utils/files/rpc.pipefs.initd @@ -0,0 +1,32 @@ +#!/sbin/openrc-run +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +MNT="/var/lib/nfs/rpc_pipefs" + +mount_pipefs() { + local fstype=rpc_pipefs + + # if things are already mounted, nothing to do + mountinfo -q ${MNT} && return 0 + + # if rpc_pipefs is not available, try to load sunrpc for it #219566 + grep -qs ${fstype} /proc/filesystems || modprobe -q sunrpc + # if still not available, the `mount` will issue an error for the user + + # now just do it for kicks + mkdir -p ${MNT} + mount -t ${fstype} ${fstype} ${MNT} +} + +start() { + ebegin "Setting up RPC pipefs" + mount_pipefs + eend $? "make sure you have NFS/SUNRPC enabled in your kernel" +} + +stop() { + ebegin "Unmounting RPC pipefs" + umount ${MNT} + eend $? +} diff --git a/net-fs/nfs-utils/files/rpc.statd.initd b/net-fs/nfs-utils/files/rpc.statd.initd new file mode 100644 index 000000000000..ea78b9aef61a --- /dev/null +++ b/net-fs/nfs-utils/files/rpc.statd.initd @@ -0,0 +1,32 @@ +#!/sbin/openrc-run +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs + +rpc_bin=/sbin/rpc.statd +rpc_pid=/var/run/rpc.statd.pid + +depend() { + use ypbind net + need portmap + after quota +} + +start() { + # Don't start rpc.statd if already started by someone else ... + # Don't try and kill it if it's already dead ... + if killall -q -0 ${rpc_bin} ; then + return 0 + fi + + ebegin "Starting NFS statd" + start-stop-daemon --start --exec ${rpc_bin} -- --no-notify ${OPTS_RPC_STATD} + eend $? +} + +stop() { + ebegin "Stopping NFS statd" + start-stop-daemon --stop --exec ${rpc_bin} --pidfile /var/run/rpc.statd.pid + eend $? +} diff --git a/net-fs/nfs-utils/files/rpc.svcgssd.initd b/net-fs/nfs-utils/files/rpc.svcgssd.initd new file mode 100644 index 000000000000..11bc4265eddd --- /dev/null +++ b/net-fs/nfs-utils/files/rpc.svcgssd.initd @@ -0,0 +1,24 @@ +#!/sbin/openrc-run +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs + +depend() { + use ypbind net + need portmap + need rpc.pipefs + after quota +} + +start() { + ebegin "Starting svcgssd" + start-stop-daemon --start --exec /usr/sbin/rpc.svcgssd -- ${OPTS_RPC_SVCGSSD} + eend $? +} + +stop() { + ebegin "Stopping svcgssd" + start-stop-daemon --stop --exec /usr/sbin/rpc.svcgssd + eend $? +} diff --git a/net-fs/nfs-utils/metadata.xml b/net-fs/nfs-utils/metadata.xml new file mode 100644 index 000000000000..261c8181272b --- /dev/null +++ b/net-fs/nfs-utils/metadata.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>base-system@gentoo.org</email> + <name>Gentoo Base System</name> + </maintainer> + <use> + <flag name="junction">Enable NFS junction support in nfsref</flag> + <flag name="ldap">Add ldap support</flag> + <flag name="libmount">Link mount.nfs with libmount</flag> + <flag name="nfsdctl">Build 'nfsdctl' utility to control nfsd.</flag> + <flag name="nfsv3">Enable support for NFSv2 and NFSv3</flag> + <flag name="nfsv4">Enable support for NFSv4 (includes NFSv4.1 and NFSv4.2)</flag> + <flag name="uuid">Support UUID lookups in rpc.mountd</flag> + </use> + <upstream> + <remote-id type="cpe">cpe:/a:linux-nfs:nfs-utils</remote-id> + <remote-id type="sourceforge">nfs</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-fs/nfs-utils/nfs-utils-2.6.4-r12.ebuild b/net-fs/nfs-utils/nfs-utils-2.6.4-r12.ebuild new file mode 100644 index 000000000000..e2d1bd84fa56 --- /dev/null +++ b/net-fs/nfs-utils/nfs-utils-2.6.4-r12.ebuild @@ -0,0 +1,214 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools linux-info systemd + +DESCRIPTION="NFS client and server daemons" +HOMEPAGE="http://linux-nfs.org/ https://git.linux-nfs.org/?p=steved/nfs-utils.git" + +if [[ ${PV} == *_rc* ]] ; then + MY_PV="$(ver_rs 1- -)" + SRC_URI="http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=snapshot;h=refs/tags/${PN}-${MY_PV};sf=tgz -> ${P}.tar.gz" + S="${WORKDIR}/${PN}-${PN}-${MY_PV}" +else + SRC_URI="https://downloads.sourceforge.net/nfs/${P}.tar.bz2" + KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86" +fi + +LICENSE="GPL-2" +SLOT="0" +IUSE="caps junction kerberos ldap +libmount +nfsv3 +nfsv4 sasl selinux tcpd +uuid" +REQUIRED_USE="|| ( nfsv3 nfsv4 ) kerberos? ( nfsv4 )" +# bug #315573 +RESTRICT="test" + +# kth-krb doesn't provide the right include +# files, and nfs-utils doesn't build against heimdal either, +# so don't depend on virtual/krb. +# (04 Feb 2005 agriffis) +COMMON_DEPEND=" + dev-libs/libxml2:= + net-libs/libtirpc:= + sys-fs/e2fsprogs + dev-db/sqlite:3 + dev-libs/libevent:= + caps? ( sys-libs/libcap ) + ldap? ( + net-nds/openldap:= + sasl? ( + app-crypt/mit-krb5 + dev-libs/cyrus-sasl:2 + ) + ) + libmount? ( sys-apps/util-linux ) + nfsv3? ( >=net-nds/rpcbind-0.2.4 ) + nfsv4? ( + >=sys-apps/keyutils-1.5.9:= + sys-fs/lvm2 + kerberos? ( + >=net-libs/libtirpc-0.2.4-r1[kerberos] + app-crypt/mit-krb5 + ) + ) + tcpd? ( sys-apps/tcp-wrappers ) + uuid? ( sys-apps/util-linux )" +DEPEND="${COMMON_DEPEND} + elibc_musl? ( sys-libs/queue-standalone ) +" +RDEPEND="${COMMON_DEPEND} + !net-libs/libnfsidmap + selinux? ( + sec-policy/selinux-rpc + nfsv3? ( sec-policy/selinux-rpcbind ) + ) +" +BDEPEND=" + net-libs/rpcsvc-proto + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-2.5.2-no-werror.patch + "${FILESDIR}"/${PN}-udev-sysctl.patch + "${FILESDIR}"/${P}-includes.patch + "${FILESDIR}"/${P}-C99-inline.patch +) + +pkg_setup() { + linux-info_pkg_setup + + if use nfsv4 && linux_config_exists && ! linux_chkconfig_present CRYPTO_MD5 ; then + ewarn "Your NFS server will be unable to track clients across server restarts!" + ewarn "Please enable ${HILITE}CONFIG_CRYPTO_MD5${NORMAL} in your kernel to" + ewarn "support the legacy, in-kernel client tracker." + fi +} + +src_prepare() { + default + + sed \ + -e "/^sbindir/s:= := \"${EPREFIX}\":g" \ + -i utils/*/Makefile.am || die + + eautoreconf +} + +src_configure() { + # Our DEPEND forces this. + export libsqlite3_cv_is_recent=yes + export ac_cv_header_keyutils_h=$(usex nfsv4) + + # SASL is consumed in a purely automagic way + export ac_cv_header_sasl_h=no + export ac_cv_header_sasl_sasl_h=$(usex sasl) + + local myeconfargs=( + --disable-static + --with-statedir="${EPREFIX}"/var/lib/nfs + --enable-tirpc + --with-tirpcinclude="${ESYSROOT}"/usr/include/tirpc/ + --with-pluginpath="${EPREFIX}"/usr/$(get_libdir)/libnfsidmap + --with-rpcgen + --with-systemd="$(systemd_get_systemunitdir)" + --without-gssglue + $(use_enable caps) + --enable-ipv6 + $(use_enable junction) + $(use_enable kerberos gss) + $(use_enable kerberos svcgss) + $(use_enable ldap) + $(use_enable libmount libmount-mount) + $(use_enable nfsv4) + $(use_enable nfsv4 nfsdcld) + $(use_enable nfsv4 nfsdcltrack) + $(use_enable nfsv4 nfsv41) + $(use_enable nfsv4 nfsv4server) + $(use_enable uuid) + $(use_with tcpd tcp-wrappers) + ) + econf "${myeconfargs[@]}" +} + +src_compile() { + # Remove compiled files bundled in the tarball + emake clean + + default +} + +src_install() { + default + rm linux-nfs/Makefile* || die + dodoc -r linux-nfs README + + # Don't overwrite existing xtab/etab, install the original + # versions somewhere safe... more info in pkg_postinst + keepdir /var/lib/nfs/{,sm,sm.bak} + mv "${ED}"/var/lib/nfs "${ED}"/usr/$(get_libdir)/ || die + + # Install some client-side binaries in /sbin + dodir /sbin + mv "${ED}"/usr/sbin/rpc.statd "${ED}"/sbin/ || die + + if use nfsv4 ; then + insinto /etc + doins support/nfsidmap/idmapd.conf + + # Install a config file for idmappers in newer kernels. bug #415625 + insinto /etc/request-key.d + echo 'create id_resolver * * /usr/sbin/nfsidmap -t 600 %k %d' > id_resolver.conf + doins id_resolver.conf + fi + + insinto /etc + doins "${FILESDIR}"/exports + keepdir /etc/exports.d + + local f list=() + if use nfsv4 ; then + list+=( rpc.idmapd rpc.pipefs ) + use kerberos && list+=( rpc.gssd rpc.svcgssd ) + fi + + local sedexp=( -e '#placehoder' ) + use nfsv3 || sedexp+=( -e '/need portmap/d' ) + + mkdir -p "${T}/init.d" || die + for f in nfs nfsclient rpc.statd "${list[@]}" ; do + sed "${sedexp[@]}" "${FILESDIR}/${f}.initd" > "${T}/init.d/${f}" || die + doinitd "${T}/init.d/${f}" + done + + local systemd_systemunitdir="$(systemd_get_systemunitdir)" + sed -i \ + -e 's:/usr/sbin/rpc.statd:/sbin/rpc.statd:' \ + "${ED}${systemd_systemunitdir}"/* || die + + # Remove legacy service if not requested (as it will be broken without rpcbind) + if ! use nfsv3; then + rm "${ED}${systemd_systemunitdir}/nfs-server.service" || die + fi + + # bug #368505 + keepdir /var/lib/nfs + # bug #603628 + keepdir /var/lib/nfs/v4recovery + + # No static archives + find "${ED}" -name '*.la' -delete || die +} + +pkg_postinst() { + # Install default xtab and friends if there's none existing. In + # src_install we put them in /usr/lib/nfs for safe-keeping, but + # the daemons actually use the files in /var/lib/nfs. #30486 + local f + for f in "${EROOT}"/usr/$(get_libdir)/nfs/*; do + [[ -e ${EROOT}/var/lib/nfs/${f##*/} ]] && continue + einfo "Copying default ${f##*/} from ${EPREFIX}/usr/$(get_libdir)/nfs to ${EPREFIX}/var/lib/nfs" + cp -pPR "${f}" "${EROOT}"/var/lib/nfs/ + done +} diff --git a/net-fs/nfs-utils/nfs-utils-2.7.1-r1.ebuild b/net-fs/nfs-utils/nfs-utils-2.7.1-r1.ebuild new file mode 100644 index 000000000000..ff7994e98bc7 --- /dev/null +++ b/net-fs/nfs-utils/nfs-utils-2.7.1-r1.ebuild @@ -0,0 +1,214 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools linux-info systemd + +DESCRIPTION="NFS client and server daemons" +HOMEPAGE="http://linux-nfs.org/ https://git.linux-nfs.org/?p=steved/nfs-utils.git" + +if [[ ${PV} == *_rc* ]] ; then + MY_PV="$(ver_rs 1- -)" + SRC_URI="http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=snapshot;h=refs/tags/${PN}-${MY_PV};sf=tgz -> ${P}.tar.gz" + S="${WORKDIR}/${PN}-${PN}-${MY_PV}" +else + SRC_URI="https://downloads.sourceforge.net/nfs/${P}.tar.bz2" + KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86" +fi + +LICENSE="GPL-2" +SLOT="0" +IUSE="caps junction kerberos ldap +libmount +nfsv3 +nfsv4 sasl selinux tcpd +uuid" +REQUIRED_USE="|| ( nfsv3 nfsv4 ) kerberos? ( nfsv4 )" +# bug #315573 +RESTRICT="test" + +# kth-krb doesn't provide the right include +# files, and nfs-utils doesn't build against heimdal either, +# so don't depend on virtual/krb. +# (04 Feb 2005 agriffis) +COMMON_DEPEND=" + dev-libs/libxml2:= + net-libs/libtirpc:= + sys-fs/e2fsprogs + dev-db/sqlite:3 + dev-libs/libevent:= + caps? ( sys-libs/libcap ) + ldap? ( + net-nds/openldap:= + sasl? ( + app-crypt/mit-krb5 + dev-libs/cyrus-sasl:2 + ) + ) + libmount? ( sys-apps/util-linux ) + nfsv3? ( >=net-nds/rpcbind-0.2.4 ) + nfsv4? ( + >=sys-apps/keyutils-1.5.9:= + sys-fs/lvm2 + kerberos? ( + >=net-libs/libtirpc-0.2.4-r1[kerberos] + app-crypt/mit-krb5 + ) + ) + tcpd? ( sys-apps/tcp-wrappers ) + uuid? ( sys-apps/util-linux )" +DEPEND="${COMMON_DEPEND} + elibc_musl? ( sys-libs/queue-standalone ) +" +RDEPEND="${COMMON_DEPEND} + !net-libs/libnfsidmap + selinux? ( + sec-policy/selinux-rpc + nfsv3? ( sec-policy/selinux-rpcbind ) + ) +" +BDEPEND=" + net-libs/rpcsvc-proto + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-2.5.2-no-werror.patch + "${FILESDIR}"/${PN}-udev-sysctl.patch + "${FILESDIR}"/${PN}-2.6.4-C99-inline.patch +) + +pkg_setup() { + linux-info_pkg_setup + + if use nfsv4 && linux_config_exists && ! linux_chkconfig_present CRYPTO_MD5 ; then + ewarn "Your NFS server will be unable to track clients across server restarts!" + ewarn "Please enable CONFIG_CRYPTO_MD5 in your kernel to" + ewarn "support the legacy, in-kernel client tracker." + fi +} + +src_prepare() { + default + + sed \ + -e "/^sbindir/s:= := \"${EPREFIX}\":g" \ + -i utils/*/Makefile.am || die + + eautoreconf +} + +src_configure() { + # Our DEPEND forces this. + export libsqlite3_cv_is_recent=yes + export ac_cv_header_keyutils_h=$(usex nfsv4) + + # SASL is consumed in a purely automagic way + export ac_cv_header_sasl_h=no + export ac_cv_header_sasl_sasl_h=$(usex sasl) + + local myeconfargs=( + --disable-static + --with-statedir="${EPREFIX}"/var/lib/nfs + --enable-tirpc + --with-tirpcinclude="${ESYSROOT}"/usr/include/tirpc/ + --with-pluginpath="${EPREFIX}"/usr/$(get_libdir)/libnfsidmap + --with-rpcgen + --with-systemd="$(systemd_get_systemunitdir)" + --without-gssglue + $(use_enable caps) + --enable-ipv6 + $(use_enable junction) + $(use_enable kerberos gss) + $(use_enable kerberos svcgss) + $(use_enable ldap) + $(use_enable libmount libmount-mount) + $(use_enable nfsv4) + $(use_enable nfsv4 nfsdcld) + $(use_enable nfsv4 nfsdcltrack) + $(use_enable nfsv4 nfsv41) + $(use_enable nfsv4 nfsv4server) + $(use_enable uuid) + $(use_with kerberos krb5 "${ESYSROOT}"/usr) + $(use_with tcpd tcp-wrappers) + ) + econf "${myeconfargs[@]}" +} + +src_compile() { + # Remove compiled files bundled in the tarball + emake clean + + default +} + +src_install() { + default + rm linux-nfs/Makefile* || die + dodoc -r linux-nfs README + + # Don't overwrite existing xtab/etab, install the original + # versions somewhere safe... more info in pkg_postinst + keepdir /var/lib/nfs/{,sm,sm.bak} + mv "${ED}"/var/lib/nfs "${ED}"/usr/$(get_libdir)/ || die + + # Install some client-side binaries in /sbin + dodir /sbin + mv "${ED}"/usr/sbin/rpc.statd "${ED}"/sbin/ || die + + if use nfsv4 ; then + insinto /etc + doins support/nfsidmap/idmapd.conf + + # Install a config file for idmappers in newer kernels. bug #415625 + insinto /etc/request-key.d + echo 'create id_resolver * * /usr/sbin/nfsidmap -t 600 %k %d' > id_resolver.conf + doins id_resolver.conf + fi + + insinto /etc + doins "${FILESDIR}"/exports + keepdir /etc/exports.d + + local f list=() + if use nfsv4 ; then + list+=( rpc.idmapd rpc.pipefs ) + use kerberos && list+=( rpc.gssd rpc.svcgssd ) + fi + + local sedexp=( -e '#placehoder' ) + use nfsv3 || sedexp+=( -e '/need portmap/d' ) + + mkdir -p "${T}/init.d" || die + for f in nfs nfsclient rpc.statd "${list[@]}" ; do + sed "${sedexp[@]}" "${FILESDIR}/${f}.initd" > "${T}/init.d/${f}" || die + doinitd "${T}/init.d/${f}" + done + + local systemd_systemunitdir="$(systemd_get_systemunitdir)" + sed -i \ + -e 's:/usr/sbin/rpc.statd:/sbin/rpc.statd:' \ + "${ED}${systemd_systemunitdir}"/* || die + + # Remove legacy service if not requested (as it will be broken without rpcbind) + if ! use nfsv3; then + rm "${ED}${systemd_systemunitdir}/nfs-server.service" || die + fi + + # bug #368505 + keepdir /var/lib/nfs + # bug #603628 + keepdir /var/lib/nfs/v4recovery + + # No static archives + find "${ED}" -name '*.la' -delete || die +} + +pkg_postinst() { + # Install default xtab and friends if there's none existing. In + # src_install we put them in /usr/lib/nfs for safe-keeping, but + # the daemons actually use the files in /var/lib/nfs. #30486 + local f + for f in "${EROOT}"/usr/$(get_libdir)/nfs/*; do + [[ -e ${EROOT}/var/lib/nfs/${f##*/} ]] && continue + einfo "Copying default ${f##*/} from ${EPREFIX}/usr/$(get_libdir)/nfs to ${EPREFIX}/var/lib/nfs" + cp -pPR "${f}" "${EROOT}"/var/lib/nfs/ + done +} diff --git a/net-fs/nfs-utils/nfs-utils-2.8.5.ebuild b/net-fs/nfs-utils/nfs-utils-2.8.5.ebuild new file mode 100644 index 000000000000..fe82595b0b31 --- /dev/null +++ b/net-fs/nfs-utils/nfs-utils-2.8.5.ebuild @@ -0,0 +1,219 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools linux-info systemd + +DESCRIPTION="NFS client and server daemons" +HOMEPAGE="http://linux-nfs.org/ https://git.linux-nfs.org/?p=steved/nfs-utils.git" + +if [[ ${PV} == *_rc* ]] ; then + MY_PV="$(ver_rs 1- -)" + SRC_URI="http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=snapshot;h=refs/tags/${PN}-${MY_PV};sf=tgz -> ${P}.tar.gz" + S="${WORKDIR}/${PN}-${PN}-${MY_PV}" +else + SRC_URI="https://downloads.sourceforge.net/nfs/${P}.tar.bz2" + KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86" +fi + +LICENSE="GPL-2" +SLOT="0" +IUSE="caps junction kerberos ldap +libmount nfsdctl +nfsv3 +nfsv4 sasl selinux tcpd +uuid" +REQUIRED_USE="|| ( nfsv3 nfsv4 ) kerberos? ( nfsv4 )" +# bug #315573 +RESTRICT="test" + +# kth-krb doesn't provide the right include +# files, and nfs-utils doesn't build against heimdal either, +# so don't depend on virtual/krb. +# (04 Feb 2005 agriffis) +COMMON_DEPEND=" + dev-libs/libxml2:= + net-libs/libtirpc:= + sys-fs/e2fsprogs + dev-db/sqlite:3 + dev-libs/libevent:= + caps? ( sys-libs/libcap ) + ldap? ( + net-nds/openldap:= + sasl? ( + app-crypt/mit-krb5 + dev-libs/cyrus-sasl:2 + ) + ) + libmount? ( sys-apps/util-linux ) + nfsdctl? ( + >=dev-libs/libnl-3.1:3 + sys-libs/readline:= + ) + nfsv3? ( >=net-nds/rpcbind-0.2.4 ) + nfsv4? ( + >=sys-apps/keyutils-1.5.9:= + sys-fs/lvm2 + kerberos? ( + >=net-libs/libtirpc-0.2.4-r1[kerberos] + app-crypt/mit-krb5 + ) + ) + tcpd? ( sys-apps/tcp-wrappers ) + uuid? ( sys-apps/util-linux )" +DEPEND="${COMMON_DEPEND} + elibc_musl? ( sys-libs/queue-standalone ) +" +RDEPEND="${COMMON_DEPEND} + !net-libs/libnfsidmap + selinux? ( + sec-policy/selinux-rpc + nfsv3? ( sec-policy/selinux-rpcbind ) + ) +" +BDEPEND=" + net-libs/rpcsvc-proto + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-2.5.2-no-werror.patch + "${FILESDIR}"/${PN}-udev-sysctl.patch + "${FILESDIR}"/${PN}-2.6.4-C99-inline.patch +) + +pkg_setup() { + linux-info_pkg_setup + + if use nfsv4 && linux_config_exists && ! linux_chkconfig_present CRYPTO_MD5 ; then + ewarn "Your NFS server will be unable to track clients across server restarts!" + ewarn "Please enable CONFIG_CRYPTO_MD5 in your kernel to" + ewarn "support the legacy, in-kernel client tracker." + fi +} + +src_prepare() { + default + + sed \ + -e "/^sbindir/s:= := \"${EPREFIX}\":g" \ + -i utils/*/Makefile.am || die + + eautoreconf +} + +src_configure() { + # Our DEPEND forces this. + export libsqlite3_cv_is_recent=yes + export ac_cv_header_keyutils_h=$(usex nfsv4) + + # SASL is consumed in a purely automagic way + export ac_cv_header_sasl_h=no + export ac_cv_header_sasl_sasl_h=$(usex sasl) + + local myeconfargs=( + --disable-static + --with-statedir="${EPREFIX}"/var/lib/nfs + --enable-tirpc + --with-tirpcinclude="${ESYSROOT}"/usr/include/tirpc/ + --with-pluginpath="${EPREFIX}"/usr/$(get_libdir)/libnfsidmap + --with-rpcgen + --with-systemd="$(systemd_get_systemunitdir)" + --without-gssglue + $(use_enable caps) + --enable-ipv6 + $(use_enable junction) + $(use_enable kerberos gss) + $(use_enable kerberos svcgss) + $(use_enable ldap) + $(use_enable libmount libmount-mount) + $(use_enable nfsdctl) + $(use_enable nfsv4) + $(use_enable nfsv4 blkmapd) + $(use_enable nfsv4 nfsdcld) + $(use_enable nfsv4 nfsdcltrack) + $(use_enable nfsv4 nfsv4server) + $(use_enable uuid) + $(use_with kerberos krb5 "${ESYSROOT}"/usr) + $(use_with tcpd tcp-wrappers) + ) + econf "${myeconfargs[@]}" +} + +src_compile() { + # Remove compiled files bundled in the tarball + emake clean + + default +} + +src_install() { + default + rm linux-nfs/Makefile* || die + dodoc -r linux-nfs README + + # Don't overwrite existing xtab/etab, install the original + # versions somewhere safe... more info in pkg_postinst + keepdir /var/lib/nfs/{,sm,sm.bak} + mv "${ED}"/var/lib/nfs "${ED}"/usr/$(get_libdir)/ || die + + # Install some client-side binaries in /sbin + dodir /sbin + mv "${ED}"/usr/sbin/rpc.statd "${ED}"/sbin/ || die + + if use nfsv4 ; then + insinto /etc + doins support/nfsidmap/idmapd.conf + + # Install a config file for idmappers in newer kernels. bug #415625 + insinto /etc/request-key.d + echo 'create id_resolver * * /usr/sbin/nfsidmap -t 600 %k %d' > id_resolver.conf + doins id_resolver.conf + fi + + insinto /etc + doins "${FILESDIR}"/exports + keepdir /etc/exports.d + + local f list=() + if use nfsv4 ; then + list+=( rpc.idmapd rpc.pipefs ) + use kerberos && list+=( rpc.gssd rpc.svcgssd ) + fi + + local sedexp=( -e '#placehoder' ) + use nfsv3 || sedexp+=( -e '/need portmap/d' ) + + mkdir -p "${T}/init.d" || die + for f in nfs nfsclient rpc.statd "${list[@]}" ; do + sed "${sedexp[@]}" "${FILESDIR}/${f}.initd" > "${T}/init.d/${f}" || die + doinitd "${T}/init.d/${f}" + done + + local systemd_systemunitdir="$(systemd_get_systemunitdir)" + sed -i \ + -e 's:/usr/sbin/rpc.statd:/sbin/rpc.statd:' \ + "${ED}${systemd_systemunitdir}"/* || die + + # Remove legacy service if not requested (as it will be broken without rpcbind) + if ! use nfsv3; then + rm "${ED}${systemd_systemunitdir}/nfs-server.service" || die + fi + + # bug #368505 + keepdir /var/lib/nfs + # bug #603628 + keepdir /var/lib/nfs/v4recovery + + # No static archives + find "${ED}" -name '*.la' -delete || die +} + +pkg_postinst() { + # Install default xtab and friends if there's none existing. In + # src_install we put them in /usr/lib/nfs for safe-keeping, but + # the daemons actually use the files in /var/lib/nfs. #30486 + local f + for f in "${EROOT}"/usr/$(get_libdir)/nfs/*; do + [[ -e ${EROOT}/var/lib/nfs/${f##*/} ]] && continue + einfo "Copying default ${f##*/} from ${EPREFIX}/usr/$(get_libdir)/nfs to ${EPREFIX}/var/lib/nfs" + cp -pPR "${f}" "${EROOT}"/var/lib/nfs/ + done +} diff --git a/net-fs/nfs4-acl-tools/Manifest b/net-fs/nfs4-acl-tools/Manifest new file mode 100644 index 000000000000..25bd68beedfd --- /dev/null +++ b/net-fs/nfs4-acl-tools/Manifest @@ -0,0 +1,3 @@ +DIST nfs4-acl-tools-0.3.7.tar.gz 99139 BLAKE2B 5125fca65ee7b9dcea16e9b633bbfc26aa5c74202412119f138a5c47ae67d8f8e72fd4eb43182aaf3119858eb83fe6f24f6b53abc0b448aca04c3de4043ad9c1 SHA512 3922bced4e74891b0c4ea10a03eec0cc2e531de355776ba364a91bd656a78d19f9cfba026face34331841ee7c8609f12084fc10081601bc65aaf0fb008ca2fc6 +DIST nfs4-acl-tools-0.4.2.tar.gz 171197 BLAKE2B 2722063ef020a0933e277de7e971a2e255a7cb8db8b074b07ae5186f7e1b55da56cbe27b9c1aaed090a1b44e0b7e4547fdce83e182b5c654d32cbe23e960d8fc SHA512 ba78f4efda513b50ca0191ff239d87eb595f56013d9310f492491ea7fd0a25eefaf5f5f48efdfbb7173771585bb2785aedfd44688575f47cf42ee3a9a0229544 +DIST nfs4-acl-tools-0.4.3_rc1.tar.gz 57832 BLAKE2B 4738a423b09a7b5f71b5f3bbab1c184d0361ff1bc4de3eab0b251113dc4728feba91360225eaf6d6f70fa0c1e322b084dc0e567e2c5ed25a05200ae4398e0b2f SHA512 7445e91f869abc928623ca9eddadedbaf4fd2086cbd85e55178dc6e14b5cac99ee89ffb71ba87628b5a905f9e6052530a1f4e8bb9a5546420319d4c3cc7e86da diff --git a/net-fs/nfs4-acl-tools/files/nfs4-acl-tools-0.3.5-jobserver-unavailable.patch b/net-fs/nfs4-acl-tools/files/nfs4-acl-tools-0.3.5-jobserver-unavailable.patch new file mode 100644 index 000000000000..746d585d6cad --- /dev/null +++ b/net-fs/nfs4-acl-tools/files/nfs4-acl-tools-0.3.5-jobserver-unavailable.patch @@ -0,0 +1,24 @@ +Fix + +* gmake[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule. + +--- a/include/buildmacros ++++ b/include/buildmacros +@@ -152,7 +152,7 @@ INSTALL_LINGUAS = \ + endif + + SUBDIRS_MAKERULE = \ +- @for d in $(SUBDIRS) ""; do \ ++ @+for d in $(SUBDIRS) ""; do \ + if test -d "$$d" -a ! -z "$$d"; then \ + $(ECHO) === $$d ===; \ + $(MAKEF) -C $$d $@ || exit $$?; \ +@@ -170,7 +170,7 @@ DIST_MAKERULE = \ + $(MAKEF) -C build dist + + SOURCE_MAKERULE = \ +- @test -z "$$DIR" && DIR="."; \ ++ @+test -z "$$DIR" && DIR="."; \ + for f in $(SRCFILES) ""; do \ + if test ! -z "$$f"; then $(ECHO) $$DIR/$$f; fi;\ + done; \ diff --git a/net-fs/nfs4-acl-tools/files/nfs4-acl-tools-0.3.7-libtool.patch b/net-fs/nfs4-acl-tools/files/nfs4-acl-tools-0.3.7-libtool.patch new file mode 100644 index 000000000000..7eb4d67e552d --- /dev/null +++ b/net-fs/nfs4-acl-tools/files/nfs4-acl-tools-0.3.7-libtool.patch @@ -0,0 +1,74 @@ +https://bugs.gentoo.org/731162 + +From 2abd5015bf6bac1697ac4422d76fa121a49f2b24 Mon Sep 17 00:00:00 2001 +From: orbea <orbea@riseup.net> +Date: Fri, 17 Jun 2022 12:36:01 -0700 +Subject: [PATCH] configure: Add missing LT_INIT + +Otherwise it fails to generate libtool for the build breaking the build +when using a different toolchain than the system libtool. It also breaks +the build with rlibtool which depends on the generated libtool to +determine if it should build static or shared libraries. + +The existing make and libtool tests were removed as unnecessary and +problematic. +--- a/configure.ac ++++ b/configure.ac +@@ -9,6 +9,9 @@ AC_ARG_ENABLE(shared, + enable_shared=no) + AC_SUBST(enable_shared) + ++LT_INIT ++ ++AC_PROG_LIBTOOL + AC_PROG_INSTALL + AC_PROG_CC + +--- a/include/builddefs.in ++++ b/include/builddefs.in +@@ -39,6 +39,8 @@ DEBUG = @debug_build@ + OPTIMIZER = @opt_build@ + MALLOCLIB = @malloc_lib@ + ++top_builddir = $(TOPDIR) ++ + LIBNFS4ACL = $(TOPDIR)/libnfs4acl/libnfs4acl.la + LIBATTR = @libattr@ + +@@ -68,7 +70,6 @@ AWK = @awk@ + SED = @sed@ + TAR = @tar@ + ZIP = @zip@ +-MAKE = @make@ + ECHO = @echo@ + SORT = @sort@ + LN_S = @LN_S@ +--- a/m4/package_utilies.m4 ++++ b/m4/package_utilies.m4 +@@ -22,26 +22,6 @@ AC_DEFUN([AC_PACKAGE_UTILITIES], + AC_SUBST(cc) + AC_PACKAGE_NEED_UTILITY($1, "$cc", cc, [C compiler]) + +- if test -z "$MAKE"; then +- AC_PATH_PROG(MAKE, gmake,, /usr/bin:/usr/freeware/bin) +- fi +- if test -z "$MAKE"; then +- AC_PATH_PROG(MAKE, make,, /usr/bin) +- fi +- make=$MAKE +- AC_SUBST(make) +- AC_PACKAGE_NEED_UTILITY($1, "$make", make, [GNU make]) +- +- if test -z "$LIBTOOL"; then +- AC_PATH_PROG(LIBTOOL, glibtool,, /usr/bin) +- fi +- if test -z "$LIBTOOL"; then +- AC_PATH_PROG(LIBTOOL, libtool,, /usr/bin:/usr/local/bin:/usr/freeware/bin) +- fi +- libtool=$LIBTOOL +- AC_SUBST(libtool) +- AC_PACKAGE_NEED_UTILITY($1, "$libtool", libtool, [GNU libtool]) +- + if test -z "$TAR"; then + AC_PATH_PROG(TAR, tar,, /usr/freeware/bin:/bin:/usr/local/bin:/usr/bin) + fi diff --git a/net-fs/nfs4-acl-tools/files/nfs4-acl-tools-0.4.2-libattr.patch b/net-fs/nfs4-acl-tools/files/nfs4-acl-tools-0.4.2-libattr.patch new file mode 100644 index 000000000000..f7ea55f8bfbc --- /dev/null +++ b/net-fs/nfs4-acl-tools/files/nfs4-acl-tools-0.4.2-libattr.patch @@ -0,0 +1,34 @@ +diff --git a/configure.ac b/configure.ac +index 3337575..3612f92 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -13,7 +13,7 @@ AC_PROG_INSTALL + AC_PROG_CC + + AC_CHECK_HEADERS([netinet/in.h stdlib.h string.h unistd.h]) +-AC_CHECK_HEADERS([attr/xattr.h sys/xattr.h]) ++AC_CHECK_HEADERS([sys/xattr.h]) + + AC_C_CONST + AC_TYPE_UID_T +diff --git a/m4/package_attrdev.m4 b/m4/package_attrdev.m4 +index eecdd34..4ec4f66 100644 +--- a/m4/package_attrdev.m4 ++++ b/m4/package_attrdev.m4 +@@ -9,7 +9,7 @@ AC_DEFUN([AC_PACKAGE_NEED_GETXATTR_LIBATTR], + libattr="-lattr" + test -f `pwd`/../attr/libattr/libattr.la && \ + libattr="`pwd`/../attr/libattr/libattr.la" +- test -f /usr/lib/libattr.la && libattr="/usr/lib/libattr.la" ++ test -f ${libdir}/libattr.la && libattr="${libdir}/libattr.la" + AC_SUBST(libattr) + ]) + +@@ -24,6 +24,6 @@ AC_DEFUN([AC_PACKAGE_NEED_ATTRGET_LIBATTR], + libattr="-lattr" + test -f `pwd`/../attr/libattr/libattr.la && \ + libattr="`pwd`/../attr/libattr/libattr.la" +- test -f /usr/lib/libattr.la && libattr="/usr/lib/libattr.la" ++ test -f ${libdir}/libattr.la && libattr="${libdir}/libattr.la" + AC_SUBST(libattr) + ]) diff --git a/net-fs/nfs4-acl-tools/metadata.xml b/net-fs/nfs4-acl-tools/metadata.xml new file mode 100644 index 000000000000..73dda144f9ac --- /dev/null +++ b/net-fs/nfs4-acl-tools/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="project"> + <email>base-system@gentoo.org</email> + <name>Gentoo Base System</name> +</maintainer> +</pkgmetadata> diff --git a/net-fs/nfs4-acl-tools/nfs4-acl-tools-0.3.7-r1.ebuild b/net-fs/nfs4-acl-tools/nfs4-acl-tools-0.3.7-r1.ebuild new file mode 100644 index 000000000000..7ae1f656f761 --- /dev/null +++ b/net-fs/nfs4-acl-tools/nfs4-acl-tools-0.3.7-r1.ebuild @@ -0,0 +1,30 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools + +DESCRIPTION="Commandline and GUI tools that deal directly with NFSv4 ACLs" +HOMEPAGE="https://git.linux-nfs.org/?p=bfields/nfs4-acl-tools.git;a=summary" +SRC_URI="https://linux-nfs.org/~bfields/${PN}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +RDEPEND="sys-apps/attr" +DEPEND=" + ${RDEPEND} + elibc_musl? ( sys-libs/queue-standalone ) +" + +PATCHES=( + "${FILESDIR}"/${P}-libtool.patch # bug #731162 + "${FILESDIR}"/${PN}-0.3.5-jobserver-unavailable.patch +) + +src_prepare() { + default + eautoreconf +} diff --git a/net-fs/nfs4-acl-tools/nfs4-acl-tools-0.4.2.ebuild b/net-fs/nfs4-acl-tools/nfs4-acl-tools-0.4.2.ebuild new file mode 100644 index 000000000000..000cce8072fb --- /dev/null +++ b/net-fs/nfs4-acl-tools/nfs4-acl-tools-0.4.2.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools + +DESCRIPTION="Commandline and GUI tools that deal directly with NFSv4 ACLs" +HOMEPAGE="https://git.linux-nfs.org/?p=steved/nfs4-acl-tools.git;a=summary" +if [[ ${PV} != *_rc* ]] ; then + SRC_URI=" + https://linux-nfs.org/~steved/${PN}/${P}.tar.gz + " + KEYWORDS="~amd64 ~x86" +else + SRC_URI=" + https://git.linux-nfs.org/?p=steved/nfs4-acl-tools.git;a=snapshot;h=refs/tags/${P/_/-};sf=tgz + -> ${P}.tar.gz + " + S="${WORKDIR}/${PN}-${P/_/-}" +fi + +LICENSE="GPL-2" +SLOT="0" + +RESTRICT="test" + +RDEPEND="sys-apps/attr" +DEPEND=" + ${RDEPEND} + elibc_musl? ( sys-libs/queue-standalone ) +" + +PATCHES=( + "${FILESDIR}/${PN}-0.3.7-libtool.patch" # bug #731162 + "${FILESDIR}/${PN}-0.3.5-jobserver-unavailable.patch" + "${FILESDIR}/${PN}-0.4.2-libattr.patch" +) + +src_prepare() { + default + eautoreconf +} diff --git a/net-fs/nfs4-acl-tools/nfs4-acl-tools-0.4.3_rc1.ebuild b/net-fs/nfs4-acl-tools/nfs4-acl-tools-0.4.3_rc1.ebuild new file mode 100644 index 000000000000..01732f05fadc --- /dev/null +++ b/net-fs/nfs4-acl-tools/nfs4-acl-tools-0.4.3_rc1.ebuild @@ -0,0 +1,49 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools + +DESCRIPTION="Commandline and GUI tools that deal directly with NFSv4 ACLs" +HOMEPAGE="https://git.linux-nfs.org/?p=steved/nfs4-acl-tools.git;a=summary" +if [[ ${PV} != *_rc* ]] ; then + SRC_URI=" + https://linux-nfs.org/~steved/${PN}/${P}.tar.gz + " + # KEYWORDS="~amd64 ~x86" +else + SRC_URI=" + https://git.linux-nfs.org/?p=steved/nfs4-acl-tools.git;a=snapshot;h=refs/tags/${P/_/-};sf=tgz + -> ${P}.tar.gz + " + S="${WORKDIR}/${PN}-${P/_/-}" +fi + +LICENSE="GPL-2" +SLOT="0" + +# TODO only for 0.4.3_rc1 +# - it has minimal changes compared to 0.4.2 +# - no new release since 2022-11-22 +# - so we might as well keyword this as well +KEYWORDS="~amd64 ~x86" + +RESTRICT="test" + +RDEPEND="sys-apps/attr" +DEPEND=" + ${RDEPEND} + elibc_musl? ( sys-libs/queue-standalone ) +" + +PATCHES=( + "${FILESDIR}/${PN}-0.3.7-libtool.patch" # bug #731162 + "${FILESDIR}/${PN}-0.3.5-jobserver-unavailable.patch" + "${FILESDIR}/${PN}-0.4.2-libattr.patch" +) + +src_prepare() { + default + eautoreconf +} diff --git a/net-fs/openafs/Manifest b/net-fs/openafs/Manifest new file mode 100644 index 000000000000..094e5b4b6290 --- /dev/null +++ b/net-fs/openafs/Manifest @@ -0,0 +1,10 @@ +DIST openafs-1.8.13-doc.tar.bz2 3779824 BLAKE2B aab4d57df918061982614ea83b1b5de08d1b851e6a141957ae5c5f68f558994725eee6623479659729df92d6cb9058120179107058ab8974b36701420bfce48e SHA512 df95f26a24829f82f86896d20d47da2e9b5bcb7ecf9d24cb5ab0b956733e67d6bd2021bc4b52d6734ad1aacfd2e22a5a15a3acc5f14a401bb7f4f83f52251f1e +DIST openafs-1.8.13-src.tar.bz2 15053864 BLAKE2B 83c62197b7825e46f733a593e096494a234607b0fa17ee30717b42740e1ebb13f43e11986cf39e950e79f867ed3ab40d1c80ab7aa79a153ffd9d8f3b1cde307a SHA512 f2b60b3942ba21a4f0fd837dfda1a9659ebe4d2f96edfbe7162e97faa8c5887fbea8fdef958af396356b78793f06e6744566a1aa6b70df2164c9ab37c06e2cd9 +DIST openafs-1.8.13.1-doc.tar.bz2 3781663 BLAKE2B f7bc8750456cd61cf1d2b5737fa4f0b3b319bfb79d0517ed82f551e31118313ea64baff738b8ad380a64d4f02bb8df1425af4ca8cfb690d7be31ec29c68d8866 SHA512 f297fa2e6d8dbff1566f11e54ba88b171e56e2fdfba373b0852f3036411c99c4e1e2cfd83705512fa1ff64ac2e6e008df15fd291208c9d15c53d393fac21c96f +DIST openafs-1.8.13.1-src.tar.bz2 15046870 BLAKE2B aeed6e0a8caab9614e0980b362f806856bb3f3340865e9197986314f8219b14b78c38f0ff05d71169716de7614b10e318561377982969945a420bca4679ebd32 SHA512 705978208e69f43a87153c6c343722a0fc3d9aacbedfaca161f260dd0a8806b9dd23f81686dbd13b62ce9b787dbf860e60e035bed7e2d26ea21576b495764c41 +DIST openafs-1.8.13.2-doc.tar.bz2 3782680 BLAKE2B 10c3cc49ba6ec3515e952c2b7b712a107f04bea20f6904a0f594542e7a59d42b154a16b66d0fd85ea16d9485d01c7a25838e1caa88b55e0ca1278edc71dc3c51 SHA512 07e167fa3d90f9a2798c295a176d74eb99d39194f1ffaa33fb0bdc829bd24a689aa89ab397cb66425b4472059ab748f42e9ea54750ad725cf291469f5c9684c6 +DIST openafs-1.8.13.2-src.tar.bz2 15048865 BLAKE2B 57e077cce2abc5837f8ac4896aec3dd946669b8d9440b587cfb3bfd53e7b14b2c65502deabb5fe7149e80df495a4292c747eaa9ccecf38736a1e4e2257c673cf SHA512 c4cf202090f9222ab4b71a5d5d7875210cc25c67534dbc28c6fe8b942b28a8ef953f2090493e2fb95c551a4b4cbb6d5ede88675607161a5459d8693c8a0802ad +DIST openafs-1.8.14-doc.tar.bz2 3783151 BLAKE2B 2f73bb08328ad649e1cd45c9f5f861c8fa76576f6571f48858dfb670625c9d778af6d23dd72f0c75fb3144f2d1edfc30c40783f238efe0a8cc06d94d2c331392 SHA512 09689acdcae19a0c2588729c618a64b14ae83a70c35ffa52538ec6348e1abe021550561ed64c02e51ee4869240741bb3fbc06d3446cb548f474cad8424c1720e +DIST openafs-1.8.14-src.tar.bz2 15133794 BLAKE2B 943c3dd1116fa8270990fef7fb4f6cbb2080a120185a6d56c3b9e8d2ae93064b81ed498e0bd11fc7bcc57d2b121965532fb5a48e7a9c59d1eba347598c580c06 SHA512 86838bdfacff19017d422872ea24476dae8320c462c59a56793280b6c8c8679129a3badc6b014814057cbaa35f8f977d504e2782fb31c8f9dd5d23e9744a561c +DIST openafs-1.8.15-doc.tar.bz2 3786697 BLAKE2B 020403ae3e28e2ff3c51fff6d90818fc761e6b0d66ba00208884266a8726c5daf615c28ced2709f911bd49206b7cd989690cbbe365e133fd27a20fff45d40dd9 SHA512 6dec82a933151cf6f2655970c1fc369340ad81bb9e81d06af4a81f39d8eb8cd7dadae73ff2c2fa8c72fff61f0272aea5c9095ac47c51561d9c3708ceb11801be +DIST openafs-1.8.15-src.tar.bz2 15135878 BLAKE2B 0729cb4577f1b5be13b91f03b930c32b8b4dbd6e16474507d34e1eb8e9b5657b87d937caa9ef276a660801bd0860d96558a54f273c9af6c7c75b02dd97ea6b93 SHA512 4ab1add9a59580cd6f67e285e38bdf8dbe43c7e0a5a862566c0a3b94501e82d4e1a3454c3de49813949f1e47311884c530bc445b7d36277a62e17e2834a42f64 diff --git a/net-fs/openafs/files/0001-autoconf-use-AC_CHECK_TOOL-for-as-and-ld.patch b/net-fs/openafs/files/0001-autoconf-use-AC_CHECK_TOOL-for-as-and-ld.patch new file mode 100644 index 000000000000..ed9a4872dd8e --- /dev/null +++ b/net-fs/openafs/files/0001-autoconf-use-AC_CHECK_TOOL-for-as-and-ld.patch @@ -0,0 +1,54 @@ +From 393604963bcfd51b8bc2282fb86c0274abcea89f Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Mon, 22 Feb 2021 11:08:39 -0700 +Subject: [PATCH 01/13] autoconf: use AC_CHECK_TOOL for as and ld + +Some platforms use the GNU target triplet as a prefix to the toolchain +utilities (e.g. x86_64-pc-linux-gnu-as) to allow the use of alternative +toolchains, cross-compiling, etc. + +The Gentoo Linux distribution has a mode of building packages +(-native-symlinks) where the toolchain utilities only exist as their +prefixed names (e.g. 'as' does not exist, but 'x86_64_pc-linux-gnu-as' +does). This results in configure failing to locate the tools when using +AC_CHECK_PROGS. (Gentoo uses the --host and --build configure +parameters to specify the prefix names for the tools). + +Replace AC_CHECK_PROGS with AC_CHECK_TOOL for the toolchain related +commands 'as' and 'ld'. + +AC_CHECK_TOOL works like AC_CHECK_PROGS but it will also look for +the program with a prefix (specified by using configure's --host +parameter). + +Note: libtool.m4 runs AC_CHECK_TOOL for ar. + +Change-Id: I8005c765d213b7d1d6292a7dd80f10a3d0e2ec68 +Reviewed-on: https://gerrit.openafs.org/14544 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 268025f841f1a2bd16b802459a8b590939331bcd) +--- + src/cf/osconf.m4 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 +index 843998542e85..aee81cfdb274 100644 +--- a/src/cf/osconf.m4 ++++ b/src/cf/osconf.m4 +@@ -25,10 +25,10 @@ PAM_OPTMZ= + + dnl standard programs + AC_PROG_RANLIB +-AC_CHECK_PROGS(AS, as, [false]) ++AC_CHECK_TOOL(AS, as, [false]) + AC_CHECK_PROGS(MV, mv, [false]) + AC_CHECK_PROGS(RM, rm, [false]) +-AC_CHECK_PROGS(LD, ld, [false]) ++AC_CHECK_TOOL(LD, ld, [false]) + AC_CHECK_PROGS(CP, cp, [false]) + AC_CHECK_PROGS(GENCAT, gencat, [false]) + +-- +2.45.2 + diff --git a/net-fs/openafs/files/0002-pam-paths.patch b/net-fs/openafs/files/0002-pam-paths.patch new file mode 100644 index 000000000000..95265a125519 --- /dev/null +++ b/net-fs/openafs/files/0002-pam-paths.patch @@ -0,0 +1,46 @@ +From d5a01932f821ab8ef9e21ff0857c744326f9c494 Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Tue, 1 Jan 2019 01:32:37 +0300 +Subject: [PATCH 02/13] pam-paths + +(cherry picked from commit ccb2133f6fa61b51d9ad65086c83a9740506d19f) +(cherry picked from commit bd72ed729d5a17a4d135476f977b619615b64e0e) +(cherry picked from commit 56caeaf664505c2b59d8a0fb323dd582a109d35b) +--- + src/pam/Makefile.in | 2 +- + src/pam/afs_util.h | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/pam/Makefile.in b/src/pam/Makefile.in +index f4f066618f79..c335e81ec657 100644 +--- a/src/pam/Makefile.in ++++ b/src/pam/Makefile.in +@@ -31,7 +31,7 @@ LT_libs = \ + + INSTALL_KAUTH = @INSTALL_KAUTH@ + +-MODULE_CFLAGS=${PAM_CFLAGS} ++MODULE_CFLAGS=${PAM_CFLAGS} -DBINDIR='"${bindir}"' + + all: test_pam pam_afs.la pam_afs.krb.la + +diff --git a/src/pam/afs_util.h b/src/pam/afs_util.h +index 56a42457be7c..ac2b01ca5126 100644 +--- a/src/pam/afs_util.h ++++ b/src/pam/afs_util.h +@@ -24,9 +24,9 @@ extern int do_klog(const char *user, const char *password, + const char *lifetime, const char *cell_name); + extern afs_int32 getPAG(void); + +-#define KLOG "/usr/afsws/bin/klog" +-#define KLOGKRB "/usr/afsws/bin/klog.krb" +-#define UNLOG "/usr/afsws/bin/unlog" ++#define KLOG BINDIR "/klog" ++#define KLOGKRB BINDIR "/klog.krb" ++#define UNLOG BINDIR "/unlog" + #define IGNORE_MAX 1000 + + #if defined(AFS_HPUX_ENV) +-- +2.45.2 + diff --git a/net-fs/openafs/files/0003-fbsd.patch b/net-fs/openafs/files/0003-fbsd.patch new file mode 100644 index 000000000000..5d6363bca737 --- /dev/null +++ b/net-fs/openafs/files/0003-fbsd.patch @@ -0,0 +1,28 @@ +From 5191eb2c1d896a9d87a031cb78235d1586f17d8f Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Tue, 1 Jan 2019 10:15:37 +0300 +Subject: [PATCH 03/13] fbsd + +(cherry picked from commit 53a84d83b375483439d79e9d7dc150401f2477a8) +(cherry picked from commit 6d3c928ae95773f8cfbb801c7b000fa1f03d72c2) +(cherry picked from commit ea2741bd13e0b0ebdb3687e831ed242a7ea67457) +--- + src/comerr/Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/comerr/Makefile.in b/src/comerr/Makefile.in +index a867e1ae15b7..556adb3e7133 100644 +--- a/src/comerr/Makefile.in ++++ b/src/comerr/Makefile.in +@@ -40,7 +40,7 @@ compile_et: compile_et.o error_table.o + *_linux* | *_umlinux* | *_darwin* | rs_aix72 | rs_aix73 ) \ + $(LT_LDRULE_static_NOQ) compile_et.o error_table.o -L${TOP_LIBDIR} -lopr $(buildtool_roken) $(MT_LIBS);; \ + * ) \ +- $(LT_LDRULE_static_NOQ) compile_et.o error_table.o -L${TOP_LIBDIR} -lopr -ll $(buildtool_roken) $(MT_LIBS);; \ ++ $(LT_LDRULE_static_NOQ) compile_et.o error_table.o -L${TOP_LIBDIR} -lopr -lfl $(buildtool_roken) $(MT_LIBS);; \ + esac + + libafscom_err.a: $(LT_objs) +-- +2.45.2 + diff --git a/net-fs/openafs/files/0004-sparc.patch b/net-fs/openafs/files/0004-sparc.patch new file mode 100644 index 000000000000..9a101679321f --- /dev/null +++ b/net-fs/openafs/files/0004-sparc.patch @@ -0,0 +1,59 @@ +From bab62364812662c0f0f66436eec3a4c7b6f9d586 Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Tue, 1 Jan 2019 10:16:25 +0300 +Subject: [PATCH 04/13] sparc + +(cherry picked from commit 96739d61d6c8be1feabad0227ede3baa19519aaa) +(cherry picked from commit 002c44ca274baddb358bdb73870cbd20b304264d) +(cherry picked from commit 01a13e7b282ab6d58fdfa3d1a90c60fac925b7c6) +--- + src/afs/LINUX/osi_probe.c | 6 ++++++ + src/cf/linux-test4.m4 | 6 +++--- + 2 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/src/afs/LINUX/osi_probe.c b/src/afs/LINUX/osi_probe.c +index be42ecf85ee3..59e6ab46b1ec 100644 +--- a/src/afs/LINUX/osi_probe.c ++++ b/src/afs/LINUX/osi_probe.c +@@ -231,7 +231,9 @@ extern int kallsyms_address_to_symbol(unsigned long address, + ) __attribute__((weak)); + #endif + ++#ifdef LINUX_EXPORTS_SYS_CALL_TABLE + extern SYSCALLTYPE sys_call_table[] __attribute__((weak)); ++#endif + extern SYSCALLTYPE ia32_sys_call_table[] __attribute__((weak)); + extern SYSCALLTYPE sys_call_table32[] __attribute__((weak)); + extern SYSCALLTYPE sys_call_table_emu[] __attribute__((weak)); +@@ -496,7 +498,11 @@ static probectl main_probe = { + 0, + #endif + ++#ifdef LINUX_EXPORTS_SYS_CALL_TABLE + sys_call_table, /* weak symbol ref */ ++#else ++ 0, ++#endif + 0, 0, /* module parameter answers */ + #ifdef AFS_LINUX_sys_call_table + AFS_LINUX_sys_call_table, /* compiled-in answer, if any */ +diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 +index b22930690e4d..08552def3fc9 100644 +--- a/src/cf/linux-test4.m4 ++++ b/src/cf/linux-test4.m4 +@@ -67,9 +67,9 @@ AC_DEFUN([LINUX_EXPORTS_SYS_CALL_TABLE], [ + AC_CHECK_LINUX_BUILD([for exported sys_call_table], + [ac_cv_linux_exports_sys_call_table], + [#include <linux/modversions.h>], +-[#ifndef __ver_sys_call_table +-#error sys_call_table not exported +-#endif], ++[ ++extern SYSCALLTYPE sys_call_table[] __attribute__((weak)); ++], + [EXPORTED_SYS_CALL_TABLE], + [define if your linux kernel exports sys_call_table], + []) +-- +2.45.2 + diff --git a/net-fs/openafs/files/0005-uname.patch b/net-fs/openafs/files/0005-uname.patch new file mode 100644 index 000000000000..4fdc83249490 --- /dev/null +++ b/net-fs/openafs/files/0005-uname.patch @@ -0,0 +1,37 @@ +From 5379cb53e1486674bd6f51c5771143a5806f770b Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Tue, 1 Jan 2019 10:25:47 +0300 +Subject: [PATCH 05/13] uname + +(cherry picked from commit 020c6c42bf001b53f054cafbde739a71d4f07508) +(cherry picked from commit 99d126271f3302e84252a980639f9e6f39ef8208) +(cherry picked from commit 14bed4c153e5cbc551587a6de76a453be2e6d9d1) +--- + src/cf/sysname.m4 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/cf/sysname.m4 b/src/cf/sysname.m4 +index aa4ad2cb4287..2991097d0337 100644 +--- a/src/cf/sysname.m4 ++++ b/src/cf/sysname.m4 +@@ -270,7 +270,7 @@ else + AFS_SYSNAME="ia64_linuxXX" + ;; + powerpc-*-linux*) +- AFS_SYSNAME="`/bin/arch`_linuxXX" ++ AFS_SYSNAME="`uname -m`_linuxXX" + ;; + powerpc64-*-linux*) + AFS_SYSNAME="ppc64_linuxXX" +@@ -288,7 +288,7 @@ else + AFS_SYSNAME="s390x_linuxXX" + ;; + sparc-*-linux*) +- AFS_SYSNAME="`/bin/arch`_linuxXX" ++ AFS_SYSNAME="`uname -m`_linuxXX" + ;; + sparc64-*-linux*) + AFS_SYSNAME="sparc64_linuxXX" +-- +2.45.2 + diff --git a/net-fs/openafs/files/0006-resolv.patch b/net-fs/openafs/files/0006-resolv.patch new file mode 100644 index 000000000000..4d77d81a9b1a --- /dev/null +++ b/net-fs/openafs/files/0006-resolv.patch @@ -0,0 +1,32 @@ +From 77fcdf422542d01610c36d1167cc59410bcc5e3a Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Tue, 1 Jan 2019 10:27:13 +0300 +Subject: [PATCH 06/13] resolv + +(cherry picked from commit 911939ee76440e2f23e5867cbf3f5991167e4ec8) +(cherry picked from commit 577dc93125df68e3853cf934e412a6daf9e636f3) +(cherry picked from commit 0bd7623ef05bbaa7dd30405007250d1e2dc86c1b) +--- + src/cf/osconf.m4 | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 +index aee81cfdb274..bd2ac89b728c 100644 +--- a/src/cf/osconf.m4 ++++ b/src/cf/osconf.m4 +@@ -582,6 +582,12 @@ if test "x$enable_optimize_kernel" = "x" ; then + [enable_optimize_kernel=yes]) + fi + ++case $AFS_SYSNAME in ++ *linux*) ++ MT_LIBS="${MT_LIBS} -lresolv" ++ ;; ++esac ++ + # + # Special build targets + # +-- +2.45.2 + diff --git a/net-fs/openafs/files/0007-afsauthent-symbols.patch b/net-fs/openafs/files/0007-afsauthent-symbols.patch new file mode 100644 index 000000000000..fcdabd155aff --- /dev/null +++ b/net-fs/openafs/files/0007-afsauthent-symbols.patch @@ -0,0 +1,27 @@ +From 6fd3ca877e3095a93e9c25381e53a792ceb24160 Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Tue, 1 Jan 2019 11:12:56 +0300 +Subject: [PATCH 07/13] afsauthent-symbols + +(cherry picked from commit a443fcbbe03ff0d6c9b790cfd9283cd0952d3a0b) +(cherry picked from commit bebe3f25a63dd7365e10c1bbc588168fd448a4d8) +(cherry picked from commit c5de3eed6bea7ba33cd612e7dd2246509ab4dd6e) +--- + src/util/liboafs_util.la.sym | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/util/liboafs_util.la.sym b/src/util/liboafs_util.la.sym +index 04842e6ebf76..0f83ff5faaac 100644 +--- a/src/util/liboafs_util.la.sym ++++ b/src/util/liboafs_util.la.sym +@@ -13,6 +13,7 @@ Int32To_ktimeRelDate + LogCommandLine + LogLevel + LogThreadNum ++ka_GetAFSTicket + OpenLog + ReOpenLog + SetLogThreadNumProgram +-- +2.45.2 + diff --git a/net-fs/openafs/files/0008-flags.patch b/net-fs/openafs/files/0008-flags.patch new file mode 100644 index 000000000000..c0778d9441d1 --- /dev/null +++ b/net-fs/openafs/files/0008-flags.patch @@ -0,0 +1,33 @@ +From 4c317307b7985ec48e0fe6fb8a5764ef0e2041ae Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Fri, 4 Jan 2019 07:02:07 +0300 +Subject: [PATCH 08/13] flags + +(cherry picked from commit c46c9e03ba1464eecae7c974461c982ee00f5000) +(cherry picked from commit 08b0d7d40710ac49cd8f4904b0985c9e5cdd88c5) +(cherry picked from commit f00970cc1339971101d753c2a8fa3f414782a695) +--- + src/config/Makefile.config.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/config/Makefile.config.in b/src/config/Makefile.config.in +index d4b9063dac54..8039bec1dc04 100644 +--- a/src/config/Makefile.config.in ++++ b/src/config/Makefile.config.in +@@ -219,11 +219,11 @@ COMPILE_ET_C=${COMPILE_ET} -emit c + COMMON_INCL=$(MODULE_INCLUDE) -I${TOP_OBJDIR}/src/config -I${TOP_INCDIR} \ + -I${srcdir} -I. + +-COMMON_CFLAGS=$(CFLAGS) ${DBG} ${OPTMZ} $(XCFLAGS) \ ++COMMON_CFLAGS=$(CFLAGS) $(XCFLAGS) \ + ${COMMON_INCL} ${INCLUDE_LIBINTL} \ + $(CPPFLAGS_roken) $(ARCHFLAGS) + +-COMMON_LDFLAGS=$(LDFLAGS) $(LDFLAGS_hcrypto) $(LDFLAGS_roken) $(DBG) $(OPTMZ) ++COMMON_LDFLAGS=$(LDFLAGS) $(LDFLAGS_hcrypto) $(LDFLAGS_roken) + + # LWP Flags + LWP_CFLAGS=$(MODULE_CFLAGS) $(COMMON_CFLAGS) +-- +2.45.2 + diff --git a/net-fs/openafs/files/0009-docbook2pdf.patch b/net-fs/openafs/files/0009-docbook2pdf.patch new file mode 100644 index 000000000000..384ba828e46c --- /dev/null +++ b/net-fs/openafs/files/0009-docbook2pdf.patch @@ -0,0 +1,127 @@ +From 4501337bab87ec8724ae45fa50713584a211fb3a Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Fri, 4 Jan 2019 16:37:35 +0300 +Subject: [PATCH 09/13] docbook2pdf + +Jadetex based converters require jadetex tuning: + save_size=50000 + max_strings=1000000 + pool_size=2000000 + hash_extra=150000 +Otherwise TeX will run out of its capacity during large PDFs +generation. + +docbook2pdf needs to ignore an ID reference value which no element +has as its ID: + -e no-idref +This is already done by other converters implicitly. + +(cherry picked from commit c81ef9c4109eb1bfc9cb42d952b9d5240f3d713b) +(cherry picked from commit c4515998db6078ccf82fad23b774bc243ba1f020) +(cherry picked from commit 876c27c8fb7cc3c80e31d3e642a7727313b4f0c0) +--- + doc/xml/AdminGuide/Makefile.in | 5 ++++- + doc/xml/AdminRef/Makefile.in | 5 ++++- + doc/xml/QuickStartUnix/Makefile.in | 5 ++++- + doc/xml/UserGuide/Makefile.in | 5 ++++- + 4 files changed, 16 insertions(+), 4 deletions(-) + +diff --git a/doc/xml/AdminGuide/Makefile.in b/doc/xml/AdminGuide/Makefile.in +index caf48ac66828..6763e95c8849 100644 +--- a/doc/xml/AdminGuide/Makefile.in ++++ b/doc/xml/AdminGuide/Makefile.in +@@ -32,6 +32,7 @@ XSLTPROC = @XSLTPROC@ + DOCBOOK2PDF = @DOCBOOK2PDF@ + KINDLEGEN = @KINDLEGEN@ + DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub ++TEXOPTS = save_size=50000 max_strings=1000000 pool_size=2000000 hash_extra=150000 + + index.html: $(SRCS) + $(XSLTPROC) --param navig.graphics 1 \ +@@ -42,8 +43,10 @@ $(BOOK).pdf: $(SRCS) + if test "x$(DOCBOOK2PDF)" = "xfop"; then \ + $(XSLTPROC) $(DOCBOOK_STYLESHEETS)/fo/docbook.xsl $(BOOK).xml > $(BOOK).fo; \ + $(DOCBOOK2PDF) $(BOOK).fo $(BOOK).pdf; \ ++ elif test "x$(DOCBOOK2PDF)" = "xdocbook2pdf"; then \ ++ $(TEXOPTS) $(DOCBOOK2PDF) -e no-idref $(BOOK).xml; \ + else \ +- $(DOCBOOK2PDF) $(BOOK).xml; \ ++ $(TEXOPTS) $(DOCBOOK2PDF) $(BOOK).xml; \ + fi + + $(BOOK).epub: $(SRCS) +diff --git a/doc/xml/AdminRef/Makefile.in b/doc/xml/AdminRef/Makefile.in +index a9d78d6a5515..c13c26965d73 100644 +--- a/doc/xml/AdminRef/Makefile.in ++++ b/doc/xml/AdminRef/Makefile.in +@@ -15,6 +15,7 @@ XSLTPROC = @XSLTPROC@ --stringparam variablelist.as.blocks 1 --param use.id.as.f + DOCBOOK2PDF = @DOCBOOK2PDF@ + DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub + KINDLEGEN = @KINDLEGEN@ ++TEXOPTS = save_size=50000 max_strings=1000000 pool_size=2000000 hash_extra=150000 + + entities.dtd sect1.xml sect5.xml sect8.xml: + ./generate-xml.pl $(TOP_SRCDIR) +@@ -23,8 +24,10 @@ $(BOOK).pdf: $(SRCS) + if test "x$(DOCBOOK2PDF)" = "xfop"; then \ + $(XSLTPROC) $(DOCBOOK_STYLESHEETS)/fo/docbook.xsl $(BOOK).xml > $(BOOK).fo; \ + $(DOCBOOK2PDF) $(BOOK).fo $(BOOK).pdf; \ ++ elif test "x$(DOCBOOK2PDF)" = "xdocbook2pdf"; then \ ++ $(TEXOPTS) $(DOCBOOK2PDF) -e no-idref $(BOOK).xml; \ + else \ +- $(DOCBOOK2PDF) $(BOOK).xml; \ ++ $(TEXOPTS) $(DOCBOOK2PDF) $(BOOK).xml; \ + fi + + $(BOOK).epub: $(SRCS) +diff --git a/doc/xml/QuickStartUnix/Makefile.in b/doc/xml/QuickStartUnix/Makefile.in +index b309015ce283..c52a171babea 100644 +--- a/doc/xml/QuickStartUnix/Makefile.in ++++ b/doc/xml/QuickStartUnix/Makefile.in +@@ -30,6 +30,7 @@ XSLTPROC = @XSLTPROC@ + DOCBOOK2PDF = @DOCBOOK2PDF@ + DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub + KINDLEGEN = @KINDLEGEN@ ++TEXOPTS = save_size=50000 max_strings=1000000 pool_size=2000000 hash_extra=150000 + + index.html: $(SRCS) + $(XSLTPROC) --param navig.graphics 1 \ +@@ -40,8 +41,10 @@ $(BOOK).pdf: $(SRCS) + if test "x$(DOCBOOK2PDF)" = "xfop"; then \ + $(XSLTPROC) $(DOCBOOK_STYLESHEETS)/fo/docbook.xsl $(BOOK).xml > $(BOOK).fo; \ + $(DOCBOOK2PDF) $(BOOK).fo $(BOOK).pdf; \ ++ elif test "x$(DOCBOOK2PDF)" = "xdocbook2pdf"; then \ ++ $(TEXOPTS) $(DOCBOOK2PDF) -e no-idref $(BOOK).xml; \ + else \ +- $(DOCBOOK2PDF) $(BOOK).xml; \ ++ $(TEXOPTS) $(DOCBOOK2PDF) $(BOOK).xml; \ + fi + + $(BOOK).epub: $(SRCS) +diff --git a/doc/xml/UserGuide/Makefile.in b/doc/xml/UserGuide/Makefile.in +index 1a0fe66d6255..5dfc7d44e253 100644 +--- a/doc/xml/UserGuide/Makefile.in ++++ b/doc/xml/UserGuide/Makefile.in +@@ -30,6 +30,7 @@ XSLTPROC = @XSLTPROC@ + DOCBOOK2PDF = @DOCBOOK2PDF@ + DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub + KINDLEGEN = @KINDLEGEN@ ++TEXOPTS = save_size=50000 max_strings=1000000 pool_size=2000000 hash_extra=150000 + + index.html: $(SRCS) + $(XSLTPROC) --param navig.graphics 1 \ +@@ -40,8 +41,10 @@ $(BOOK).pdf: $(SRCS) + if test "x$(DOCBOOK2PDF)" = "xfop"; then \ + $(XSLTPROC) $(DOCBOOK_STYLESHEETS)/fo/docbook.xsl $(BOOK).xml > $(BOOK).fo; \ + $(DOCBOOK2PDF) $(BOOK).fo $(BOOK).pdf; \ ++ elif test "x$(DOCBOOK2PDF)" = "xdocbook2pdf"; then \ ++ $(TEXOPTS) $(DOCBOOK2PDF) -e no-idref $(BOOK).xml; \ + else \ +- $(DOCBOOK2PDF) $(BOOK).xml; \ ++ $(TEXOPTS) $(DOCBOOK2PDF) $(BOOK).xml; \ + fi + + $(BOOK).epub: $(SRCS) +-- +2.45.2 + diff --git a/net-fs/openafs/files/0009-openafs-1.8.14-docbook2pdf.patch b/net-fs/openafs/files/0009-openafs-1.8.14-docbook2pdf.patch new file mode 100644 index 000000000000..9c18fc04ec81 --- /dev/null +++ b/net-fs/openafs/files/0009-openafs-1.8.14-docbook2pdf.patch @@ -0,0 +1,109 @@ +From 4501337bab87ec8724ae45fa50713584a211fb3a Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Fri, 4 Jan 2019 16:37:35 +0300 +Subject: [PATCH 09/13] docbook2pdf + +Jadetex based converters require jadetex tuning: + save_size=50000 + max_strings=1000000 + pool_size=2000000 + hash_extra=150000 +Otherwise TeX will run out of its capacity during large PDFs +generation. + +docbook2pdf needs to ignore an ID reference value which no element +has as its ID: + -e no-idref +This is already done by other converters implicitly. + +(cherry picked from commit c81ef9c4109eb1bfc9cb42d952b9d5240f3d713b) +(cherry picked from commit c4515998db6078ccf82fad23b774bc243ba1f020) +(cherry picked from commit 876c27c8fb7cc3c80e31d3e642a7727313b4f0c0) +--- a/doc/xml/AdminGuide/Makefile.in ++++ b/doc/xml/AdminGuide/Makefile.in +@@ -33,6 +33,7 @@ XSLTPROC = @XSLTPROC@ + DOCBOOK2PDF = @DOCBOOK2PDF@ + KINDLEGEN = @KINDLEGEN@ + DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub ++TEXOPTS = save_size=50000 max_strings=1000000 pool_size=2000000 hash_extra=150000 + + XSL_FLAGS = --path '@abs_builddir@' + +@@ -48,8 +49,10 @@ $(BOOK).pdf: $(SRCS) + $(XSLTPROC) $(DOCBOOK_STYLESHEETS)/fo/docbook.xsl \ + $(srcdir)/$(BOOK).xml > $(BOOK).fo; \ + $(DOCBOOK2PDF) $(BOOK).fo $(BOOK).pdf; \ ++ elif test "x$(DOCBOOK2PDF)" = "xdocbook2pdf"; then \ ++ $(TEXOPTS) $(DOCBOOK2PDF) -e no-idref $(BOOK).xml; \ + else \ +- $(DOCBOOK2PDF) --output=$@ --xslt-opts="$(XSL_FLAGS)" \ ++ $(TEXOPTS) $(DOCBOOK2PDF) --output=$@ --xslt-opts="$(XSL_FLAGS)" \ + $(srcdir)/$(BOOK).xml; \ + fi + +--- a/doc/xml/AdminRef/Makefile.in ++++ b/doc/xml/AdminRef/Makefile.in +@@ -16,6 +16,7 @@ XSLTPROC = @XSLTPROC@ --stringparam variablelist.as.blocks 1 --param use.id.as.f + DOCBOOK2PDF = @DOCBOOK2PDF@ + DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub + KINDLEGEN = @KINDLEGEN@ ++TEXOPTS = save_size=50000 max_strings=1000000 pool_size=2000000 hash_extra=150000 + + XSL_FLAGS = --path '@abs_builddir@' + +@@ -28,8 +29,10 @@ $(BOOK).pdf: $(SRCS) + $(DOCBOOK_STYLESHEETS)/fo/docbook.xsl \ + $(srcdir)/$(BOOK).xml > $(BOOK).fo; \ + $(DOCBOOK2PDF) $(BOOK).fo $(BOOK).pdf; \ ++ elif test "x$(DOCBOOK2PDF)" = "xdocbook2pdf"; then \ ++ $(TEXOPTS) $(DOCBOOK2PDF) -e no-idref $(BOOK).xml; \ + else \ +- $(DOCBOOK2PDF) --output=$@ --xslt-opts="$(XSL_FLAGS)" \ ++ $(TEXOPTS) $(DOCBOOK2PDF) --output=$@ --xslt-opts="$(XSL_FLAGS)" \ + $(srcdir)/$(BOOK).xml; \ + fi + +--- a/doc/xml/QuickStartUnix/Makefile.in ++++ b/doc/xml/QuickStartUnix/Makefile.in +@@ -31,6 +31,7 @@ XSLTPROC = @XSLTPROC@ + DOCBOOK2PDF = @DOCBOOK2PDF@ + DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub + KINDLEGEN = @KINDLEGEN@ ++TEXOPTS = save_size=50000 max_strings=1000000 pool_size=2000000 hash_extra=150000 + + XSL_FLAGS = --path '@abs_builddir@' + +@@ -47,8 +48,10 @@ $(BOOK).pdf: $(SRCS) + $(DOCBOOK_STYLESHEETS)/fo/docbook.xsl \ + $(srcdir)/$(BOOK).xml > $(BOOK).fo; \ + $(DOCBOOK2PDF) $(BOOK).fo $(BOOK).pdf; \ ++ elif test "x$(DOCBOOK2PDF)" = "xdocbook2pdf"; then \ ++ $(TEXOPTS) $(DOCBOOK2PDF) -e no-idref $(BOOK).xml; \ + else \ +- $(DOCBOOK2PDF) --output=$@ --xslt-opts="$(XSL_FLAGS)" \ ++ $(TEXOPTS) $(DOCBOOK2PDF) --output=$@ --xslt-opts="$(XSL_FLAGS)" \ + $(srcdir)/$(BOOK).xml; \ + fi + +--- a/doc/xml/UserGuide/Makefile.in ++++ b/doc/xml/UserGuide/Makefile.in +@@ -31,6 +31,7 @@ XSLTPROC = @XSLTPROC@ + DOCBOOK2PDF = @DOCBOOK2PDF@ + DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub + KINDLEGEN = @KINDLEGEN@ ++TEXOPTS = save_size=50000 max_strings=1000000 pool_size=2000000 hash_extra=150000 + + XSL_FLAGS = --path '@abs_builddir@' + +@@ -47,8 +48,10 @@ $(BOOK).pdf: $(SRCS) + $(DOCBOOK_STYLESHEETS)/fo/docbook.xsl \ + $(srcdir)/$(BOOK).xml > $(BOOK).fo; \ + $(DOCBOOK2PDF) $(BOOK).fo $(BOOK).pdf; \ ++ elif test "x$(DOCBOOK2PDF)" = "xdocbook2pdf"; then \ ++ $(TEXOPTS) $(DOCBOOK2PDF) -e no-idref $(BOOK).xml; \ + else \ +- $(DOCBOOK2PDF) --output=$@ --xslt-opts="$(XSL_FLAGS)" \ ++ $(TEXOPTS) $(DOCBOOK2PDF) --output=$@ --xslt-opts="$(XSL_FLAGS)" \ + $(srcdir)/$(BOOK).xml; \ + fi + diff --git a/net-fs/openafs/files/0010-libperl.patch b/net-fs/openafs/files/0010-libperl.patch new file mode 100644 index 000000000000..b73ccf19e400 --- /dev/null +++ b/net-fs/openafs/files/0010-libperl.patch @@ -0,0 +1,31 @@ +From b9bd06a715cf2a68c73d6bdf57d475ae5d1d61d5 Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Sat, 5 Jan 2019 10:15:03 +0300 +Subject: [PATCH 10/13] libperl + +Filter out -lnsl reported by perl. +libnsl it is neither needed nor provided. + +(cherry picked from commit 243186f42cc84af2ff90f6710c6e76b1a4121064) +(cherry picked from commit 99183cb191e653288ed8ed656ecd9f484a1715e3) +(cherry picked from commit e27f7a255c4f064c149d57ed965523ef9932f436) +--- + src/libuafs/Makefile.common.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/libuafs/Makefile.common.in b/src/libuafs/Makefile.common.in +index 941605027176..eca360777151 100644 +--- a/src/libuafs/Makefile.common.in ++++ b/src/libuafs/Makefile.common.in +@@ -142,7 +142,7 @@ RX =../rx + AFSINT=../afsint + LIB =../lib + SWIG_PERL_CFLAGS = -fPIC `perl -MExtUtils::Embed -e ccopts` +-SWIG_PERL_LDFLAGS = -fPIC `perl -MExtUtils::Embed -e ldopts` ++SWIG_PERL_LDFLAGS = -fPIC `perl -MExtUtils::Embed -e ldopts | sed "s/-lnsl //g"` + SWIG = @SWIG@ + LIBUAFS_BUILD_PERL = @LIBUAFS_BUILD_PERL@ + +-- +2.45.2 + diff --git a/net-fs/openafs/files/0011-xbsa.patch b/net-fs/openafs/files/0011-xbsa.patch new file mode 100644 index 000000000000..cba3e37a39e6 --- /dev/null +++ b/net-fs/openafs/files/0011-xbsa.patch @@ -0,0 +1,31 @@ +From 523c217f8f1002814a54b2818ebb4490c3d2aa01 Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gentoo.org> +Date: Sun, 13 Sep 2020 10:15:51 +0300 +Subject: [PATCH 11/13] xbsa + +When xbsa (tsm) support is enabled, butxInfo is defined in the +butc_xbsa.h, so it should not be redefined here, otherwise multiple +definitions of the butxInfo symbol error will occur. + +(cherry picked from commit 032844997f8c57168b91550c929ac1dd6544bafa) +(cherry picked from commit 84c3422235048eea573f103adb9e2e22b7be2ca1) +--- + src/butc/lwps.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/butc/lwps.c b/src/butc/lwps.c +index 3078d738238f..9769862bf0aa 100644 +--- a/src/butc/lwps.c ++++ b/src/butc/lwps.c +@@ -53,7 +53,7 @@ extern int forcemultiple; + /* XBSA Global Parameters */ + extern afs_int32 xbsaType; + #ifdef xbsa +-struct butx_transactionInfo butxInfo; ++extern struct butx_transactionInfo butxInfo; + #endif + + static struct TapeBlock { /* A 16KB tapeblock */ +-- +2.45.2 + diff --git a/net-fs/openafs/files/0012-xml-dtd.patch b/net-fs/openafs/files/0012-xml-dtd.patch new file mode 100644 index 000000000000..5e4ed0ba0088 --- /dev/null +++ b/net-fs/openafs/files/0012-xml-dtd.patch @@ -0,0 +1,67 @@ +From 689b5b3b684210356f5764dbb28145aa5a4b70f9 Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gentoo.org> +Date: Sun, 12 Dec 2021 01:04:10 +0300 +Subject: [PATCH 12/13] xml-dtd + +Fix xml docs to use local dtd files. +Network should not be accessed during build. + +(cherry picked from commit 1cb479e32a055bd8786a8d0487a04ebdd104222b) +--- + doc/xml/AdminGuide/auagd000.xml | 2 +- + doc/xml/AdminRef/auarf000.xml | 2 +- + doc/xml/QuickStartUnix/auqbg000.xml | 2 +- + doc/xml/UserGuide/auusg000.xml | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/doc/xml/AdminGuide/auagd000.xml b/doc/xml/AdminGuide/auagd000.xml +index 6d5690dbea85..ebe52c452b58 100644 +--- a/doc/xml/AdminGuide/auagd000.xml ++++ b/doc/xml/AdminGuide/auagd000.xml +@@ -1,6 +1,6 @@ + <?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.3//EN" +- "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ++ "/usr/share/sgml/docbook/xml-dtd-4.3/docbookx.dtd" [ + <!ENTITY version SYSTEM "version.xml"> + <!ENTITY preface SYSTEM "auagd005.xml"> + <!ENTITY chapter1 SYSTEM "auagd006.xml"> +diff --git a/doc/xml/AdminRef/auarf000.xml b/doc/xml/AdminRef/auarf000.xml +index 6cbe7dce9f97..c52f6b10a70f 100644 +--- a/doc/xml/AdminRef/auarf000.xml ++++ b/doc/xml/AdminRef/auarf000.xml +@@ -1,6 +1,6 @@ + <?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.3//EN" +- "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ++ "/usr/share/sgml/docbook/xml-dtd-4.3/docbookx.dtd" [ + <!ENTITY version SYSTEM "version.xml"> + <!ENTITY preface SYSTEM "preface.xml"> + <!ENTITY sect1 SYSTEM "sect1.xml"> +diff --git a/doc/xml/QuickStartUnix/auqbg000.xml b/doc/xml/QuickStartUnix/auqbg000.xml +index 7c225bac2855..86fa6f91640a 100644 +--- a/doc/xml/QuickStartUnix/auqbg000.xml ++++ b/doc/xml/QuickStartUnix/auqbg000.xml +@@ -1,6 +1,6 @@ + <?xml version="1.0" encoding="utf-8"?> + <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.3//EN" +- "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ++ "/usr/share/sgml/docbook/xml-dtd-4.3/docbookx.dtd" [ + <!ENTITY version SYSTEM "version.xml"> + <!ENTITY preface SYSTEM "auqbg003.xml"> + <!ENTITY chapter1 SYSTEM "auqbg004.xml"> +diff --git a/doc/xml/UserGuide/auusg000.xml b/doc/xml/UserGuide/auusg000.xml +index ffb965045bec..cf0e8e9c7455 100644 +--- a/doc/xml/UserGuide/auusg000.xml ++++ b/doc/xml/UserGuide/auusg000.xml +@@ -1,6 +1,6 @@ + <?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.3//EN" +- "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ++ "/usr/share/sgml/docbook/xml-dtd-4.3/docbookx.dtd" [ + <!ENTITY version SYSTEM "version.xml"> + <!ENTITY preface SYSTEM "auusg003.xml"> + <!ENTITY chapter1 SYSTEM "auusg004.xml"> +-- +2.45.2 + diff --git a/net-fs/openafs/files/0013-kernel-cc-ld.patch b/net-fs/openafs/files/0013-kernel-cc-ld.patch new file mode 100644 index 000000000000..fd55f63e7714 --- /dev/null +++ b/net-fs/openafs/files/0013-kernel-cc-ld.patch @@ -0,0 +1,47 @@ +From d6035d97bdf4c87a19cda7553d8a4713b04b47c3 Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gentoo.org> +Date: Sun, 12 Dec 2021 01:06:18 +0300 +Subject: [PATCH 13/13] kernel-cc-ld + +Pass custom $CC and $LD to kernel during both configure check and build. +Otherwise hosts without `gcc` and `ld` wrappers will fail configure. + +See Gentoo bug 828951. + +(cherry picked from commit d4676024fe7b2dfac413e6509caccd13f94ac28d) +--- + src/cf/linux-test1.m4 | 4 ++-- + src/libafs/MakefileProto.LINUX.in | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/cf/linux-test1.m4 b/src/cf/linux-test1.m4 +index 010a4464f25a..0d0eb4c798fc 100644 +--- a/src/cf/linux-test1.m4 ++++ b/src/cf/linux-test1.m4 +@@ -24,8 +24,8 @@ $2 + + MODULE_LICENSE("http://www.openafs.org/dl/license10.html"); + _ACEOF +- echo make -C $LINUX_KERNEL_BUILD M=$SRCDIR_PARENT/conftest.dir $SPARSE_MAKEFLAGS modules KBUILD_VERBOSE=1 >&AS_MESSAGE_LOG_FD && +- make -C $LINUX_KERNEL_BUILD M=$SRCDIR_PARENT/conftest.dir $SPARSE_MAKEFLAGS modules KBUILD_VERBOSE=1 >&AS_MESSAGE_LOG_FD 2>conftest.err && ++ echo make -C $LINUX_KERNEL_BUILD M=$SRCDIR_PARENT/conftest.dir $SPARSE_MAKEFLAGS modules KBUILD_VERBOSE=1 CC="${CC}" LD="${LD}" >&AS_MESSAGE_LOG_FD && ++ make -C $LINUX_KERNEL_BUILD M=$SRCDIR_PARENT/conftest.dir modules $SPARSE_MAKEFLAGS KBUILD_VERBOSE=1 CC="${CC}" LD="${LD}" >&AS_MESSAGE_LOG_FD 2>conftest.err && + ! grep -i "WARNING: .* undefined!$" conftest.err >/dev/null 2>&1 + then [$3] + else +diff --git a/src/libafs/MakefileProto.LINUX.in b/src/libafs/MakefileProto.LINUX.in +index 6e62c8c97fe1..3d188127afbe 100644 +--- a/src/libafs/MakefileProto.LINUX.in ++++ b/src/libafs/MakefileProto.LINUX.in +@@ -324,7 +324,7 @@ ${LIBAFS} ${LIBAFS_MP} ${LIBAFS_EP} ${LIBAFS_BM}: ${LINUX_LIBAFS_NAME}.ko + ${LINUX_LIBAFS_NAME}.ko afspag.ko: .FORCE + env EXTRA_CFLAGS="${EXTRA_CFLAGS}" @TOP_SRCDIR@/libafs/make_kbuild_makefile.pl ${KDIR} $@ @TOP_OBJDIR@/src/config/Makefile.config Makefile.afs Makefile.common + ( env EXTRA_CFLAGS="${EXTRA_CFLAGS}" \ +- $(MAKE) -C ${LINUX_KERNEL_BUILD} M=@TOP_OBJDIR@/src/libafs/${KDIR} $(SPARSE_MAKEFLAGS) modules 2>&1 \ ++ $(MAKE) -C ${LINUX_KERNEL_BUILD} M=@TOP_OBJDIR@/src/libafs/${KDIR} $(SPARSE_MAKEFLAGS) CC="${CC}" LD="${LD}" modules 2>&1 \ + || echo "FAILURE: make exit code $$?" ) | tee .makelog + @if grep -E -q '^(FAILURE|WARNING)' .makelog; then \ + grep -q '^WARNING' .makelog && echo "Error: Undefined symbols in modules" ; \ +-- +2.45.2 + diff --git a/net-fs/openafs/files/0014-upstream-struct-init.patch b/net-fs/openafs/files/0014-upstream-struct-init.patch new file mode 100644 index 000000000000..e25e4898f570 --- /dev/null +++ b/net-fs/openafs/files/0014-upstream-struct-init.patch @@ -0,0 +1,354 @@ +From 9e612ba7bf1ccea8158ae38b5d687d8d78e1630e Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Wed, 26 Feb 2025 08:03:18 -0700 +Subject: [PATCH 1/2] Convert HAVE_STRUCT_LABEL_SUPPORT to AFS_STRUCT_INIT + +The OpenAFS coding style allows the use of designated initializers for +structs, however not all supported platforms have compilers that support +it. + +The preprocessor define HAVE_STRUCT_LABEL_SUPPORT has been available for +use so structure initialization can be set up to support compilers that +do have designated initializers support. + +The typical use is: + + struct foo x = { + #ifndef HAVE_STRUCT_LABEL_SUPPORT + val1, + val2, + ... + #else + .mem1 = val1, + .mem2 = val2, + ... + #endif + }; + +This results in extra lines of code where errors can easily be +introduced. + +Create a macro, AFS_STRUCT_INIT, that uses designated initializers when +available, so the above example would be: + + struct foo x = { + AFS_STRUCT_INIT(.mem1, val1), + AFS_STRUCT_INIT(.mem2, val2), + ... + }; + +Convert the initialization of structures that are using the +HAVE_STRUCT_LABEL_SUPPORT define to use AFS_STRUCT_INIT. + +Note, there is still a requirement that the order of initializers match +the order of the elements within the structure, but it should be easier +to verify that the initializers are in the proper order. + +Use a consistent alignment, and add trailing comma on the last +element. + +There are no functional changes made by this commit. + +Reviewed-on: https://gerrit.openafs.org/16289 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> +Reviewed-by: Mark Vitale <mvitale@sinenomine.net> +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +(cherry picked from commit 7c28b99490b75475ed9130526c536ae0e354e064) + +Change-Id: I8faa4b497f2962bdd0a4ecb559e8b9288fd5c796 +--- + src/afs/afs_dcache.c | 66 ++++++++++++---------------------------- + src/afs/afs_fetchstore.c | 54 ++++++++++---------------------- + src/config/stds.h | 6 ++++ + src/rx/xdr_len.c | 28 +++++------------ + src/rx/xdr_mem.c | 28 +++++------------ + src/rx/xdr_rx.c | 28 +++++------------ + 6 files changed, 66 insertions(+), 144 deletions(-) + +diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c +index 35fd5947325d..e41ba8ff3a8e 100644 +--- a/src/afs/afs_dcache.c ++++ b/src/afs/afs_dcache.c +@@ -104,55 +104,29 @@ afs_int32 afs_dcentries; /*!< In-memory dcache entries */ + int dcacheDisabled = 0; + + struct afs_cacheOps afs_UfsCacheOps = { +-#ifndef HAVE_STRUCT_LABEL_SUPPORT +- osi_UFSOpen, +- osi_UFSTruncate, +- afs_osi_Read, +- afs_osi_Write, +- osi_UFSClose, +- afs_UFSReadUIO, +- afs_UFSWriteUIO, +- afs_UFSGetDSlot, +- afs_UFSGetVolSlot, +- afs_UFSHandleLink, +-#else +- .open = osi_UFSOpen, +- .truncate = osi_UFSTruncate, +- .fread = afs_osi_Read, +- .fwrite = afs_osi_Write, +- .close = osi_UFSClose, +- .vreadUIO = afs_UFSReadUIO, +- .vwriteUIO = afs_UFSWriteUIO, +- .GetDSlot = afs_UFSGetDSlot, +- .GetVolSlot = afs_UFSGetVolSlot, +- .HandleLink = afs_UFSHandleLink, +-#endif ++ AFS_STRUCT_INIT(.open, osi_UFSOpen), ++ AFS_STRUCT_INIT(.truncate, osi_UFSTruncate), ++ AFS_STRUCT_INIT(.fread, afs_osi_Read), ++ AFS_STRUCT_INIT(.fwrite, afs_osi_Write), ++ AFS_STRUCT_INIT(.close, osi_UFSClose), ++ AFS_STRUCT_INIT(.vreadUIO, afs_UFSReadUIO), ++ AFS_STRUCT_INIT(.vwriteUIO, afs_UFSWriteUIO), ++ AFS_STRUCT_INIT(.GetDSlot, afs_UFSGetDSlot), ++ AFS_STRUCT_INIT(.GetVolSlot, afs_UFSGetVolSlot), ++ AFS_STRUCT_INIT(.HandleLink, afs_UFSHandleLink), + }; + + struct afs_cacheOps afs_MemCacheOps = { +-#ifndef HAVE_STRUCT_LABEL_SUPPORT +- afs_MemCacheOpen, +- afs_MemCacheTruncate, +- afs_MemReadBlk, +- afs_MemWriteBlk, +- afs_MemCacheClose, +- afs_MemReadUIO, +- afs_MemWriteUIO, +- afs_MemGetDSlot, +- afs_MemGetVolSlot, +- afs_MemHandleLink, +-#else +- .open = afs_MemCacheOpen, +- .truncate = afs_MemCacheTruncate, +- .fread = afs_MemReadBlk, +- .fwrite = afs_MemWriteBlk, +- .close = afs_MemCacheClose, +- .vreadUIO = afs_MemReadUIO, +- .vwriteUIO = afs_MemWriteUIO, +- .GetDSlot = afs_MemGetDSlot, +- .GetVolSlot = afs_MemGetVolSlot, +- .HandleLink = afs_MemHandleLink, +-#endif ++ AFS_STRUCT_INIT(.open, afs_MemCacheOpen), ++ AFS_STRUCT_INIT(.truncate, afs_MemCacheTruncate), ++ AFS_STRUCT_INIT(.fread, afs_MemReadBlk), ++ AFS_STRUCT_INIT(.fwrite, afs_MemWriteBlk), ++ AFS_STRUCT_INIT(.close, afs_MemCacheClose), ++ AFS_STRUCT_INIT(.vreadUIO, afs_MemReadUIO), ++ AFS_STRUCT_INIT(.vwriteUIO, afs_MemWriteUIO), ++ AFS_STRUCT_INIT(.GetDSlot, afs_MemGetDSlot), ++ AFS_STRUCT_INIT(.GetVolSlot, afs_MemGetVolSlot), ++ AFS_STRUCT_INIT(.HandleLink, afs_MemHandleLink), + }; + + int cacheDiskType; /*Type of backing disk for cache */ +diff --git a/src/afs/afs_fetchstore.c b/src/afs/afs_fetchstore.c +index 97d0671811dc..5baf371a2c6a 100644 +--- a/src/afs/afs_fetchstore.c ++++ b/src/afs/afs_fetchstore.c +@@ -309,48 +309,26 @@ afs_GenericStoreProc(struct storeOps *ops, void *rock, + + static + struct storeOps rxfs_storeUfsOps = { +-#ifndef HAVE_STRUCT_LABEL_SUPPORT +- rxfs_storeUfsPrepare, +- rxfs_storeUfsRead, +- rxfs_storeUfsWrite, +- rxfs_storeStatus, +- rxfs_storePadd, +- rxfs_storeClose, +- rxfs_storeDestroy, +- afs_GenericStoreProc +-#else +- .prepare = rxfs_storeUfsPrepare, +- .read = rxfs_storeUfsRead, +- .write = rxfs_storeUfsWrite, +- .status = rxfs_storeStatus, +- .padd = rxfs_storePadd, +- .close = rxfs_storeClose, +- .destroy = rxfs_storeDestroy, +- .storeproc = afs_GenericStoreProc +-#endif ++ AFS_STRUCT_INIT(.prepare, rxfs_storeUfsPrepare), ++ AFS_STRUCT_INIT(.read, rxfs_storeUfsRead), ++ AFS_STRUCT_INIT(.write, rxfs_storeUfsWrite), ++ AFS_STRUCT_INIT(.status, rxfs_storeStatus), ++ AFS_STRUCT_INIT(.padd, rxfs_storePadd), ++ AFS_STRUCT_INIT(.close, rxfs_storeClose), ++ AFS_STRUCT_INIT(.destroy, rxfs_storeDestroy), ++ AFS_STRUCT_INIT(.storeproc, afs_GenericStoreProc), + }; + + static + struct storeOps rxfs_storeMemOps = { +-#ifndef HAVE_STRUCT_LABEL_SUPPORT +- rxfs_storeMemPrepare, +- rxfs_storeMemRead, +- rxfs_storeMemWrite, +- rxfs_storeStatus, +- rxfs_storePadd, +- rxfs_storeClose, +- rxfs_storeDestroy, +- afs_GenericStoreProc +-#else +- .prepare = rxfs_storeMemPrepare, +- .read = rxfs_storeMemRead, +- .write = rxfs_storeMemWrite, +- .status = rxfs_storeStatus, +- .padd = rxfs_storePadd, +- .close = rxfs_storeClose, +- .destroy = rxfs_storeDestroy, +- .storeproc = afs_GenericStoreProc +-#endif ++ AFS_STRUCT_INIT(.prepare, rxfs_storeMemPrepare), ++ AFS_STRUCT_INIT(.read, rxfs_storeMemRead), ++ AFS_STRUCT_INIT(.write, rxfs_storeMemWrite), ++ AFS_STRUCT_INIT(.status, rxfs_storeStatus), ++ AFS_STRUCT_INIT(.padd, rxfs_storePadd), ++ AFS_STRUCT_INIT(.close, rxfs_storeClose), ++ AFS_STRUCT_INIT(.destroy, rxfs_storeDestroy), ++ AFS_STRUCT_INIT(.storeproc, afs_GenericStoreProc), + }; + + static afs_int32 +diff --git a/src/config/stds.h b/src/config/stds.h +index 8ae68343458b..ae030149f6d2 100644 +--- a/src/config/stds.h ++++ b/src/config/stds.h +@@ -305,6 +305,12 @@ hdr_static_inline(unsigned long long) afs_printable_uint64_lu(afs_uint64 d) { re + # define AFS_FALLTHROUGH do {} while(0) + #endif + ++#if defined(HAVE_STRUCT_LABEL_SUPPORT) ++# define AFS_STRUCT_INIT(member, value) member = (value) ++#else ++# define AFS_STRUCT_INIT(member, value) (value) ++#endif ++ + /* + * Conditionally remove unreached statements under Solaris Studio. + */ +diff --git a/src/rx/xdr_len.c b/src/rx/xdr_len.c +index 5de15d010d62..9f9fe1ca92ac 100644 +--- a/src/rx/xdr_len.c ++++ b/src/rx/xdr_len.c +@@ -84,26 +84,14 @@ xdrlen_inline(XDR *xdrs, u_int len) + } + + static struct xdr_ops xdrlen_ops = { +-#ifndef HAVE_STRUCT_LABEL_SUPPORT +- /* Windows does not support labeled assigments */ +- xdrlen_getint32, /* not supported */ +- xdrlen_putint32, /* serialize an afs_int32 */ +- xdrlen_getbytes, /* not supported */ +- xdrlen_putbytes, /* serialize counted bytes */ +- xdrlen_getpos, /* get offset in the stream */ +- xdrlen_setpos, /* set offset in the stream */ +- xdrlen_inline, /* not supported */ +- xdrlen_destroy, /* destroy stream */ +-#else +- .x_getint32 = xdrlen_getint32, +- .x_putint32 = xdrlen_putint32, +- .x_getbytes = xdrlen_getbytes, +- .x_putbytes = xdrlen_putbytes, +- .x_getpostn = xdrlen_getpos, +- .x_setpostn = xdrlen_setpos, +- .x_inline = xdrlen_inline, +- .x_destroy = xdrlen_destroy +-#endif ++ AFS_STRUCT_INIT(.x_getint32, xdrlen_getint32), /* not supported */ ++ AFS_STRUCT_INIT(.x_putint32, xdrlen_putint32), /* serialize an afs_int32 */ ++ AFS_STRUCT_INIT(.x_getbytes, xdrlen_getbytes), /* not supported */ ++ AFS_STRUCT_INIT(.x_putbytes, xdrlen_putbytes), /* serialize counted bytes */ ++ AFS_STRUCT_INIT(.x_getpostn, xdrlen_getpos), /* get offset in the stream */ ++ AFS_STRUCT_INIT(.x_setpostn, xdrlen_setpos), /* set offset in the stream */ ++ AFS_STRUCT_INIT(.x_inline, xdrlen_inline), /* not supported */ ++ AFS_STRUCT_INIT(.x_destroy, xdrlen_destroy), /* destroy stream */ + }; + + /** +diff --git a/src/rx/xdr_mem.c b/src/rx/xdr_mem.c +index ae849f521bf6..bd6720505edb 100644 +--- a/src/rx/xdr_mem.c ++++ b/src/rx/xdr_mem.c +@@ -59,26 +59,14 @@ static afs_int32 *xdrmem_inline(XDR *, u_int); + static void xdrmem_destroy(XDR *); + + static struct xdr_ops xdrmem_ops = { +-#ifndef HAVE_STRUCT_LABEL_SUPPORT +- /* Windows does not support labeled assigments */ +- xdrmem_getint32, /* deserialize an afs_int32 */ +- xdrmem_putint32, /* serialize an afs_int32 */ +- xdrmem_getbytes, /* deserialize counted bytes */ +- xdrmem_putbytes, /* serialize counted bytes */ +- xdrmem_getpos, /* get offset in the stream: not supported. */ +- xdrmem_setpos, /* set offset in the stream: not supported. */ +- xdrmem_inline, /* prime stream for inline macros */ +- xdrmem_destroy, /* destroy stream */ +-#else +- .x_getint32 = xdrmem_getint32, +- .x_putint32 = xdrmem_putint32, +- .x_getbytes = xdrmem_getbytes, +- .x_putbytes = xdrmem_putbytes, +- .x_getpostn = xdrmem_getpos, +- .x_setpostn = xdrmem_setpos, +- .x_inline = xdrmem_inline, +- .x_destroy = xdrmem_destroy +-#endif ++ AFS_STRUCT_INIT(.x_getint32, xdrmem_getint32), /* deserialize an afs_int32 */ ++ AFS_STRUCT_INIT(.x_putint32, xdrmem_putint32), /* serialize an afs_int32 */ ++ AFS_STRUCT_INIT(.x_getbytes, xdrmem_getbytes), /* deserialize counted bytes */ ++ AFS_STRUCT_INIT(.x_putbytes, xdrmem_putbytes), /* serialize counted bytes */ ++ AFS_STRUCT_INIT(.x_getpostn, xdrmem_getpos), /* get offset in the stream: not supported. */ ++ AFS_STRUCT_INIT(.x_setpostn, xdrmem_setpos), /* set offset in the stream: not supported. */ ++ AFS_STRUCT_INIT(.x_inline, xdrmem_inline), /* prime stream for inline macros */ ++ AFS_STRUCT_INIT(.x_destroy, xdrmem_destroy), /* destroy stream */ + }; + + /* +diff --git a/src/rx/xdr_rx.c b/src/rx/xdr_rx.c +index 62fbed331b02..34e2b4d75efe 100644 +--- a/src/rx/xdr_rx.c ++++ b/src/rx/xdr_rx.c +@@ -49,26 +49,14 @@ static afs_int32 *xdrrx_inline(XDR *axdrs, u_int len); + * Ops vector for stdio type XDR + */ + static struct xdr_ops xdrrx_ops = { +-#ifndef HAVE_STRUCT_LABEL_SUPPORT +- /* Windows does not support labeled assigments */ +- xdrrx_getint32, /* deserialize an afs_int32 */ +- xdrrx_putint32, /* serialize an afs_int32 */ +- xdrrx_getbytes, /* deserialize counted bytes */ +- xdrrx_putbytes, /* serialize counted bytes */ +- NULL, /* get offset in the stream: not supported. */ +- NULL, /* set offset in the stream: not supported. */ +- xdrrx_inline, /* prime stream for inline macros */ +- NULL, /* destroy stream */ +-#else +- .x_getint32 = xdrrx_getint32, /* deserialize an afs_int32 */ +- .x_putint32 = xdrrx_putint32, /* serialize an afs_int32 */ +- .x_getbytes = xdrrx_getbytes, /* deserialize counted bytes */ +- .x_putbytes = xdrrx_putbytes, /* serialize counted bytes */ +- .x_getpostn = NULL, /* get offset in the stream: not supported. */ +- .x_setpostn = NULL, /* set offset in the stream: not supported. */ +- .x_inline = xdrrx_inline, /* prime stream for inline macros */ +- .x_destroy = NULL, /* destroy stream */ +-#endif ++ AFS_STRUCT_INIT(.x_getint32, xdrrx_getint32), /* deserialize an afs_int32 */ ++ AFS_STRUCT_INIT(.x_putint32, xdrrx_putint32), /* serialize an afs_int32 */ ++ AFS_STRUCT_INIT(.x_getbytes, xdrrx_getbytes), /* deserialize counted bytes */ ++ AFS_STRUCT_INIT(.x_putbytes, xdrrx_putbytes), /* serialize counted bytes */ ++ AFS_STRUCT_INIT(.x_getpostn, NULL), /* get offset in the stream: not supported. */ ++ AFS_STRUCT_INIT(.x_setpostn, NULL), /* set offset in the stream: not supported. */ ++ AFS_STRUCT_INIT(.x_inline, xdrrx_inline), /* prime stream for inline macros */ ++ AFS_STRUCT_INIT(.x_destroy, NULL), /* destroy stream */ + }; + + /* +-- +2.45.3 + diff --git a/net-fs/openafs/files/0015-upstream-struct-desiginated-init.patch b/net-fs/openafs/files/0015-upstream-struct-desiginated-init.patch new file mode 100644 index 000000000000..ed44ef94aaa5 --- /dev/null +++ b/net-fs/openafs/files/0015-upstream-struct-desiginated-init.patch @@ -0,0 +1,215 @@ +From ed1e72e2a3aecd894ca1a029996ef70846e30781 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Tue, 25 Feb 2025 20:09:12 -0700 +Subject: [PATCH 2/2] afs: Init structures via designated initializers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When the Linux kernel is configured with CONFIG_RANDSTRUCT=y, the +following error occurs when building the openafs kernel module: + + src/libafs/MODLOAD-6.12.0-SP/rand-timer-kernel.c:46:5: error: positional initialization of field in ‘struct’ declared with ‘designated_init’ attribute [-Werror=designated-init] + 46 | timer_seed, + | ^~~~~~~~~~ + +When the Linux kernel is configured with CONFIG_RANDSTRUCT=y, the Linux +build uses a Linux kernel-specific GCC plugin +(scripts/gcc-plugins/randomize_layout_plugin.c) that analyzes structures +and will add the designated_init attribute to any structure that is +determined to be a "pure operations struct" (i.e. contains only function +pointers or nested pure ops structs/unions). This is done so the plugin +can then randomize the layout. This causes some of our structures to be +flagged with the designated_init attribute, which triggers +-Werror=designated-init when we don't use designated initializers. + +Within the Linux specific directory, src/afs/LINUX, the code already +uses designated initializers, however some of the shared code within +src/afs or that is included in the build for the kernel module still use +positional initialization when initializing pure operations structures. + +Update the shared code that is used when building the Linux kernel +module to use designated initializers via the AFS_STRUCT_INIT macro. + +Use a consistent alignment, and add trailing comma on the last +element, change 0 to NULL where applicable. + +There are no functional changes within this commit. + +Note: For consistency, all the initializers for rx_securityOps are being +updated even though not all of the files are part of the Linux kernel +module (e.g. rxkad_server.c). + +Note: This error was discovered by an automated process that is used +by the Gentoo organization to test building packages with a hardened +Linux kernel. + +Reviewed-on: https://gerrit.openafs.org/16290 +Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> +Reviewed-by: Cheyenne Wills <cwills@sinenomine.net> +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +Tested-by: Andrew Deason <adeason@sinenomine.net> +(cherry picked from commit e94c183faef42e5ffe85c157ede008f2817bdefd) + +[cwills@sinenomine.net changes to rxgk not applicable to 1.8.x] + +Change-Id: I56ebb7d34718eef6c5bfbba98e3fb4e350a5129f +--- + src/afs/afs_fetchstore.c | 20 ++++++++--------- + src/crypto/hcrypto/kernel/rand-timer.c | 14 ++++++------ + src/rxkad/rxkad_client.c | 30 +++++++++++++------------- + src/rxkad/rxkad_server.c | 30 +++++++++++++------------- + 4 files changed, 47 insertions(+), 47 deletions(-) + +diff --git a/src/afs/afs_fetchstore.c b/src/afs/afs_fetchstore.c +index 5baf371a2c6a..5b9e08c3fdec 100644 +--- a/src/afs/afs_fetchstore.c ++++ b/src/afs/afs_fetchstore.c +@@ -844,20 +844,20 @@ rxfs_fetchMore(void *r, afs_int32 *length, afs_uint32 *moredata) + + static + struct fetchOps rxfs_fetchUfsOps = { +- rxfs_fetchMore, +- rxfs_fetchUfsRead, +- rxfs_fetchUfsWrite, +- rxfs_fetchClose, +- rxfs_fetchDestroy ++ AFS_STRUCT_INIT(.more, rxfs_fetchMore), ++ AFS_STRUCT_INIT(.read, rxfs_fetchUfsRead), ++ AFS_STRUCT_INIT(.write, rxfs_fetchUfsWrite), ++ AFS_STRUCT_INIT(.close, rxfs_fetchClose), ++ AFS_STRUCT_INIT(.destroy, rxfs_fetchDestroy), + }; + + static + struct fetchOps rxfs_fetchMemOps = { +- rxfs_fetchMore, +- rxfs_fetchMemRead, +- rxfs_fetchMemWrite, +- rxfs_fetchClose, +- rxfs_fetchDestroy ++ AFS_STRUCT_INIT(.more, rxfs_fetchMore), ++ AFS_STRUCT_INIT(.read, rxfs_fetchMemRead), ++ AFS_STRUCT_INIT(.write, rxfs_fetchMemWrite), ++ AFS_STRUCT_INIT(.close, rxfs_fetchClose), ++ AFS_STRUCT_INIT(.destroy, rxfs_fetchDestroy), + }; + + static afs_int32 +diff --git a/src/crypto/hcrypto/kernel/rand-timer.c b/src/crypto/hcrypto/kernel/rand-timer.c +index 3a7023555b67..6ef71737cdeb 100644 +--- a/src/crypto/hcrypto/kernel/rand-timer.c ++++ b/src/crypto/hcrypto/kernel/rand-timer.c +@@ -5,7 +5,7 @@ + * Contains no copyrightable content. + */ + #include <config.h> +- ++#include <stds.h> + #include <rand.h> + #include "randi.h" + +@@ -43,12 +43,12 @@ timer_status(void) + } + + const RAND_METHOD hc_rand_timer_method = { +- timer_seed, +- timer_bytes, +- timer_cleanup, +- timer_add, +- timer_pseudorand, +- timer_status ++ AFS_STRUCT_INIT(.seed, timer_seed), ++ AFS_STRUCT_INIT(.bytes, timer_bytes), ++ AFS_STRUCT_INIT(.cleanup, timer_cleanup), ++ AFS_STRUCT_INIT(.add, timer_add), ++ AFS_STRUCT_INIT(.pseudorand, timer_pseudorand), ++ AFS_STRUCT_INIT(.status, timer_status), + }; + + const RAND_METHOD * +diff --git a/src/rxkad/rxkad_client.c b/src/rxkad/rxkad_client.c +index 1f760b8c0e66..79ea0cf586b3 100644 +--- a/src/rxkad/rxkad_client.c ++++ b/src/rxkad/rxkad_client.c +@@ -50,21 +50,21 @@ + #endif /* max */ + + static struct rx_securityOps rxkad_client_ops = { +- rxkad_Close, +- rxkad_NewConnection, /* every new connection */ +- rxkad_PreparePacket, /* once per packet creation */ +- 0, /* send packet (once per retrans.) */ +- 0, +- 0, +- 0, +- rxkad_GetResponse, /* respond to challenge packet */ +- 0, +- rxkad_CheckPacket, /* check data packet */ +- rxkad_DestroyConnection, +- rxkad_GetStats, +- 0, +- 0, +- 0, ++ AFS_STRUCT_INIT(.op_Close, rxkad_Close), ++ AFS_STRUCT_INIT(.op_NewConnection, rxkad_NewConnection), /* every new connection */ ++ AFS_STRUCT_INIT(.op_PreparePacket, rxkad_PreparePacket), /* once per packet creation */ ++ AFS_STRUCT_INIT(.op_SendPacket, NULL), /* send packet (once per retrans.) */ ++ AFS_STRUCT_INIT(.op_CheckAuthentication, NULL), ++ AFS_STRUCT_INIT(.op_CreateChallenge, NULL), ++ AFS_STRUCT_INIT(.op_GetChallenge, NULL), ++ AFS_STRUCT_INIT(.op_GetResponse, rxkad_GetResponse), /* respond to challenge packet */ ++ AFS_STRUCT_INIT(.op_CheckResponse, NULL), ++ AFS_STRUCT_INIT(.op_CheckPacket, rxkad_CheckPacket), /* check data packet */ ++ AFS_STRUCT_INIT(.op_DestroyConnection, rxkad_DestroyConnection), ++ AFS_STRUCT_INIT(.op_GetStats, rxkad_GetStats), ++ AFS_STRUCT_INIT(.op_SetConfiguration, NULL), ++ AFS_STRUCT_INIT(.op_Spare2, NULL), ++ AFS_STRUCT_INIT(.op_Spare3, NULL), + }; + + /* Allocate a new client security object. Called with the encryption level, +diff --git a/src/rxkad/rxkad_server.c b/src/rxkad/rxkad_server.c +index 07e806bcdf36..766904cea562 100644 +--- a/src/rxkad/rxkad_server.c ++++ b/src/rxkad/rxkad_server.c +@@ -43,21 +43,21 @@ afs_int32(*rxkad_AlternateTicketDecoder) (afs_int32, char *, afs_int32, + afs_uint32 *); + + static struct rx_securityOps rxkad_server_ops = { +- rxkad_Close, +- rxkad_NewConnection, +- rxkad_PreparePacket, /* once per packet creation */ +- 0, /* send packet (once per retrans) */ +- rxkad_CheckAuthentication, +- rxkad_CreateChallenge, +- rxkad_GetChallenge, +- 0, +- rxkad_CheckResponse, +- rxkad_CheckPacket, /* check data packet */ +- rxkad_DestroyConnection, +- rxkad_GetStats, +- rxkad_SetConfiguration, +- 0, /* spare 2 */ +- 0, /* spare 3 */ ++ AFS_STRUCT_INIT(.op_Close, rxkad_Close), ++ AFS_STRUCT_INIT(.op_NewConnection, rxkad_NewConnection), ++ AFS_STRUCT_INIT(.op_PreparePacket, rxkad_PreparePacket), /* once per packet creation */ ++ AFS_STRUCT_INIT(.op_SendPacket, NULL), /* send packet (once per retrans) */ ++ AFS_STRUCT_INIT(.op_CheckAuthentication, rxkad_CheckAuthentication), ++ AFS_STRUCT_INIT(.op_CreateChallenge, rxkad_CreateChallenge), ++ AFS_STRUCT_INIT(.op_GetChallenge, rxkad_GetChallenge), ++ AFS_STRUCT_INIT(.op_GetResponse, NULL), ++ AFS_STRUCT_INIT(.op_CheckResponse, rxkad_CheckResponse), ++ AFS_STRUCT_INIT(.op_CheckPacket, rxkad_CheckPacket), /* check data packet */ ++ AFS_STRUCT_INIT(.op_DestroyConnection, rxkad_DestroyConnection), ++ AFS_STRUCT_INIT(.op_GetStats, rxkad_GetStats), ++ AFS_STRUCT_INIT(.op_SetConfiguration, rxkad_SetConfiguration), ++ AFS_STRUCT_INIT(.op_Spare2, NULL), /* spare 2 */ ++ AFS_STRUCT_INIT(.op_Spare3, NULL), /* spare 3 */ + }; + extern afs_uint32 rx_MyMaxSendSize; + +-- +2.45.3 + diff --git a/net-fs/openafs/files/0016-kernel-cc-ld.patch b/net-fs/openafs/files/0016-kernel-cc-ld.patch new file mode 100644 index 000000000000..a48314db33bb --- /dev/null +++ b/net-fs/openafs/files/0016-kernel-cc-ld.patch @@ -0,0 +1,47 @@ +From d521d97b857822f71b3e9eeadab038fd5eab3823 Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gentoo.org> +Date: Sun, 12 Dec 2021 01:06:18 +0300 +Subject: [PATCH 12/12] kernel-cc-ld + +Pass custom $CC and $LD to kernel during both configure check and build. +Otherwise hosts without `gcc` and `ld` wrappers will fail configure. + +See Gentoo bug 828951. + +(cherry picked from commit d4676024fe7b2dfac413e6509caccd13f94ac28d) +--- + src/cf/linux-test1.m4 | 4 ++-- + src/libafs/MakefileProto.LINUX.in | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/cf/linux-test1.m4 b/src/cf/linux-test1.m4 +index fbe3c1aa80a5..bbab471f4faa 100644 +--- a/src/cf/linux-test1.m4 ++++ b/src/cf/linux-test1.m4 +@@ -25,8 +25,8 @@ $2 + MODULE_LICENSE("http://www.openafs.org/dl/license10.html"); + MODULE_DESCRIPTION("openafs conftest"); + _ACEOF +- echo make -C $LINUX_KERNEL_BUILD M=$SRCDIR_PARENT/conftest.dir $SPARSE_MAKEFLAGS modules KBUILD_VERBOSE=1 >&AS_MESSAGE_LOG_FD && +- make -C $LINUX_KERNEL_BUILD M=$SRCDIR_PARENT/conftest.dir $SPARSE_MAKEFLAGS modules KBUILD_VERBOSE=1 >&AS_MESSAGE_LOG_FD 2>conftest.err && ++ echo make -C $LINUX_KERNEL_BUILD M=$SRCDIR_PARENT/conftest.dir $SPARSE_MAKEFLAGS modules KBUILD_VERBOSE=1 CC="${CC}" LD="${LD}" >&AS_MESSAGE_LOG_FD && ++ make -C $LINUX_KERNEL_BUILD M=$SRCDIR_PARENT/conftest.dir $SPARSE_MAKEFLAGS modules KBUILD_VERBOSE=1 CC="${CC}" LD="${LD}" >&AS_MESSAGE_LOG_FD 2>conftest.err && + ! grep -i "WARNING: .* undefined!$" conftest.err >/dev/null 2>&1 + then [$3] + else +diff --git a/src/libafs/MakefileProto.LINUX.in b/src/libafs/MakefileProto.LINUX.in +index 2509944e9aed..0306df35e593 100644 +--- a/src/libafs/MakefileProto.LINUX.in ++++ b/src/libafs/MakefileProto.LINUX.in +@@ -324,7 +324,7 @@ ${LIBAFS} ${LIBAFS_MP} ${LIBAFS_EP} ${LIBAFS_BM}: ${LINUX_LIBAFS_NAME}.ko + ${LINUX_LIBAFS_NAME}.ko afspag.ko: .FORCE + env EXTRA_CFLAGS="${EXTRA_CFLAGS}" @TOP_SRCDIR@/libafs/make_kbuild_makefile.pl ${KDIR} $@ @TOP_OBJDIR@/src/config/Makefile.config Makefile.afs Makefile.common + ( env EXTRA_CFLAGS="${EXTRA_CFLAGS}" \ +- $(MAKE) -C ${LINUX_KERNEL_BUILD} M=@TOP_OBJDIR@/src/libafs/${KDIR} $(SPARSE_MAKEFLAGS) modules 2>&1 \ ++ $(MAKE) -C ${LINUX_KERNEL_BUILD} M=@TOP_OBJDIR@/src/libafs/${KDIR} $(SPARSE_MAKEFLAGS) CC="${CC}" LD="${LD}" modules 2>&1 \ + || echo "FAILURE: make exit code $$?" ) | tee .makelog + @if grep -E -q '^(FAILURE|WARNING)' .makelog; then \ + grep -q '^WARNING' .makelog && echo "Error: Undefined symbols in modules" ; \ +-- +2.52.0 + diff --git a/net-fs/openafs/files/0017-docbook2pdf.patch b/net-fs/openafs/files/0017-docbook2pdf.patch new file mode 100644 index 000000000000..9c18fc04ec81 --- /dev/null +++ b/net-fs/openafs/files/0017-docbook2pdf.patch @@ -0,0 +1,109 @@ +From 4501337bab87ec8724ae45fa50713584a211fb3a Mon Sep 17 00:00:00 2001 +From: Andrew Savchenko <bircoph@gmail.com> +Date: Fri, 4 Jan 2019 16:37:35 +0300 +Subject: [PATCH 09/13] docbook2pdf + +Jadetex based converters require jadetex tuning: + save_size=50000 + max_strings=1000000 + pool_size=2000000 + hash_extra=150000 +Otherwise TeX will run out of its capacity during large PDFs +generation. + +docbook2pdf needs to ignore an ID reference value which no element +has as its ID: + -e no-idref +This is already done by other converters implicitly. + +(cherry picked from commit c81ef9c4109eb1bfc9cb42d952b9d5240f3d713b) +(cherry picked from commit c4515998db6078ccf82fad23b774bc243ba1f020) +(cherry picked from commit 876c27c8fb7cc3c80e31d3e642a7727313b4f0c0) +--- a/doc/xml/AdminGuide/Makefile.in ++++ b/doc/xml/AdminGuide/Makefile.in +@@ -33,6 +33,7 @@ XSLTPROC = @XSLTPROC@ + DOCBOOK2PDF = @DOCBOOK2PDF@ + KINDLEGEN = @KINDLEGEN@ + DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub ++TEXOPTS = save_size=50000 max_strings=1000000 pool_size=2000000 hash_extra=150000 + + XSL_FLAGS = --path '@abs_builddir@' + +@@ -48,8 +49,10 @@ $(BOOK).pdf: $(SRCS) + $(XSLTPROC) $(DOCBOOK_STYLESHEETS)/fo/docbook.xsl \ + $(srcdir)/$(BOOK).xml > $(BOOK).fo; \ + $(DOCBOOK2PDF) $(BOOK).fo $(BOOK).pdf; \ ++ elif test "x$(DOCBOOK2PDF)" = "xdocbook2pdf"; then \ ++ $(TEXOPTS) $(DOCBOOK2PDF) -e no-idref $(BOOK).xml; \ + else \ +- $(DOCBOOK2PDF) --output=$@ --xslt-opts="$(XSL_FLAGS)" \ ++ $(TEXOPTS) $(DOCBOOK2PDF) --output=$@ --xslt-opts="$(XSL_FLAGS)" \ + $(srcdir)/$(BOOK).xml; \ + fi + +--- a/doc/xml/AdminRef/Makefile.in ++++ b/doc/xml/AdminRef/Makefile.in +@@ -16,6 +16,7 @@ XSLTPROC = @XSLTPROC@ --stringparam variablelist.as.blocks 1 --param use.id.as.f + DOCBOOK2PDF = @DOCBOOK2PDF@ + DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub + KINDLEGEN = @KINDLEGEN@ ++TEXOPTS = save_size=50000 max_strings=1000000 pool_size=2000000 hash_extra=150000 + + XSL_FLAGS = --path '@abs_builddir@' + +@@ -28,8 +29,10 @@ $(BOOK).pdf: $(SRCS) + $(DOCBOOK_STYLESHEETS)/fo/docbook.xsl \ + $(srcdir)/$(BOOK).xml > $(BOOK).fo; \ + $(DOCBOOK2PDF) $(BOOK).fo $(BOOK).pdf; \ ++ elif test "x$(DOCBOOK2PDF)" = "xdocbook2pdf"; then \ ++ $(TEXOPTS) $(DOCBOOK2PDF) -e no-idref $(BOOK).xml; \ + else \ +- $(DOCBOOK2PDF) --output=$@ --xslt-opts="$(XSL_FLAGS)" \ ++ $(TEXOPTS) $(DOCBOOK2PDF) --output=$@ --xslt-opts="$(XSL_FLAGS)" \ + $(srcdir)/$(BOOK).xml; \ + fi + +--- a/doc/xml/QuickStartUnix/Makefile.in ++++ b/doc/xml/QuickStartUnix/Makefile.in +@@ -31,6 +31,7 @@ XSLTPROC = @XSLTPROC@ + DOCBOOK2PDF = @DOCBOOK2PDF@ + DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub + KINDLEGEN = @KINDLEGEN@ ++TEXOPTS = save_size=50000 max_strings=1000000 pool_size=2000000 hash_extra=150000 + + XSL_FLAGS = --path '@abs_builddir@' + +@@ -47,8 +48,10 @@ $(BOOK).pdf: $(SRCS) + $(DOCBOOK_STYLESHEETS)/fo/docbook.xsl \ + $(srcdir)/$(BOOK).xml > $(BOOK).fo; \ + $(DOCBOOK2PDF) $(BOOK).fo $(BOOK).pdf; \ ++ elif test "x$(DOCBOOK2PDF)" = "xdocbook2pdf"; then \ ++ $(TEXOPTS) $(DOCBOOK2PDF) -e no-idref $(BOOK).xml; \ + else \ +- $(DOCBOOK2PDF) --output=$@ --xslt-opts="$(XSL_FLAGS)" \ ++ $(TEXOPTS) $(DOCBOOK2PDF) --output=$@ --xslt-opts="$(XSL_FLAGS)" \ + $(srcdir)/$(BOOK).xml; \ + fi + +--- a/doc/xml/UserGuide/Makefile.in ++++ b/doc/xml/UserGuide/Makefile.in +@@ -31,6 +31,7 @@ XSLTPROC = @XSLTPROC@ + DOCBOOK2PDF = @DOCBOOK2PDF@ + DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub + KINDLEGEN = @KINDLEGEN@ ++TEXOPTS = save_size=50000 max_strings=1000000 pool_size=2000000 hash_extra=150000 + + XSL_FLAGS = --path '@abs_builddir@' + +@@ -47,8 +48,10 @@ $(BOOK).pdf: $(SRCS) + $(DOCBOOK_STYLESHEETS)/fo/docbook.xsl \ + $(srcdir)/$(BOOK).xml > $(BOOK).fo; \ + $(DOCBOOK2PDF) $(BOOK).fo $(BOOK).pdf; \ ++ elif test "x$(DOCBOOK2PDF)" = "xdocbook2pdf"; then \ ++ $(TEXOPTS) $(DOCBOOK2PDF) -e no-idref $(BOOK).xml; \ + else \ +- $(DOCBOOK2PDF) --output=$@ --xslt-opts="$(XSL_FLAGS)" \ ++ $(TEXOPTS) $(DOCBOOK2PDF) --output=$@ --xslt-opts="$(XSL_FLAGS)" \ + $(srcdir)/$(BOOK).xml; \ + fi + diff --git a/net-fs/openafs/files/0018-openafs-1.8.15-linux-6.17.patch b/net-fs/openafs/files/0018-openafs-1.8.15-linux-6.17.patch new file mode 100644 index 000000000000..3e224856a51c --- /dev/null +++ b/net-fs/openafs/files/0018-openafs-1.8.15-linux-6.17.patch @@ -0,0 +1,150 @@ +From c87b1e31f62b827e2f421a57362923d78afc2279 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Tue, 10 Mar 2026 14:24:54 -0600 +Subject: [PATCH] Linux: Use set_default_d_op() to set dentry ops + +The Linux 6.17 commit: + 'new helper: set_default_d_op()' (05fb0e666495c) +replaced the way that the default dentry_operations is set on a +super_block. The s_d_op member was renamed to __s_d_op and a new helper +function set_default_d_op() is now used to set the default +dentry_operations. + +The OpenAFS commit 'linux: 2.6.38: New d_op handling' (08bb83d950) added +an autoconf test for using the s_d_op member in the super_block struct. +With the above Linux commit, the test for STRUCT_SUPER_BLOCK_HAS_S_D_OP +fails, and the __s_d_op member in the super_block is not set during +afs_fill_super(), but instead dp->d_op is set during various vfs +operations. Doing so sets the dentry ops for the dentry, but does not +set the flag DCACHE_OP_REVALIDATE on the dentry, and so Linux never +calls our d_revalidate function, causing dentries to not get properly +revalidated. + +To fix this, add a new autoconf test for set_default_d_op(), and use +that function when available. Add a comment for the autoconf test for +the super_block member s_d_op to note the change. Add an additional +build time check to ensure that we don't accidentally revert to the +pre-2.6.38 behavior after Linux 2.6.38 + +In afs_fill_super(), use set_default_d_op() to initialize the +super_block with the afs_dentry_operations. + +The dentry->d_op member only needs to be updated when set_default_d_op() +is not available and the super_block does not have the s_d_op member. + +Note: This commit fixes a reported problem with stale dentries that was +discovered on a Linux 6.17 system. + +Reviewed-on: https://gerrit.openafs.org/16700 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +Tested-by: Michael Meffie <mmeffie@sinenomine.net> +Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> +(cherry picked from commit a99b2ff4c04a9b1a4ba3ab5fac1b37bfd5d43568) + +Change-Id: Ic454c52ca88c82a9efa62a486ec05300a95c6cb0 +(cherry picked from commit 6d0a2107fcab28fc4ba64d365133d171b75bd3dc) +--- + src/afs/LINUX/osi_vfsops.c | 8 ++++++-- + src/afs/LINUX/osi_vnodeops.c | 6 +++--- + src/cf/linux-kernel-func.m4 | 10 ++++++++++ + src/cf/linux-kernel-struct.m4 | 4 ++++ + 4 files changed, 23 insertions(+), 5 deletions(-) + +diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c +index 18506474ee48..f1e59074760c 100644 +--- a/src/afs/LINUX/osi_vfsops.c ++++ b/src/afs/LINUX/osi_vfsops.c +@@ -117,8 +117,12 @@ afs_fill_super(struct super_block *sb, void *data, int silent) + sb->s_magic = AFS_VFSMAGIC; + sb->s_op = &afs_sops; /* Super block (vfs) ops */ + +-#if defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) ++#if defined(HAVE_LINUX_SET_DEFAULT_D_OP) ++ set_default_d_op(sb, &afs_dentry_operations); ++#elif defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) + sb->s_d_op = &afs_dentry_operations; ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38) ++# error "Missing method to set the super_block's dentry operations member" + #endif + #if defined(HAVE_LINUX_SUPER_SETUP_BDI) + code = super_setup_bdi(sb); +@@ -221,7 +225,7 @@ afs_root(struct super_block *afsp) + #else + afsp->s_root = d_alloc_root(ip); + #endif +-#if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) ++#if !defined(HAVE_LINUX_SET_DEFAULT_D_OP) && !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) + afsp->s_root->d_op = &afs_dentry_operations; + #endif + afs_DestroyAttr(vattr); +diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c +index b525126c20a1..432643fe5583 100644 +--- a/src/afs/LINUX/osi_vnodeops.c ++++ b/src/afs/LINUX/osi_vnodeops.c +@@ -1844,7 +1844,7 @@ afs_linux_create(struct inode *dip, struct dentry *dp, int mode) + afs_getattr(vcp, vattr, credp); + afs_fill_inode(ip, vattr); + insert_inode_hash(ip); +-#if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) ++#if !defined(HAVE_LINUX_SET_DEFAULT_D_OP) && !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) + dp->d_op = &afs_dentry_operations; + #endif + dp->d_time = parent_vcache_dv(dip, credp); +@@ -1925,7 +1925,7 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp) + + afs_DestroyAttr(vattr); + } +-#if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) ++#if !defined(HAVE_LINUX_SET_DEFAULT_D_OP) && !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) + dp->d_op = &afs_dentry_operations; + #endif + dp->d_time = parent_vcache_dv(dip, credp); +@@ -2171,7 +2171,7 @@ afs_linux_mkdir(struct inode *dip, struct dentry *dp, int mode) + afs_getattr(tvcp, vattr, credp); + afs_fill_inode(ip, vattr); + +-#if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) ++#if !defined(HAVE_LINUX_SET_DEFAULT_D_OP) && !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) + dp->d_op = &afs_dentry_operations; + #endif + dp->d_time = parent_vcache_dv(dip, credp); +diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4 +index 0784262d70b9..6845c9918ad1 100644 +--- a/src/cf/linux-kernel-func.m4 ++++ b/src/cf/linux-kernel-func.m4 +@@ -379,6 +379,16 @@ AC_CHECK_LINUX_FUNC([write_begin_end_kiocb], + [[aops->write_begin(kiocb, mapping, 0, 0, &foliop, fsdata); + aops->write_end(kiocb, mapping, 0, 0, 0, foliop, fsdata);]]) + ++dnl Linux 6.17 added a helper function set_default_d_op() to set the default ++dnl dentry_operations for a super_block. The super_block member s_d_op is now ++dnl a private member of the super_block. ++AC_CHECK_LINUX_FUNC([set_default_d_op], ++ [#include <linux/kernel.h> ++ #include <linux/dcache.h>], ++ [[static struct super_block sb; ++ static struct dentry_operations d_op; ++ set_default_d_op(&sb, &d_op);]]) ++ + dnl Consequences - things which get set as a result of the + dnl above tests + AS_IF([test "x$ac_cv_linux_func_d_alloc_anon" = "xno"], +diff --git a/src/cf/linux-kernel-struct.m4 b/src/cf/linux-kernel-struct.m4 +index 24841e9f3245..46c23a25fbb8 100644 +--- a/src/cf/linux-kernel-struct.m4 ++++ b/src/cf/linux-kernel-struct.m4 +@@ -44,6 +44,10 @@ AC_CHECK_LINUX_STRUCT([nameidata], [path], [namei.h]) + AC_CHECK_LINUX_STRUCT([proc_dir_entry], [owner], [proc_fs.h]) + AC_CHECK_LINUX_STRUCT([proc_ops], [proc_compat_ioctl], [proc_fs.h]) + AC_CHECK_LINUX_STRUCT([super_block], [s_bdi], [fs.h]) ++dnl Linux 2.6.38 added the s_d_op field to hold the default dentry ops. ++dnl Linux 6.17 renamed s_d_op to a private member, requiring users to instead ++dnl call set_default_d_op() to initialize the super_block with the default ++dnl dentry ops. + AC_CHECK_LINUX_STRUCT([super_block], [s_d_op], [fs.h]) + AC_CHECK_LINUX_STRUCT([super_operations], [alloc_inode], + [fs.h]) +-- +2.52.0 + diff --git a/net-fs/openafs/files/README.Gentoo b/net-fs/openafs/files/README.Gentoo new file mode 100644 index 000000000000..50d27123ca39 --- /dev/null +++ b/net-fs/openafs/files/README.Gentoo @@ -0,0 +1,297 @@ +README openafs for gentoo linux +------------------------------- + +Changelog: + +13.11.2005 point to online documentation where relevant +25.07.2005 update after ebuild overhaul +04.06.2001 initial release + +INDEX +A) Questions Likely to be Asked +1) Overview +2) Client installation +3) Server installation +3.1) Installing your afs server +3.2) Configuring the Top Level of the AFS filespace + +A. Questions Likely to be Asked +------------------------------- + +Q) How do I upgrade from a pre-1.4 version? +A) Consult http://www.gentoo.org/doc/en/openafs.xml. You will find + detailed instructions on how to safely upgrade. If you're very very + impatient, please take note that the init-scripts have changed names + and that you shouldn't use the old script after upgrading. Now go and play! + +Q) Why are the paths in the OpenAFS documentation different from the ones in + the gentoo package? +A) When AFS was conceived, Transarc (at the time the developing company) chose + new seperate paths for everything related to AFS. Though there are + advantages to this approach (like more easily copying an AFS-installation + from one machine to another), this is contrary to FHS, the standard for + filesystem layout as used in Gentoo and many other UNIX-systems. + +Q) Software package X requires the old path convention +A) If the software in mind is OSS and has an ebuild in portage, please let us + know so we can patch the software to work with a gentoo installation. If + you use third-party software that has the legacy paths hardcoded, we + recommend you take a look at the package "openafs-legacy". It is meant to + provide soft-links to an existing openafs-installation, such that those + packages find the information they're looking for. At the time of writing, + this packages is untested. Please let us know how well / badly it works + for you! + (After installing the FHS compliant ebuild, you first need to remove the + configuration files in the old paths, so there is room for the soft-links. + See below on how to go about this) + +Q) The ebuild has done the automatic transfer from old path-config files to + the new standard. But now my system won't start anymore. What do I do? +A) The ebuild was designed to not touch files that existed before, and also + leave the old configuration files there for a safe fallback. One cause + for failure that comes to mind is a system that contained some configuration + files in new paths before the transfer. In any case, we'd appreciate you + filing a bug report (http://bugs.gentoo.org). I hope you've read the + guide on how to upgrade, btw? It may very well give you better understanding + of what's happened. See http://www.gentoo.org/doc/en/openafs.xml. + +Q) My openafs client has gone into a state where I can't stop nor start the + service. What can I do, apart from rebooting? +A) Though I hope I've adapted the init-scripts to cope with most circumstances, + a failure to stop the client may arise for some reason. Here's a guideline + to stop the openafs client so you can cleanly restart. + 1) Check for kernel errors (caused by the client if you're running the + experimental version). To do this, use "dmesg". If you see errors + (like stack traces), it's recommended that you reboot after all (this is + known to happen when unload the kernel module when afsd is still running) + 2) Check if the /afs filesystem is mounted (e.g. "grep AFS /proc/mounts"). + If so, unmount it ("umount /afs"). Afterwards you'll need step 3: + 3) Check if afsd is running (e.g. "pgrep afsd"). If so, shut it down by + issuing "afsd -shutdown" + 4) Check if the kernel module is loaded ("lsmod | grep openafs"). If so, + unload it with "modprobe -r openafs" + 5) Just to be safe, you may want to recheck step 1 + + 6) Check if the bosserver is running ("pgrep bosserver"). If not, then + normally no part of the AFS server is running. If you doubt this + for whatever reason (like strange bosserver behaviour), you can check + if individual services are running and the stop those using the "kill" + command. Processes you're looking for are named like volserver, + fileserver, upserver, vlserver, ptserver, buserver, kaserver. + If it isn't running, and you're not feeling suspicious, go to step 9 + 7) Check the status of the bosserver by running + "bos status localhost -localauth". If it reports running services, + shutdown by running "bos shutdown localhost -localauth -wait". + 8) Shut down the bosserver ("killall bosserver" is the fastest know method) + + 9) Finally, every part of afs should be shutdown. Let the initscript- + system know by running "/etc/init.d/afs-client zap". + + Now you should be able to run "/etc/init.d/afs-client start" again + Please also report a bug stating the circumstances under which your + lockup situation occurred (including useful info like that produced by + "dmesg" + + +1. Overview +----------- + +- There's an openafs faq available on + http://www.angelfire.com/hi/plutonic/afs-faq.html +- Openafs main page is at http://www.openafs.org +- AFS was originally developed by Transarc which is now owned by IBM. + You can find some information about AFS on + http://www-306.ibm.com/software/stormgmt/afs/ + +2. Client installation +---------------------- + +NOTE: You need to have access to a running afs-server in your network. +First edit ThisCell and CellServDB according to your local network structure. +If you're unsure what to put there, either read the afs documentation or contact +your local administrators. Just run "emerge openafs" on your gentoo linux +machine to build the client. After building add the afs start script with +rc-update add afs. Now you're ready to go !! + +3. Server installation +---------------------- + +NOTE: This is a quick quick beginnings manual !!! If you really want to use afs +download and print out the afs documentation !!! + +3.1 Installing your afs server + + 1. Startup main afs server process + /usr/bin/bosserver -noauth & + Verify that /etc/openafs/server/ThisCell and CellServDB got created + + 2. Give your cell a name !! + /usr/bin/bos setcellname <server name> <cell name> -noauth + e.g.: /usr/bin/bos setcellname darks.net-labs.local gentoo -noauth + Verify that ThisCell and CellServDB got updated !!! + + 3. Startup authentification, backup, protection and volume loction servers + + /usr/bin/bos create <server name> kaserver simple /usr/libexec/openafs/kaserver -cell <cell name> -noauth + e.g: /usr/bin/bos create darks.net-labs.local kaserver simple /usr/libexec/openafs/kaserver -cell gentoo -noauth + + /usr/bin/bos create <server name> buserver simple /usr/libexec/openafs/buserver -cell <cell name> -noauth + e.g: /usr/bin/bos create darks.net-labs.local buserver simple /usr/libexec/openafs/buserver -cell gentoo -noauth + + /usr/bin/bos create <server name> ptserver simple /usr/libexec/openafs/ptserver -cell <cell name> -noauth + e.g: /usr/bin/bos create darks.net-labs.local ptserver simple /usr/libexec/openafs/ptserver -cell gentoo -noauth + + /usr/bin/bos create <server name> vlserver simple /usr/libexec/openafs/vlserver -cell <cell name> -noauth + e.g: /usr/bin/bos create darks.net-labs.local vlserver simple /usr/libexec/openafs/vlserver -cell gentoo -noauth + + Verify that all servers are running: + /usr/bin/bos status <server name> -noauth + e.g.: /usr/bin/bos status darks.net-labs.local -noauth + + 4. Initialize Cell Security + .. which basically means creating afs admin account. + + /usr/bin/kas -cell <cell name> -noauth + This should give you the ka> prompt. + + ka> create afs + initial_password: + Verifying, please re-enter initial_password: + ka> create admin + initial_password: + Verifying, please re-enter initial_password: + ka> + + Verfiy that users got created and set admin flag for user admin: + + ka> examine afs + + User data for afs + key (0) cksum is 2651715259, last cpw: Mon Jun 4 20:49:30 2001 + password will never expire. + An unlimited number of unsuccessful authentications is permitted. + entry never expires. Max ticket lifetime 100.00 hours. + last mod on Mon Jun 4 20:49:30 2001 by <none> + permit password reuse + ka> setfields admin -flags admin + ka> examine admin + + User data for admin (ADMIN) + key (0) cksum is 2651715259, last cpw: Mon Jun 4 20:49:59 2001 + password will never expire. + An unlimited number of unsuccessful authentications is permitted. + entry never expires. Max ticket lifetime 25.00 hours. + last mod on Mon Jun 4 20:51:10 2001 by <none> + permit password reuse + ka> + + Create users in the afs enviroment: + + /usr/bin/bos adduser <server name> admin -cell <cell name> -noauth + e.g.: /usr/bin/bos adduser darks.net-labs.local admin -cell gentoo -noauth + + /usr/bin/bos addkey <server name> -kvno 0 -cell <cell name> -noauth + e.g.: /usr/bin/bos addkey darks.net-labs.local -kvno 0 -cell gentoo -noauth + input key: + Retype input key: + NOTE: you need to give the password you provided for the afs account above + + Create a protection database entry for the admin user: + + /usr/bin/pts createuser -name admin -cell <cell name> [-id <AFS UID>] -noauth + MATCH UNIX ID'S AND AFS UID'S WITH THE -id FLAG !! + e.g.: /usr/bin/pts createuser -name admin -cell gentoo -noauth + User admin has id 1 + + /usr/bin/pts adduser admin system:administrators -cell <cell name> -noauth + e.g.: /usr/bin/pts adduser admin system:administrators -cell gentoo -noauth + + Check admin privileges: + + /usr/bin/pts membership admin -cell gentoo -noauth + Groups admin (id: 1) is a member of: + system:administrators + + Restart afs processes: + + /usr/bin/bos restart <server name> -all -cell <cell name> -noauth + e.g.: /usr/bin/bos restart darks.net-labs.local -all -cell gentoo -noauth + + 5. Start the file and volume servers and the salvager + + /usr/bin/bos create <server name> fs fs /usr/libexec/openafs/fileserver /usr/libexec/openafs/volserver /usr/libexec/openafs/salvager -cell <cell name> -noauth + e.g.: /usr/bin/bos create darks.net-labs.local fs fs /usr/libexec/openafs/fileserver /usr/libexec/openafs/volserver /usr/libexec/openafs/salvager -cell gentoo -noauth + + Verify that all processe are running: + + /usr/bin/bos status darks.net-labs.local -long -noauth + Instance kaserver, (type is simple) currently running normally. + Process last started at Mon Jun 4 21:07:17 2001 (2 proc starts) + Last exit at Mon Jun 4 21:07:17 2001 + Command 1 is '/usr/libexec/openafs/kaserver' + + Instance buserver, (type is simple) currently running normally. + Process last started at Mon Jun 4 21:07:17 2001 (2 proc starts) + Last exit at Mon Jun 4 21:07:17 2001 + Command 1 is '/usr/libexec/openafs/buserver' + + Instance ptserver, (type is simple) currently running normally. + Process last started at Mon Jun 4 21:07:17 2001 (2 proc starts) + Last exit at Mon Jun 4 21:07:17 2001 + Command 1 is '/usr/libexec/openafs/ptserver' + + Instance vlserver, (type is simple) currently running normally. + Process last started at Mon Jun 4 21:07:17 2001 (2 proc starts) + Last exit at Mon Jun 4 21:07:17 2001 + Command 1 is '/usr/libexec/openafs/vlserver' + + Instance fs, (type is fs) currently running normally. + Auxiliary status is: file server running. + Process last started at Mon Jun 4 21:09:30 2001 (2 proc starts) + Command 1 is '/usr/libexec/openafs/fileserver' + Command 2 is '/usr/libexec/openafs/volserver' + Command 3 is '/usr/libexec/openafs/salvager' + + 6. Create the main volume or synchronize with existing servers + + a) This is the first server: + + /usr/bin/vos create <server name> <partition name> root.afs -cell <cell name> -noauth + e.g.: /usr/bin/vos create darks.net-labs.local /vicepa root.afs -cell gentoo -noauth + + b) You're installing a backup server: + + /usr/bin/vos syncvldb <server name> -cell <cell name> -verbose -noauth + /usr/bin/vos syncserv <server name> -cell <cell name> -verbose -noauth + + 7. Start the Update Server + + /usr/bin/bos create <server name> upserver simple "/usr/libexec/openafs/upserver -crypt /etc/openafs -clear /usr/bin" -cell <cell name> -noauth + e.g.: /usr/bin/bos create darks.net-labs.local upserver simple "/usr/libexec/openafs/upserver -crypt /etc/openafs -clear /usr/bin" -cell gentoo -noauth + + 8. Modifiy /etc/openafs/afs.conf + + Edit afs.conf to start afs server + + That's it !! Your afs server should hopefully be up and running !!! + +3.2 Configuring the Top Level of the AFS filespace + + 1. Let anyuser lookup /afs + /usr/bin/fs setacl /afs system:anyuser rl + + 2. Create root volume + + /usr/bin/vos create <server name> <partition name> root.cell + /usr/bin/fs mkmount /afs/cellname root.cell + e.g.: /usr/afs/bin/fs mkmount /afs/gentoo root.cell + /usr/bin/fs setacl /afs/cellname system:anyuser rl + + Create read/write mountpoint + + /usr/bin/fs mkmount /afs/.cellname root.cell -rw + e.g.: /usr/bin/fs mkmount /afs/.gentoo root.cell -rw + + +OK .. you're ready to go !! Now it's time to read AFS documentation and learn how to +create volumes, create users and groups, set acl's and so on .. Have Fun :)) diff --git a/net-fs/openafs/files/ThisCell.default b/net-fs/openafs/files/ThisCell.default new file mode 100644 index 000000000000..e3a135d57e0e --- /dev/null +++ b/net-fs/openafs/files/ThisCell.default @@ -0,0 +1 @@ +openafs.org
\ No newline at end of file diff --git a/net-fs/openafs/files/cacheinfo.default b/net-fs/openafs/files/cacheinfo.default new file mode 100644 index 000000000000..0e4547fc23fd --- /dev/null +++ b/net-fs/openafs/files/cacheinfo.default @@ -0,0 +1 @@ +/afs:/var/cache/openafs:200000
\ No newline at end of file diff --git a/net-fs/openafs/files/openrc/openafs-client.confd b/net-fs/openafs/files/openrc/openafs-client.confd new file mode 100644 index 000000000000..2dfecd7cef54 --- /dev/null +++ b/net-fs/openafs/files/openrc/openafs-client.confd @@ -0,0 +1,55 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# ENABLE_AFSDB and ENABLE_DYNROOT determine whether AFSDB support and +# Dynroot support (dynamically generated /afs), respectively, should be +# enabled in the AFS client. +ENABLE_AFSDB="yes" +ENABLE_DYNROOT="yes" + +# Log stdout/stderr to /var/log/openafs/client.log (disabled by default) +# ENABLE_STD_LOGGING="no" + +# AFS client configuration options: +# --------------------------------------------------------------------------- +# possible AFS client afsd configuration options (from 1.3.74) are +# -blocks The number of blocks available in the workstation cache. +# -files The target number of files in the workstation cache (Default: +# 1000). +# -rootvol The name of the root volume to use. +# -stat The number of stat cache entries. +# -hosts List of servers to check for volume location info FOR THE +# HOME CELL. +# -memcache Use an in-memory cache rather than disk. +# -cachedir The base directory for the workstation cache. +# -mountdir The directory on which the AFS is to be mounted. +# -confdir The configuration directory . +# -nosettime Don't keep checking the time to avoid drift. +# -verbose Be chatty. +# -debug Print out additional debugging info. +# -kerndev [OBSOLETE] The kernel device for AFS. +# -dontfork [OBSOLETE] Don't fork off as a new process. +# -daemons The number of background daemons to start (Default: 2). +# -rmtsys Also fires up an afs remote sys call (e.g. pioctl, setpag) +# support daemon +# -chunksize [n] 2^n is the chunksize to be used. 0 is default. +# -dcache The number of data cache entries. +# -biods Number of bkg I/O daemons (AIX3.1 only) +# -prealloc Number of preallocated "small" memory blocks +# -pininodes Number of inodes which can be spared from inode[] for +# pointing at Vfiles. If this is set too high, you may have +# system problems, which can only be ameliorated by changing +# NINODE (or equivalent) and rebuilding the kernel. +# This option is now disabled. +# -logfile Place where to put the logfile (default in <cache>/etc/AFSLog. +# -waitclose make close calls always synchronous (slows em down, tho) +# -files_per_subdir [n] number of files per cache subdir. (def=2048) +# -shutdown Shutdown afs daemons +# --------------------------------------------------------------------------- +XXLARGE="-fakestat -stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000" +XLARGE="-fakestat -stat 3600 -dcache 3600 -daemons 5 -volumes 196 -files 50000" +LARGE="-fakestat -stat 2800 -dcache 2400 -daemons 5 -volumes 128" +MEDIUM="-fakestat -stat 2000 -dcache 800 -daemons 3 -volumes 70" +SMALL="-fakestat -stat 300 -dcache 100 -daemons 2 -volumes 50" +OPTIONS="AUTOMATIC" + diff --git a/net-fs/openafs/files/openrc/openafs-client.initd b/net-fs/openafs/files/openrc/openafs-client.initd new file mode 100644 index 000000000000..36dfa809435a --- /dev/null +++ b/net-fs/openafs/files/openrc/openafs-client.initd @@ -0,0 +1,137 @@ +#!/sbin/openrc-run +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net + after openafs-server + use logger dns +} + +BSD_MOD="/boot/modules/libafs.ko" + +choose_afsdoptions() { + CACHESIZE=$(cut -d ':' -f 3 /etc/openafs/cacheinfo) + if [ -z "$OPTIONS" ] || [ "$OPTIONS" = "AUTOMATIC" ] ; then + if [ $CACHESIZE -lt 131072 ] ; then + OPTIONS=$SMALL + elif [ $CACHESIZE -lt 524288 ] ; then + OPTIONS=$MEDIUM + elif [ $CACHESIZE -lt 1048576 ] ; then + OPTIONS=$LARGE + elif [ $CACHESIZE -lt 2097152 ] ; then + OPTIONS=$XLARGE + else + OPTIONS=$XXLARGE + fi + fi + AFSD_OPTIONS="$OPTIONS $VERBOSE" + [ "$ENABLE_AFSDB" = "yes" ] && AFSD_OPTIONS="$AFSD_OPTIONS -afsdb" + [ "$ENABLE_DYNROOT" = "yes" ] && AFSD_OPTIONS="$AFSD_OPTIONS -dynroot" +} + +get_logfile() { + local redirect="/dev/null" + yesno ${ENABLE_STD_LOGGING} && redirect="/var/log/openafs/client.log" + echo ${redirect} +} + +start() { + local ret=1 + ebegin "Starting OpenAFS client" + + eindent + + # Check if afsd is already running -> abort + if pgrep -u 0 afsd >/dev/null ; then + eerror "afsd already running, not attempting to restart" + # Check if the openafs kernel module is loaded -> attempt unload + elif [ "${RC_UNAME}" = "Linux" ] && [ -d /proc/fs/openafs ] ; then + ewarn "OpenAFS already active, trying to unload module" + if ! modprobe -r libafs ; then + eerror "OpenAFS kernel module was loaded, unloading failed" + else + cleanstart + ret=$? + fi + elif [ "${RC_UNAME}" = "FreeBSD" ] && kldstat -n ${BSD_MOD} 2> /dev/null; then + ewarn "OpenAFS already active, trying to unload module" + if ! kldunload ${BSD_MOD}; then + eerror "OpenAFS kernel module was loaded, unloading failed" + else + cleanstart + ret=$? + fi + # Everything should be ok, start cleanly + else + cleanstart + ret=$? + fi + + eend ${ret} + eoutdent + return ${ret} +} + +cleanstart() +{ + # Make sure the mountpoint exists + mkdir /afs 2> /dev/null + # Make sure the cache directory exists + # If config doesn't exist, create one + if [ ! -e /etc/openafs/cacheinfo ]; then + echo "/afs:/var/cache/openafs:200000" > /etc/openafs/cacheinfo + fi + CACHEDIR=$(cut -d ':' -f 2 /etc/openafs/cacheinfo) + if ! mkdir -p "${CACHEDIR}"; then + eerror "Unable to create cache dir ${CACHEDIR}" + return 1 + fi + + # Start openafs: module and daemon + ebegin "Loading OpenAFS kernel module" + if [ "${RC_UNAME}" = "Linux" ]; then + modprobe libafs + elif [ "${RC_UNAME}" = "FreeBSD" ]; then + kldload ${BSD_MOD} + else + eerror "Unknown system. Contact the package maintainer." + fi + eend $? || return 1 + + ebegin "Starting OpenAFS daemon" + choose_afsdoptions + /usr/sbin/afsd ${AFSD_OPTIONS} >$(get_logfile) 2>&1 + eend $? +} + +stop() { + local ret=1 + ebegin "Stopping OpenAFS client" + + eindent + + # Three stage process: unmount / stop daemon / unload module + ebegin "Unmounting /afs" + umount /afs + if eend $? ; then + ebegin "Stopping OpenAFS daemon" + /usr/sbin/afsd -shutdown >$(get_logfile) 2>&1 + if eend $? ; then + ebegin "Unloading OpenAFS module" + if [ "${RC_UNAME}" = "Linux" ]; then + modprobe -r libafs + elif [ "${RC_UNAME}" = "FreeBSD" ]; then + kldunload ${BSD_MOD} + else + eerror "Unknown system. Contact the package maintainer." + fi + eend $? && ret=0 + fi + fi + + eoutdent + # Clean up: remove the mountpoint if it's an empty directory + rmdir /afs 2>/dev/null + return ${ret} +} diff --git a/net-fs/openafs/files/openrc/openafs-server.confd b/net-fs/openafs/files/openrc/openafs-server.confd new file mode 100644 index 000000000000..de5948e45272 --- /dev/null +++ b/net-fs/openafs/files/openrc/openafs-server.confd @@ -0,0 +1,7 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# Add -syslog here AND in BosConfig to every daemon, if don't want to use +# OpenAFS's own logging system +BOSSERVER_OPTIONS="" + diff --git a/net-fs/openafs/files/openrc/openafs-server.initd b/net-fs/openafs/files/openrc/openafs-server.initd new file mode 100644 index 000000000000..ee2f6c4a003b --- /dev/null +++ b/net-fs/openafs/files/openrc/openafs-server.initd @@ -0,0 +1,33 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net + use logger dns +} + +start() { + ebegin "Starting OpenAFS BOS server" + start-stop-daemon \ + --quiet --start --background \ + --make-pidfile --pidfile /var/run/bosserver.pid \ + --exec /usr/sbin/bosserver \ + -- -nofork ${BOSSERVER_OPTIONS} + eend $? +} + +stop() { + local ret + ebegin "Stopping OpenAFS BOS server" + + # This kindly kills all server processes + /usr/bin/bos shutdown localhost -localauth -wait + ret=$? + if [ ${ret} -eq 0 ] ; then + start-stop-daemon --quiet --stop --pidfile /var/run/bosserver.pid + ret=$? + fi + + eend ${ret} +} diff --git a/net-fs/openafs/files/systemd/01-openafs-client.service b/net-fs/openafs/files/systemd/01-openafs-client.service new file mode 100644 index 000000000000..db77ceda1b2c --- /dev/null +++ b/net-fs/openafs/files/systemd/01-openafs-client.service @@ -0,0 +1,19 @@ +[Unit] +Description=OpenAFS Client Service +Wants=network-online.target +After=syslog.target network-online.target +Before=remote-fs.target + +[Service] +Type=forking +RemainAfterExit=true +ExecStart= /usr/libexec/openafs/openafs-client-systemd-helper.sh ExecStart +ExecStop= /usr/libexec/openafs/openafs-client-systemd-helper.sh ExecStop +ExecStopPost=/usr/libexec/openafs/openafs-client-systemd-helper.sh ExecStopPost +KillMode=process +GuessMainPID=no +SendSIGKILL=no +KillSignal=SIGCONT + +[Install] +WantedBy=multi-user.target remote-fs.target diff --git a/net-fs/openafs/files/systemd/openafs-client-systemd-helper.sh b/net-fs/openafs/files/systemd/openafs-client-systemd-helper.sh new file mode 100755 index 000000000000..ae3b5220e252 --- /dev/null +++ b/net-fs/openafs/files/systemd/openafs-client-systemd-helper.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# +# systemd helper script for openafs-client.service. This is only intended to be +# called from the openafs-client.service unit file. + +set -e + +UMOUNT_TIMEOUT=30 + +case $1 in + ExecStart) + if fs sysname >/dev/null 2>&1 ; then + # If we previously tried to stop the client and failed (because + # e.g. /afs was in use), our unit will be deactivated but the + # client will keep running. So if we're starting up, but the client + # is currently running, do not perform the startup sequence but + # just return success, to let the unit activate, so stopping the + # unit can go through the shutdown sequence again. + echo AFS client appears to be running -- skipping startup + exit 0 + fi + + # If the kernel module is already initialized from a previous client + # run, it must be unloaded and loaded again. So if the module is + # currently loaded, unload it in case it was (partly) initialized. + if lsmod | grep -wq ^libafs ; then + /sbin/rmmod --verbose libafs + fi + + CACHEDIR=$(cut -d ':' -f 2 /etc/openafs/cacheinfo) + if ! mkdir -p "${CACHEDIR}"; then + echo "Unable to create cache dir ${CACHEDIR}" + exit 1 + fi + + /sbin/modprobe --verbose libafs + exec /usr/sbin/afsd $AFSD_ARGS $AFSD_CACHE_ARGS + ;; + + ExecStop) + if /bin/umount --verbose /afs ; then + exit 0 + else + echo "Failed to unmount /afs: $?" + fi + + state=$(systemctl is-system-running || true) + if [ "$state" = stopping ] && [ x"$UMOUNT_TIMEOUT" != x ] && /bin/mountpoint --quiet /afs ; then + # If we are shutting down the system, failing to umount /afs + # can lead to longer delays later as systemd tries to forcibly + # kill our afsd processes. So retry the umount a few times, + # just in case other /afs-using processes just need a few + # seconds to go away. + echo "For system shutdown, retrying umount /afs for $UMOUNT_TIMEOUT secs" + interval=3 + for (( i = 0; i < $UMOUNT_TIMEOUT; i += $interval )) ; do + sleep $interval + if /bin/umount --verbose /afs ; then + exit 0 + fi + if ! /bin/mountpoint --quiet /afs ; then + echo "mountpoint /afs disappeared; bailing out" + exit 0 + fi + done + echo "Still cannot umount /afs, bailing out" + fi + exit 1 + ;; + + ExecStopPost) + /usr/sbin/afsd -shutdown || true + /sbin/rmmod --verbose libafs || true + if lsmod | grep -wq ^libafs ; then + echo "Cannot unload the OpenAFS client kernel module." + echo "systemd will consider the openafs-client.service unit inactive, but the AFS client may still be running." + echo "To stop the client, stop all access to /afs, and then either:" + echo "stop the client manually:" + echo " umount /afs" + echo " rmmod libafs" + echo "or start and stop the openafs-client.service unit:" + echo " systemctl start openafs-client.service" + echo " systemctl stop openafs-client.service" + echo 'See "journalctl -u openafs-client.service" for details.' + exit 1 + fi + exit 0 + ;; +esac + +echo "Usage: $0 {ExecStart|ExecStop|ExecStopPost}" >&2 +exit 1 diff --git a/net-fs/openafs/files/systemd/openafs-client.service b/net-fs/openafs/files/systemd/openafs-client.service new file mode 100644 index 000000000000..2cafd230277e --- /dev/null +++ b/net-fs/openafs/files/systemd/openafs-client.service @@ -0,0 +1,17 @@ +[Unit] +Description=OpenAFS Client Service +After=network.target remote-fs.target nss-lookup.target + +[Service] +Type=forking +ExecStartPre=/bin/sh -c "/bin/mkdir -p $(cut -d : -f 2 /etc/openafs/cacheinfo)" +ExecStartPre=/bin/sh -c "fs sysname > /dev/null 2>/dev/null; test $? -ne 0 || (echo AFS client appears to be running -- not starting && exit 1)" +ExecStartPre=/sbin/modprobe libafs +ExecStart=/usr/sbin/afsd $AFSD_ARGS $AFSD_CACHE_ARGS +ExecStop=/bin/umount /afs +ExecStopPost=/usr/sbin/afsd -shutdown +ExecStopPost=/sbin/rmmod libafs +KillMode=none + +[Install] +WantedBy=multi-user.target remote-fs.target diff --git a/net-fs/openafs/files/systemd/openafs-client.service.conf b/net-fs/openafs/files/systemd/openafs-client.service.conf new file mode 100644 index 000000000000..e06fd625d603 --- /dev/null +++ b/net-fs/openafs/files/systemd/openafs-client.service.conf @@ -0,0 +1,62 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# AFS client configuration options: +# --------------------------------------------------------------------------- +# possible AFS client afsd configuration options (from 1.3.74) are +# -afsdb Use DNS to lookup SRV or AFSDB records instead of +# reading the CellServDB file. +# -dynroot Dynamically generate /afs entries +# -blocks The number of blocks available in the workstation cache. +# -files The target number of files in the workstation cache (Default: +# 1000). +# -rootvol The name of the root volume to use. +# -stat The number of stat cache entries. +# -fakestat Return fake values for stat calls on cross-cell mounts. +# -hosts List of servers to check for volume location info FOR THE +# HOME CELL. +# -memcache Use an in-memory cache rather than disk. +# -cachedir The base directory for the workstation cache. +# -mountdir The directory on which the AFS is to be mounted. +# -confdir The configuration directory . +# -nosettime Don't keep checking the time to avoid drift. +# -verbose Be chatty. +# -debug Print out additional debugging info. +# -kerndev [OBSOLETE] The kernel device for AFS. +# -dontfork [OBSOLETE] Don't fork off as a new process. +# -daemons The number of background daemons to start (Default: 2). +# -rmtsys Also fires up an afs remote sys call (e.g. pioctl, setpag) +# support daemon +# -chunksize [n] 2^n is the chunksize to be used. 0 is default. +# -dcache The number of data cache entries. +# -biods Number of bkg I/O daemons (AIX3.1 only) +# -prealloc Number of preallocated "small" memory blocks +# -pininodes Number of inodes which can be spared from inode[] for +# pointing at Vfiles. If this is set too high, you may have +# system problems, which can only be ameliorated by changing +# NINODE (or equivalent) and rebuilding the kernel. +# This option is now disabled. +# -logfile Place where to put the logfile (default in <cache>/etc/AFSLog. +# -waitclose make close calls always synchronous (slows em down, tho) +# -files_per_subdir [n] number of files per cache subdir. (def=2048) +# -shutdown Shutdown afs daemons +# --------------------------------------------------------------------------- +[Service] +# afsd args +Environment="AFSD_ARGS=-afsdb -dynroot -fakestat" + +# XXL Cache +#"-stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000" +# XL Cache +#"-stat 3600 -dcache 3600 -daemons 5 -volumes 196 -files 50000" +# L Cache +#"-stat 2800 -dcache 2400 -daemons 5 -volumes 128" +# M Cache +#"-stat 2000 -dcache 800 -daemons 3 -volumes 70" +# S Cache +#"-stat 300 -dcache 100 -daemons 2 -volumes 50" + +# Set afsd cache args explicitly to one of the Gentoo defined cache-sizes or, +# preferably, set it automatically based on /etc/openafs/cacheinfo using: +# emerge --config openafs +#Environment="AFSD_CACHE_ARGS=" diff --git a/net-fs/openafs/files/systemd/openafs-server.service b/net-fs/openafs/files/systemd/openafs-server.service new file mode 100644 index 000000000000..92b48f1dec56 --- /dev/null +++ b/net-fs/openafs/files/systemd/openafs-server.service @@ -0,0 +1,11 @@ +[Unit] +Description=OpenAFS Server Service +After=syslog.target network.target + +[Service] +ExecStartPre=/bin/sh -c "/bin/mkdir -p $(cut -d : -f 2 /etc/openafs/cacheinfo)" +ExecStart=/usr/sbin/bosserver -nofork $BOSSERVER_ARGS +ExecStop=/usr/bin/bos shutdown localhost -wait -localauth + +[Install] +WantedBy=multi-user.target diff --git a/net-fs/openafs/files/systemd/openafs-server.service.conf b/net-fs/openafs/files/systemd/openafs-server.service.conf new file mode 100644 index 000000000000..feba47dcf356 --- /dev/null +++ b/net-fs/openafs/files/systemd/openafs-server.service.conf @@ -0,0 +1,4 @@ +[Service] +# Add options to bosserver, for example, add -syslog here AND in BosConfig +# to every daemon, if don't want to use OpenAFS's own logging system +#Environment="BOSSERVER_ARGS=-syslog" diff --git a/net-fs/openafs/files/systemd/tmpfiles.d/openafs-client.conf b/net-fs/openafs/files/systemd/tmpfiles.d/openafs-client.conf new file mode 100644 index 000000000000..52a9eee76109 --- /dev/null +++ b/net-fs/openafs/files/systemd/tmpfiles.d/openafs-client.conf @@ -0,0 +1 @@ +d /afs 0755 root root diff --git a/net-fs/openafs/metadata.xml b/net-fs/openafs/metadata.xml new file mode 100644 index 000000000000..ae8af51d80a4 --- /dev/null +++ b/net-fs/openafs/metadata.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person" proxied="yes"> + <email>cwills@witznd.net</email> + <name>Cheyenne Wills</name> + </maintainer> + <maintainer type="project" proxied="proxy"> + <email>proxy-maint@gentoo.org</email> + <name>Gentoo Proxy Maintainers Project</name> + </maintainer> +<use> + <flag name="apidoc">Build API documentation using <pkg>app-text/doxygen</pkg>. + May take a *long* time to build.</flag> + <flag name="bitmap-later">Enable fast startup of file server by not + reading bitmap till needed.</flag> + <flag name="fuse">Build fuse client.</flag> + <flag name="kauth">Install the DEPRECATED kauth server, PAM modules, and utilities</flag> + <flag name="modules">Build libafs kernel module. Disable only if you know + what you're doing: without this module OpenAFS client will not work.</flag> + <flag name="namei">Enable namei fileserver instead of inode fileserver. + You should disable this option only if compatibility with inode format AFS + storage is required. + </flag> + <flag name="pthreaded-ubik">Enable installation of pthreaded ubik applications.</flag> + <flag name="supergroups">Enable support for nested pts groups.</flag> + <flag name="tsm">Enable use of the Tivoli TSM API libraries from <pkg>app-backup/tsm</pkg> + for butc support. AMD64 only.</flag> + <flag name="ubik-read-while-write">Enable vlserver read from db cache during + write locks (EXPERIMENTAL)</flag> +</use> +</pkgmetadata> diff --git a/net-fs/openafs/openafs-1.8.13-r1.ebuild b/net-fs/openafs/openafs-1.8.13-r1.ebuild new file mode 100644 index 000000000000..4fb7e5e03049 --- /dev/null +++ b/net-fs/openafs/openafs-1.8.13-r1.ebuild @@ -0,0 +1,339 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MODULES_OPTIONAL_IUSE="modules" +inherit autotools linux-mod-r1 flag-o-matic pam systemd tmpfiles toolchain-funcs + +MY_PV=${PV/_/} +MY_P="${PN}-${MY_PV}" +KERNEL_LIMIT=6.11 + +DESCRIPTION="The OpenAFS distributed file system" +HOMEPAGE="https://www.openafs.org/" +# We always d/l the doc tarball as man pages are not USE=doc material +[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE="" +SRC_URI=" + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2 + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-doc.tar.bz2 +" + +S="${WORKDIR}/${MY_P}" + +LICENSE="IBM BSD openafs-krb5-a APSL-2" +SLOT="0" +KEYWORDS="amd64 -riscv ~sparc x86" + +IUSE="apidoc bitmap-later debug doc fuse kauth kerberos +modules +namei +ncurses perl +pthreaded-ubik selinux +supergroups tsm ubik-read-while-write" + +BDEPEND=" + dev-lang/perl + app-alternatives/lex + app-alternatives/yacc + apidoc? ( + app-text/doxygen[dot] + media-gfx/graphviz + ) + doc? ( + dev-libs/libxslt + || ( + >=dev-java/fop-2.10-r1:0 + app-text/dblatex + app-text/docbook-sgml-utils[jadetex] + ) + ) + perl? ( dev-lang/swig )" +DEPEND=" + virtual/libcrypt:= + virtual/libintl + amd64? ( tsm? ( app-backup/tsm ) ) + doc? ( + app-text/docbook-xsl-stylesheets + app-text/docbook-xml-dtd:4.3 + ) + fuse? ( sys-fs/fuse:0= ) + kauth? ( sys-libs/pam ) + kerberos? ( virtual/krb5 ) + ncurses? ( sys-libs/ncurses:0= )" +RDEPEND=" + ${DEPEND} + selinux? ( sec-policy/selinux-afs )" + +PATCHES=( + "${FILESDIR}"/0001-autoconf-use-AC_CHECK_TOOL-for-as-and-ld.patch + "${FILESDIR}"/0002-pam-paths.patch + "${FILESDIR}"/0003-fbsd.patch + "${FILESDIR}"/0004-sparc.patch + "${FILESDIR}"/0005-uname.patch + "${FILESDIR}"/0006-resolv.patch + "${FILESDIR}"/0007-afsauthent-symbols.patch + "${FILESDIR}"/0008-flags.patch + "${FILESDIR}"/0009-docbook2pdf.patch + "${FILESDIR}"/0010-libperl.patch + "${FILESDIR}"/0011-xbsa.patch + "${FILESDIR}"/0012-xml-dtd.patch + "${FILESDIR}"/0013-kernel-cc-ld.patch +) +CONFIG_CHECK="~!AFS_FS KEYS" +ERROR_AFS_FS="OpenAFS conflicts with the in-kernel AFS-support. Make sure not to load both at the same time!" +ERROR_KEYS="OpenAFS needs CONFIG_KEYS option enabled" + +pkg_pretend() { + if use modules && use kernel_linux && kernel_is -ge ${KERNEL_LIMIT/\./ } ; then + ewarn "Gentoo supports kernels which are supported by OpenAFS" + ewarn "which are limited to the kernel versions: < ${KERNEL_LIMIT}" + ewarn "" + ewarn "You are free to utilize eapply_user to provide whatever" + ewarn "support you feel is appropriate, but will not receive" + ewarn "support as a result of those changes." + ewarn "" + ewarn "Please do not file a bug report about this." + ewarn "" + ewarn "Alternatively, you may:" + ewarn "1. Use OpenAFS FUSE client, build OpenAFS with USE=fuse to enable it." + ewarn "2. Use native kernel AFS client: configure your kernel with CONFIG_AFS_FS." + ewarn "net-fs/openafs is not required in this case, but client's functionality will be limited." + fi +} + +pkg_setup() { + use kernel_linux && linux-mod-r1_pkg_setup +} + +src_prepare() { + default + + # fixing 2-nd level makefiles to honor flags + sed -i -r 's/\<CFLAGS[[:space:]]*=/CFLAGS+=/; s/\<LDFLAGS[[:space:]]*=/LDFLAGS+=/' \ + src/*/Makefile.in || die '*/Makefile.in sed failed' + + # build system is very delicate, so we can't run eautoreconf + # run autotools commands based on what is listed in regen.sh + _elibtoolize -c -f -i + eaclocal -I src/cf -I src/external/rra-c-util/m4 -I src/external/autoconf-archive/m4 + eautoconf + eautoconf -o configure-libafs configure-libafs.ac + eautoheader + einfo "Deleting autom4te.cache directory" + rm -rf autom4te.cache || die +} + +src_configure() { + # requires the --enable-static to avoid build errors. This is + # currently an upstream limitation. + local myconf=( + --enable-static + --disable-strip-binaries + $(use_enable bitmap-later) + $(use_enable debug) + $(use_enable debug debug-locks) + $(use_enable debug debug-lwp) + $(use_enable fuse fuse-client) + $(use_enable kauth) + $(use_enable modules kernel-module) + $(use_enable namei namei-fileserver) + $(use_enable ncurses gtx) + $(use_enable pthreaded-ubik) + $(use_enable supergroups) + $(use_enable ubik-read-while-write) + $(use_with apidoc dot) + $(use_with doc docbook-stylesheets /usr/share/sgml/docbook/xsl-stylesheets) + $(use_with kerberos krb5) + $(use_with perl swig) + ) + + # bug #861368 + filter-lto + + if use debug; then + use kauth && myconf+=( --enable-debug-pam ) + use modules && myconf+=( --enable-debug-kernel ) + fi + + if use modules; then + if use kernel_linux; then + if kernel_is -ge 3 17 && kernel_is -le 3 17 2; then + myconf+=( --enable-linux-d_splice_alias-extra-iput ) + fi + myconf+=( --with-linux-kernel-headers="${KV_DIR}" \ + --with-linux-kernel-build="${KV_OUT_DIR}" ) + fi + fi + + use amd64 && use tsm && myconf+=( --enable-tivoli-tsm ) + + local ARCH="$(tc-arch-kernel)" + local MY_ARCH="$(tc-arch)" + local BSD_BUILD_DIR="/usr/src/sys/${MY_ARCH}/compile/GENERIC" + + AFS_SYSKVERS=26 \ + econf "${myconf[@]}" + +} + +src_compile() { + ARCH="$(tc-arch-kernel)" AR="$(tc-getAR)" emake V=1 + local d + if use doc; then + emake -C doc/xml/AdminGuide auagd000.pdf + emake -C doc/xml/AdminRef auarf000.pdf + emake -C doc/xml/QuickStartUnix auqbg000.pdf + emake -C doc/xml/UserGuide auusg000.pdf + fi + if use apidoc; then + doxygen doc/doxygen/Doxyfile || die "Failed to build doxygen files" + fi +} + +src_install() { + local OPENRCDIR="${FILESDIR}/openrc" + local SYSTEMDDIR="${FILESDIR}/systemd" + + emake DESTDIR="${ED}" install_nolibafs + + if use modules; then + if use kernel_linux; then + local srcdir=$(expr "${S}"/src/libafs/MODLOAD-*) + [[ -f ${srcdir}/libafs.ko ]] || die "Couldn't find compiled kernel module" + linux_domodule ${srcdir}/libafs.ko + modules_post_process + fi + fi + + insinto /etc/openafs + doins src/afsd/CellServDB + newins "${FILESDIR}/ThisCell.default" ThisCell + newins "${FILESDIR}/cacheinfo.default" cacheinfo + + # pam_afs and pam_afs.krb have been installed in irregular locations, fix + if use kauth; then + dopammod "${ED}"/usr/$(get_libdir)/pam_afs* + fi + rm -f "${ED}"/usr/$(get_libdir)/pam_afs* || die + + # remove kdump stuff provided by kexec-tools #222455 + rm -rf "${ED}"/usr/sbin/kdump* || die + + # avoid collision with mit_krb5's version of kpasswd + if use kauth; then + mv "${ED}"/usr/bin/kpasswd{,_afs} || die + mv "${ED}"/usr/share/man/man1/kpasswd{,_afs}.1 || die + fi + + # avoid collision with heimdal's pagsh + if has_version app-crypt/heimdal; then + mv "${ED}"/usr/bin/pagsh{,_afs} || die + mv "${ED}"/usr/share/man/man1/pagsh{,_afs}.1 || die + fi + + # move lwp stuff around #200674 #330061 + mv "${ED}"/usr/include/{lwp,lock,timer}.h "${ED}"/usr/include/afs/ || die + mv "${ED}"/usr/$(get_libdir)/liblwp* "${ED}"/usr/$(get_libdir)/afs/ || die + # update paths to the relocated lwp headers + sed -ri \ + -e '/^#include <(lwp|lock|timer).h>/s:<([^>]*)>:<afs/\1>:' \ + "${ED}"/usr/include/*.h \ + "${ED}"/usr/include/*/*.h \ + || die + + # minimal documentation + use kauth && doman src/pam/pam_afs.5 + DOCS=( "${FILESDIR}/README.Gentoo" src/afsd/CellServDB NEWS README ) + + # documentation package + rm -rf doc/txt/winnotes || die # unneeded docs + if use doc; then + DOCS+=( doc/{pdf,protocol,txt} CODING CONTRIBUTING ) + newdoc doc/xml/AdminGuide/auagd000.pdf AdminGuide.pdf + newdoc doc/xml/AdminRef/auarf000.pdf AdminRef.pdf + newdoc doc/xml/QuickStartUnix/auqbg000.pdf QuickStartUnix.pdf + newdoc doc/xml/UserGuide/auusg000.pdf UserGuide.pdf + fi + use apidoc && DOCS+=( doc/doxygen/output/html ) + einstalldocs + + # Gentoo related scripts + newinitd "${OPENRCDIR}"/openafs-client.initd openafs-client + newconfd "${OPENRCDIR}"/openafs-client.confd openafs-client + newinitd "${OPENRCDIR}"/openafs-server.initd openafs-server + newconfd "${OPENRCDIR}"/openafs-server.confd openafs-server + dotmpfiles "${SYSTEMDDIR}"/tmpfiles.d/openafs-client.conf + systemd_dounit "${SYSTEMDDIR}"/openafs-client.service + systemd_dounit "${SYSTEMDDIR}"/openafs-server.service + systemd_install_serviced "${SYSTEMDDIR}"/openafs-client.service.conf + systemd_install_serviced "${SYSTEMDDIR}"/openafs-server.service.conf + + # used directories: client + keepdir /etc/openafs + + # used directories: server + keepdir /etc/openafs/server + diropts -m0700 + keepdir /var/lib/openafs + keepdir /var/lib/openafs/db + diropts -m0755 + keepdir /var/lib/openafs/logs + + # link logfiles to /var/log + dosym ../lib/openafs/logs /var/log/openafs +} + +pkg_preinst() { + ## Somewhat intelligently install default configuration files + ## (when they are not present) + local x + for x in cacheinfo CellServDB ThisCell ; do + if [[ -e "${EROOT}"/etc/openafs/${x} ]] ; then + cp "${EROOT}"/etc/openafs/${x} "${ED}"/etc/openafs/ + fi + done +} + +pkg_postinst() { + use kernel_linux && linux-mod-r1_pkg_postinst + + tmpfiles_process openafs-client.conf + + elog "This installation should work out of the box (at least the" + elog "client part doing global afs-cell browsing, unless you had" + elog "a previous and different configuration). If you want to" + elog "set up your own cell or modify the standard config," + elog "please have a look at the Gentoo OpenAFS documentation" + elog "(warning: it is not yet up to date wrt the new file locations)" + elog + elog "The documentation can be found at:" + elog " https://wiki.gentoo.org/wiki/OpenAFS" + elog + elog "Systemd users should run emerge --config ${CATEGORY}/${PN} before" + elog "first use and whenever ${EROOT}/etc/openafs/cacheinfo is edited." +} + +pkg_config() { + elog "Setting cache options for systemd." + + SERVICED_FILE="${EROOT}"/etc/systemd/system/openafs-client.service.d/00gentoo.conf + [[ ! -e "${SERVICED_FILE}" ]] && die "Systemd service.d file ${SERVICED_FILE} not found." + + CACHESIZE=$(cut -d ':' -f 3 "${EROOT}"/etc/openafs/cacheinfo) + [[ -z ${CACHESIZE} ]] && die "Failed to parse ${EROOT}/etc/openafs/cacheinfo." + + if [[ ${CACHESIZE} -lt 131070 ]]; then + AFSD_CACHE_ARGS="-stat 300 -dcache 100 -daemons 2 -volumes 50" + elif [[ ${CACHESIZE} -lt 524288 ]]; then + AFSD_CACHE_ARGS="-stat 2000 -dcache 800 -daemons 3 -volumes 70" + elif [[ ${CACHESIZE} -lt 1048576 ]]; then + AFSD_CACHE_ARGS="-stat 2800 -dcache 2400 -daemons 5 -volumes 128" + elif [[ ${CACHESIZE} -lt 2209715 ]]; then + AFSD_CACHE_ARGS="-stat 3600 -dcache 3600 -daemons 5 -volumes 196 -files 50000" + else + AFSD_CACHE_ARGS="-stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000" + fi + + # Replace existing env var if exists, else append line + grep -q "^Environment=\"AFSD_CACHE_ARGS=" "${SERVICED_FILE}" && \ + sed -i "s/^Environment=\"AFSD_CACHE_ARGS=.*/Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"/" "${SERVICED_FILE}" || \ + sed -i "$ a\Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"" "${SERVICED_FILE}" || \ + die "Updating ${SERVICED_FILE} failed." +} diff --git a/net-fs/openafs/openafs-1.8.13-r2.ebuild b/net-fs/openafs/openafs-1.8.13-r2.ebuild new file mode 100644 index 000000000000..c18d2d5e3690 --- /dev/null +++ b/net-fs/openafs/openafs-1.8.13-r2.ebuild @@ -0,0 +1,341 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MODULES_OPTIONAL_IUSE="modules" +inherit autotools linux-mod-r1 flag-o-matic pam systemd tmpfiles toolchain-funcs + +MY_PV=${PV/_/} +MY_P="${PN}-${MY_PV}" +KERNEL_LIMIT=6.11 + +DESCRIPTION="The OpenAFS distributed file system" +HOMEPAGE="https://www.openafs.org/" +# We always d/l the doc tarball as man pages are not USE=doc material +[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE="" +SRC_URI=" + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2 + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-doc.tar.bz2 +" + +S="${WORKDIR}/${MY_P}" + +LICENSE="IBM BSD openafs-krb5-a APSL-2" +SLOT="0" +KEYWORDS="~amd64 -riscv ~sparc ~x86" + +IUSE="apidoc bitmap-later debug doc fuse kauth kerberos +modules +namei +ncurses perl +pthreaded-ubik selinux +supergroups tsm ubik-read-while-write" + +BDEPEND=" + dev-lang/perl + app-alternatives/lex + app-alternatives/yacc + apidoc? ( + app-text/doxygen[dot] + media-gfx/graphviz + ) + doc? ( + dev-libs/libxslt + || ( + >=dev-java/fop-2.10-r1:0 + app-text/dblatex + app-text/docbook-sgml-utils[jadetex] + ) + ) + perl? ( dev-lang/swig )" +DEPEND=" + virtual/libcrypt:= + virtual/libintl + amd64? ( tsm? ( app-backup/tsm ) ) + doc? ( + app-text/docbook-xsl-stylesheets + app-text/docbook-xml-dtd:4.3 + ) + fuse? ( sys-fs/fuse:0= ) + kauth? ( sys-libs/pam ) + kerberos? ( virtual/krb5 ) + ncurses? ( sys-libs/ncurses:0= )" +RDEPEND=" + ${DEPEND} + selinux? ( sec-policy/selinux-afs )" + +PATCHES=( + "${FILESDIR}"/0001-autoconf-use-AC_CHECK_TOOL-for-as-and-ld.patch + "${FILESDIR}"/0002-pam-paths.patch + "${FILESDIR}"/0003-fbsd.patch + "${FILESDIR}"/0004-sparc.patch + "${FILESDIR}"/0005-uname.patch + "${FILESDIR}"/0006-resolv.patch + "${FILESDIR}"/0007-afsauthent-symbols.patch + "${FILESDIR}"/0008-flags.patch + "${FILESDIR}"/0009-docbook2pdf.patch + "${FILESDIR}"/0010-libperl.patch + "${FILESDIR}"/0011-xbsa.patch + "${FILESDIR}"/0012-xml-dtd.patch + "${FILESDIR}"/0013-kernel-cc-ld.patch + "${FILESDIR}"/0014-upstream-struct-init.patch + "${FILESDIR}"/0015-upstream-struct-desiginated-init.patch +) +CONFIG_CHECK="~!AFS_FS KEYS" +ERROR_AFS_FS="OpenAFS conflicts with the in-kernel AFS-support. Make sure not to load both at the same time!" +ERROR_KEYS="OpenAFS needs CONFIG_KEYS option enabled" + +pkg_pretend() { + if use modules && use kernel_linux && kernel_is -ge ${KERNEL_LIMIT/\./ } ; then + ewarn "Gentoo supports kernels which are supported by OpenAFS" + ewarn "which are limited to the kernel versions: < ${KERNEL_LIMIT}" + ewarn "" + ewarn "You are free to utilize eapply_user to provide whatever" + ewarn "support you feel is appropriate, but will not receive" + ewarn "support as a result of those changes." + ewarn "" + ewarn "Please do not file a bug report about this." + ewarn "" + ewarn "Alternatively, you may:" + ewarn "1. Use OpenAFS FUSE client, build OpenAFS with USE=fuse to enable it." + ewarn "2. Use native kernel AFS client: configure your kernel with CONFIG_AFS_FS." + ewarn "net-fs/openafs is not required in this case, but client's functionality will be limited." + fi +} + +pkg_setup() { + use kernel_linux && linux-mod-r1_pkg_setup +} + +src_prepare() { + default + + # fixing 2-nd level makefiles to honor flags + sed -i -r 's/\<CFLAGS[[:space:]]*=/CFLAGS+=/; s/\<LDFLAGS[[:space:]]*=/LDFLAGS+=/' \ + src/*/Makefile.in || die '*/Makefile.in sed failed' + + # build system is very delicate, so we can't run eautoreconf + # run autotools commands based on what is listed in regen.sh + _elibtoolize -c -f -i + eaclocal -I src/cf -I src/external/rra-c-util/m4 -I src/external/autoconf-archive/m4 + eautoconf + eautoconf -o configure-libafs configure-libafs.ac + eautoheader + einfo "Deleting autom4te.cache directory" + rm -rf autom4te.cache || die +} + +src_configure() { + # requires the --enable-static to avoid build errors. This is + # currently an upstream limitation. + local myconf=( + --enable-static + --disable-strip-binaries + $(use_enable bitmap-later) + $(use_enable debug) + $(use_enable debug debug-locks) + $(use_enable debug debug-lwp) + $(use_enable fuse fuse-client) + $(use_enable kauth) + $(use_enable modules kernel-module) + $(use_enable namei namei-fileserver) + $(use_enable ncurses gtx) + $(use_enable pthreaded-ubik) + $(use_enable supergroups) + $(use_enable ubik-read-while-write) + $(use_with apidoc dot) + $(use_with doc docbook-stylesheets /usr/share/sgml/docbook/xsl-stylesheets) + $(use_with kerberos krb5) + $(use_with perl swig) + ) + + # bug #861368 + filter-lto + + if use debug; then + use kauth && myconf+=( --enable-debug-pam ) + use modules && myconf+=( --enable-debug-kernel ) + fi + + if use modules; then + if use kernel_linux; then + if kernel_is -ge 3 17 && kernel_is -le 3 17 2; then + myconf+=( --enable-linux-d_splice_alias-extra-iput ) + fi + myconf+=( --with-linux-kernel-headers="${KV_DIR}" \ + --with-linux-kernel-build="${KV_OUT_DIR}" ) + fi + fi + + use amd64 && use tsm && myconf+=( --enable-tivoli-tsm ) + + local ARCH="$(tc-arch-kernel)" + local MY_ARCH="$(tc-arch)" + local BSD_BUILD_DIR="/usr/src/sys/${MY_ARCH}/compile/GENERIC" + + AFS_SYSKVERS=26 \ + econf "${myconf[@]}" + +} + +src_compile() { + ARCH="$(tc-arch-kernel)" AR="$(tc-getAR)" emake V=1 + local d + if use doc; then + emake -C doc/xml/AdminGuide auagd000.pdf + emake -C doc/xml/AdminRef auarf000.pdf + emake -C doc/xml/QuickStartUnix auqbg000.pdf + emake -C doc/xml/UserGuide auusg000.pdf + fi + if use apidoc; then + doxygen doc/doxygen/Doxyfile || die "Failed to build doxygen files" + fi +} + +src_install() { + local OPENRCDIR="${FILESDIR}/openrc" + local SYSTEMDDIR="${FILESDIR}/systemd" + + emake DESTDIR="${ED}" install_nolibafs + + if use modules; then + if use kernel_linux; then + local srcdir=$(expr "${S}"/src/libafs/MODLOAD-*) + [[ -f ${srcdir}/libafs.ko ]] || die "Couldn't find compiled kernel module" + linux_domodule ${srcdir}/libafs.ko + modules_post_process + fi + fi + + insinto /etc/openafs + doins src/afsd/CellServDB + newins "${FILESDIR}/ThisCell.default" ThisCell + newins "${FILESDIR}/cacheinfo.default" cacheinfo + + # pam_afs and pam_afs.krb have been installed in irregular locations, fix + if use kauth; then + dopammod "${ED}"/usr/$(get_libdir)/pam_afs* + fi + rm -f "${ED}"/usr/$(get_libdir)/pam_afs* || die + + # remove kdump stuff provided by kexec-tools #222455 + rm -rf "${ED}"/usr/sbin/kdump* || die + + # avoid collision with mit_krb5's version of kpasswd + if use kauth; then + mv "${ED}"/usr/bin/kpasswd{,_afs} || die + mv "${ED}"/usr/share/man/man1/kpasswd{,_afs}.1 || die + fi + + # avoid collision with heimdal's pagsh + if has_version app-crypt/heimdal; then + mv "${ED}"/usr/bin/pagsh{,_afs} || die + mv "${ED}"/usr/share/man/man1/pagsh{,_afs}.1 || die + fi + + # move lwp stuff around #200674 #330061 + mv "${ED}"/usr/include/{lwp,lock,timer}.h "${ED}"/usr/include/afs/ || die + mv "${ED}"/usr/$(get_libdir)/liblwp* "${ED}"/usr/$(get_libdir)/afs/ || die + # update paths to the relocated lwp headers + sed -ri \ + -e '/^#include <(lwp|lock|timer).h>/s:<([^>]*)>:<afs/\1>:' \ + "${ED}"/usr/include/*.h \ + "${ED}"/usr/include/*/*.h \ + || die + + # minimal documentation + use kauth && doman src/pam/pam_afs.5 + DOCS=( "${FILESDIR}/README.Gentoo" src/afsd/CellServDB NEWS README ) + + # documentation package + rm -rf doc/txt/winnotes || die # unneeded docs + if use doc; then + DOCS+=( doc/{pdf,protocol,txt} CODING CONTRIBUTING ) + newdoc doc/xml/AdminGuide/auagd000.pdf AdminGuide.pdf + newdoc doc/xml/AdminRef/auarf000.pdf AdminRef.pdf + newdoc doc/xml/QuickStartUnix/auqbg000.pdf QuickStartUnix.pdf + newdoc doc/xml/UserGuide/auusg000.pdf UserGuide.pdf + fi + use apidoc && DOCS+=( doc/doxygen/output/html ) + einstalldocs + + # Gentoo related scripts + newinitd "${OPENRCDIR}"/openafs-client.initd openafs-client + newconfd "${OPENRCDIR}"/openafs-client.confd openafs-client + newinitd "${OPENRCDIR}"/openafs-server.initd openafs-server + newconfd "${OPENRCDIR}"/openafs-server.confd openafs-server + dotmpfiles "${SYSTEMDDIR}"/tmpfiles.d/openafs-client.conf + systemd_dounit "${SYSTEMDDIR}"/openafs-client.service + systemd_dounit "${SYSTEMDDIR}"/openafs-server.service + systemd_install_serviced "${SYSTEMDDIR}"/openafs-client.service.conf + systemd_install_serviced "${SYSTEMDDIR}"/openafs-server.service.conf + + # used directories: client + keepdir /etc/openafs + + # used directories: server + keepdir /etc/openafs/server + diropts -m0700 + keepdir /var/lib/openafs + keepdir /var/lib/openafs/db + diropts -m0755 + keepdir /var/lib/openafs/logs + + # link logfiles to /var/log + dosym ../lib/openafs/logs /var/log/openafs +} + +pkg_preinst() { + ## Somewhat intelligently install default configuration files + ## (when they are not present) + local x + for x in cacheinfo CellServDB ThisCell ; do + if [[ -e "${EROOT}"/etc/openafs/${x} ]] ; then + cp "${EROOT}"/etc/openafs/${x} "${ED}"/etc/openafs/ + fi + done +} + +pkg_postinst() { + use kernel_linux && linux-mod-r1_pkg_postinst + + tmpfiles_process openafs-client.conf + + elog "This installation should work out of the box (at least the" + elog "client part doing global afs-cell browsing, unless you had" + elog "a previous and different configuration). If you want to" + elog "set up your own cell or modify the standard config," + elog "please have a look at the Gentoo OpenAFS documentation" + elog "(warning: it is not yet up to date wrt the new file locations)" + elog + elog "The documentation can be found at:" + elog " https://wiki.gentoo.org/wiki/OpenAFS" + elog + elog "Systemd users should run emerge --config ${CATEGORY}/${PN} before" + elog "first use and whenever ${EROOT}/etc/openafs/cacheinfo is edited." +} + +pkg_config() { + elog "Setting cache options for systemd." + + SERVICED_FILE="${EROOT}"/etc/systemd/system/openafs-client.service.d/00gentoo.conf + [[ ! -e "${SERVICED_FILE}" ]] && die "Systemd service.d file ${SERVICED_FILE} not found." + + CACHESIZE=$(cut -d ':' -f 3 "${EROOT}"/etc/openafs/cacheinfo) + [[ -z ${CACHESIZE} ]] && die "Failed to parse ${EROOT}/etc/openafs/cacheinfo." + + if [[ ${CACHESIZE} -lt 131070 ]]; then + AFSD_CACHE_ARGS="-stat 300 -dcache 100 -daemons 2 -volumes 50" + elif [[ ${CACHESIZE} -lt 524288 ]]; then + AFSD_CACHE_ARGS="-stat 2000 -dcache 800 -daemons 3 -volumes 70" + elif [[ ${CACHESIZE} -lt 1048576 ]]; then + AFSD_CACHE_ARGS="-stat 2800 -dcache 2400 -daemons 5 -volumes 128" + elif [[ ${CACHESIZE} -lt 2209715 ]]; then + AFSD_CACHE_ARGS="-stat 3600 -dcache 3600 -daemons 5 -volumes 196 -files 50000" + else + AFSD_CACHE_ARGS="-stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000" + fi + + # Replace existing env var if exists, else append line + grep -q "^Environment=\"AFSD_CACHE_ARGS=" "${SERVICED_FILE}" && \ + sed -i "s/^Environment=\"AFSD_CACHE_ARGS=.*/Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"/" "${SERVICED_FILE}" || \ + sed -i "$ a\Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"" "${SERVICED_FILE}" || \ + die "Updating ${SERVICED_FILE} failed." +} diff --git a/net-fs/openafs/openafs-1.8.13.1-r1.ebuild b/net-fs/openafs/openafs-1.8.13.1-r1.ebuild new file mode 100644 index 000000000000..87eec90789a7 --- /dev/null +++ b/net-fs/openafs/openafs-1.8.13.1-r1.ebuild @@ -0,0 +1,348 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MODULES_OPTIONAL_IUSE="modules" +inherit autotools linux-mod-r1 flag-o-matic pam systemd tmpfiles toolchain-funcs + +MY_PV=${PV/_/} +MY_P="${PN}-${MY_PV}" +KERNEL_LIMIT=6.12 + +DESCRIPTION="The OpenAFS distributed file system" +HOMEPAGE="https://www.openafs.org/" +# We always d/l the doc tarball as man pages are not USE=doc material +[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE="" +SRC_URI=" + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2 + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-doc.tar.bz2 +" + +S="${WORKDIR}/${MY_P}" + +LICENSE="IBM BSD openafs-krb5-a APSL-2" +SLOT="0" +KEYWORDS="~amd64 -riscv ~sparc ~x86" + +IUSE="apidoc bitmap-later debug doc fuse kauth kerberos +modules +namei +ncurses perl +pthreaded-ubik selinux +supergroups tsm ubik-read-while-write" + +BDEPEND=" + dev-lang/perl + app-alternatives/lex + app-alternatives/yacc + apidoc? ( + app-text/doxygen[dot] + media-gfx/graphviz + ) + doc? ( + dev-libs/libxslt + || ( + >=dev-java/fop-2.10-r1:0 + app-text/dblatex + app-text/docbook-sgml-utils[jadetex] + ) + ) + perl? ( dev-lang/swig )" +DEPEND=" + virtual/libcrypt:= + virtual/libintl + amd64? ( tsm? ( app-backup/tsm ) ) + doc? ( + app-text/docbook-xsl-stylesheets + app-text/docbook-xml-dtd:4.3 + ) + fuse? ( sys-fs/fuse:0= ) + kauth? ( sys-libs/pam ) + kerberos? ( virtual/krb5 ) + ncurses? ( sys-libs/ncurses:0= )" +RDEPEND=" + ${DEPEND} + selinux? ( sec-policy/selinux-afs )" + +PATCHES=( + "${FILESDIR}"/0001-autoconf-use-AC_CHECK_TOOL-for-as-and-ld.patch + "${FILESDIR}"/0002-pam-paths.patch + "${FILESDIR}"/0003-fbsd.patch + "${FILESDIR}"/0004-sparc.patch + "${FILESDIR}"/0005-uname.patch + "${FILESDIR}"/0006-resolv.patch + "${FILESDIR}"/0007-afsauthent-symbols.patch + "${FILESDIR}"/0008-flags.patch + "${FILESDIR}"/0009-docbook2pdf.patch + "${FILESDIR}"/0010-libperl.patch + "${FILESDIR}"/0011-xbsa.patch + "${FILESDIR}"/0012-xml-dtd.patch + "${FILESDIR}"/0013-kernel-cc-ld.patch + "${FILESDIR}"/0014-upstream-struct-init.patch + "${FILESDIR}"/0015-upstream-struct-desiginated-init.patch +) +# see https://bugs.gentoo.org/943641 +# Upstream performs uses customized autoconf routines to check for +# the availability of various functions and the warnings/errors in +# the config log for implicit function declarations are expected +# and therefore are false positives. +QA_CONFIG_IMPL_DECL_SKIP=("*") + +CONFIG_CHECK="~!AFS_FS KEYS" +ERROR_AFS_FS="OpenAFS conflicts with the in-kernel AFS-support. Make sure not to load both at the same time!" +ERROR_KEYS="OpenAFS needs CONFIG_KEYS option enabled" + +pkg_pretend() { + if use modules && use kernel_linux && kernel_is -ge ${KERNEL_LIMIT/\./ } ; then + ewarn "Gentoo supports kernels which are supported by OpenAFS" + ewarn "which are limited to the kernel versions: < ${KERNEL_LIMIT}" + ewarn "" + ewarn "You are free to utilize eapply_user to provide whatever" + ewarn "support you feel is appropriate, but will not receive" + ewarn "support as a result of those changes." + ewarn "" + ewarn "Please do not file a bug report about this." + ewarn "" + ewarn "Alternatively, you may:" + ewarn "1. Use OpenAFS FUSE client, build OpenAFS with USE=fuse to enable it." + ewarn "2. Use native kernel AFS client: configure your kernel with CONFIG_AFS_FS." + ewarn "net-fs/openafs is not required in this case, but client's functionality will be limited." + fi +} + +pkg_setup() { + use kernel_linux && linux-mod-r1_pkg_setup +} + +src_prepare() { + default + + # fixing 2-nd level makefiles to honor flags + sed -i -r 's/\<CFLAGS[[:space:]]*=/CFLAGS+=/; s/\<LDFLAGS[[:space:]]*=/LDFLAGS+=/' \ + src/*/Makefile.in || die '*/Makefile.in sed failed' + + # build system is very delicate, so we can't run eautoreconf + # run autotools commands based on what is listed in regen.sh + _elibtoolize -c -f -i + eaclocal -I src/cf -I src/external/rra-c-util/m4 -I src/external/autoconf-archive/m4 + eautoconf + eautoconf -o configure-libafs configure-libafs.ac + eautoheader + einfo "Deleting autom4te.cache directory" + rm -rf autom4te.cache || die +} + +src_configure() { + # requires the --enable-static to avoid build errors. This is + # currently an upstream limitation. + local myconf=( + --enable-static + --disable-strip-binaries + $(use_enable bitmap-later) + $(use_enable debug) + $(use_enable debug debug-locks) + $(use_enable debug debug-lwp) + $(use_enable fuse fuse-client) + $(use_enable kauth) + $(use_enable modules kernel-module) + $(use_enable namei namei-fileserver) + $(use_enable ncurses gtx) + $(use_enable pthreaded-ubik) + $(use_enable supergroups) + $(use_enable ubik-read-while-write) + $(use_with apidoc dot) + $(use_with doc docbook-stylesheets /usr/share/sgml/docbook/xsl-stylesheets) + $(use_with kerberos krb5) + $(use_with perl swig) + ) + + # bug #861368 + filter-lto + + if use debug; then + use kauth && myconf+=( --enable-debug-pam ) + use modules && myconf+=( --enable-debug-kernel ) + fi + + if use modules; then + if use kernel_linux; then + if kernel_is -ge 3 17 && kernel_is -le 3 17 2; then + myconf+=( --enable-linux-d_splice_alias-extra-iput ) + fi + myconf+=( --with-linux-kernel-headers="${KV_DIR}" \ + --with-linux-kernel-build="${KV_OUT_DIR}" ) + fi + fi + + use amd64 && use tsm && myconf+=( --enable-tivoli-tsm ) + + local ARCH="$(tc-arch-kernel)" + local MY_ARCH="$(tc-arch)" + local BSD_BUILD_DIR="/usr/src/sys/${MY_ARCH}/compile/GENERIC" + + AFS_SYSKVERS=26 \ + econf "${myconf[@]}" + +} + +src_compile() { + ARCH="$(tc-arch-kernel)" AR="$(tc-getAR)" emake V=1 + local d + if use doc; then + emake -C doc/xml/AdminGuide auagd000.pdf + emake -C doc/xml/AdminRef auarf000.pdf + emake -C doc/xml/QuickStartUnix auqbg000.pdf + emake -C doc/xml/UserGuide auusg000.pdf + fi + if use apidoc; then + doxygen doc/doxygen/Doxyfile || die "Failed to build doxygen files" + fi +} + +src_install() { + local OPENRCDIR="${FILESDIR}/openrc" + local SYSTEMDDIR="${FILESDIR}/systemd" + + emake DESTDIR="${ED}" install_nolibafs + + if use modules; then + if use kernel_linux; then + local srcdir=$(expr "${S}"/src/libafs/MODLOAD-*) + [[ -f ${srcdir}/libafs.ko ]] || die "Couldn't find compiled kernel module" + linux_domodule ${srcdir}/libafs.ko + modules_post_process + fi + fi + + insinto /etc/openafs + doins src/afsd/CellServDB + newins "${FILESDIR}/ThisCell.default" ThisCell + newins "${FILESDIR}/cacheinfo.default" cacheinfo + + # pam_afs and pam_afs.krb have been installed in irregular locations, fix + if use kauth; then + dopammod "${ED}"/usr/$(get_libdir)/pam_afs* + fi + rm -f "${ED}"/usr/$(get_libdir)/pam_afs* || die + + # remove kdump stuff provided by kexec-tools #222455 + rm -rf "${ED}"/usr/sbin/kdump* || die + + # avoid collision with mit_krb5's version of kpasswd + if use kauth; then + mv "${ED}"/usr/bin/kpasswd{,_afs} || die + mv "${ED}"/usr/share/man/man1/kpasswd{,_afs}.1 || die + fi + + # avoid collision with heimdal's pagsh + if has_version app-crypt/heimdal; then + mv "${ED}"/usr/bin/pagsh{,_afs} || die + mv "${ED}"/usr/share/man/man1/pagsh{,_afs}.1 || die + fi + + # move lwp stuff around #200674 #330061 + mv "${ED}"/usr/include/{lwp,lock,timer}.h "${ED}"/usr/include/afs/ || die + mv "${ED}"/usr/$(get_libdir)/liblwp* "${ED}"/usr/$(get_libdir)/afs/ || die + # update paths to the relocated lwp headers + sed -ri \ + -e '/^#include <(lwp|lock|timer).h>/s:<([^>]*)>:<afs/\1>:' \ + "${ED}"/usr/include/*.h \ + "${ED}"/usr/include/*/*.h \ + || die + + # minimal documentation + use kauth && doman src/pam/pam_afs.5 + DOCS=( "${FILESDIR}/README.Gentoo" src/afsd/CellServDB NEWS README ) + + # documentation package + rm -rf doc/txt/winnotes || die # unneeded docs + if use doc; then + DOCS+=( doc/{pdf,protocol,txt} CODING CONTRIBUTING ) + newdoc doc/xml/AdminGuide/auagd000.pdf AdminGuide.pdf + newdoc doc/xml/AdminRef/auarf000.pdf AdminRef.pdf + newdoc doc/xml/QuickStartUnix/auqbg000.pdf QuickStartUnix.pdf + newdoc doc/xml/UserGuide/auusg000.pdf UserGuide.pdf + fi + use apidoc && DOCS+=( doc/doxygen/output/html ) + einstalldocs + + # Gentoo related scripts + newinitd "${OPENRCDIR}"/openafs-client.initd openafs-client + newconfd "${OPENRCDIR}"/openafs-client.confd openafs-client + newinitd "${OPENRCDIR}"/openafs-server.initd openafs-server + newconfd "${OPENRCDIR}"/openafs-server.confd openafs-server + dotmpfiles "${SYSTEMDDIR}"/tmpfiles.d/openafs-client.conf + systemd_dounit "${SYSTEMDDIR}"/openafs-client.service + systemd_dounit "${SYSTEMDDIR}"/openafs-server.service + systemd_install_serviced "${SYSTEMDDIR}"/openafs-client.service.conf + systemd_install_serviced "${SYSTEMDDIR}"/openafs-server.service.conf + + # used directories: client + keepdir /etc/openafs + + # used directories: server + keepdir /etc/openafs/server + diropts -m0700 + keepdir /var/lib/openafs + keepdir /var/lib/openafs/db + diropts -m0755 + keepdir /var/lib/openafs/logs + + # link logfiles to /var/log + dosym ../lib/openafs/logs /var/log/openafs +} + +pkg_preinst() { + ## Somewhat intelligently install default configuration files + ## (when they are not present) + local x + for x in cacheinfo CellServDB ThisCell ; do + if [[ -e "${EROOT}"/etc/openafs/${x} ]] ; then + cp "${EROOT}"/etc/openafs/${x} "${ED}"/etc/openafs/ + fi + done +} + +pkg_postinst() { + use kernel_linux && linux-mod-r1_pkg_postinst + + tmpfiles_process openafs-client.conf + + elog "This installation should work out of the box (at least the" + elog "client part doing global afs-cell browsing, unless you had" + elog "a previous and different configuration). If you want to" + elog "set up your own cell or modify the standard config," + elog "please have a look at the Gentoo OpenAFS documentation" + elog "(warning: it is not yet up to date wrt the new file locations)" + elog + elog "The documentation can be found at:" + elog " https://wiki.gentoo.org/wiki/OpenAFS" + elog + elog "Systemd users should run emerge --config ${CATEGORY}/${PN} before" + elog "first use and whenever ${EROOT}/etc/openafs/cacheinfo is edited." +} + +pkg_config() { + elog "Setting cache options for systemd." + + SERVICED_FILE="${EROOT}"/etc/systemd/system/openafs-client.service.d/00gentoo.conf + [[ ! -e "${SERVICED_FILE}" ]] && die "Systemd service.d file ${SERVICED_FILE} not found." + + CACHESIZE=$(cut -d ':' -f 3 "${EROOT}"/etc/openafs/cacheinfo) + [[ -z ${CACHESIZE} ]] && die "Failed to parse ${EROOT}/etc/openafs/cacheinfo." + + if [[ ${CACHESIZE} -lt 131070 ]]; then + AFSD_CACHE_ARGS="-stat 300 -dcache 100 -daemons 2 -volumes 50" + elif [[ ${CACHESIZE} -lt 524288 ]]; then + AFSD_CACHE_ARGS="-stat 2000 -dcache 800 -daemons 3 -volumes 70" + elif [[ ${CACHESIZE} -lt 1048576 ]]; then + AFSD_CACHE_ARGS="-stat 2800 -dcache 2400 -daemons 5 -volumes 128" + elif [[ ${CACHESIZE} -lt 2209715 ]]; then + AFSD_CACHE_ARGS="-stat 3600 -dcache 3600 -daemons 5 -volumes 196 -files 50000" + else + AFSD_CACHE_ARGS="-stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000" + fi + + # Replace existing env var if exists, else append line + grep -q "^Environment=\"AFSD_CACHE_ARGS=" "${SERVICED_FILE}" && \ + sed -i "s/^Environment=\"AFSD_CACHE_ARGS=.*/Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"/" "${SERVICED_FILE}" || \ + sed -i "$ a\Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"" "${SERVICED_FILE}" || \ + die "Updating ${SERVICED_FILE} failed." +} diff --git a/net-fs/openafs/openafs-1.8.13.1.ebuild b/net-fs/openafs/openafs-1.8.13.1.ebuild new file mode 100644 index 000000000000..4fb00de284d9 --- /dev/null +++ b/net-fs/openafs/openafs-1.8.13.1.ebuild @@ -0,0 +1,346 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MODULES_OPTIONAL_IUSE="modules" +inherit autotools linux-mod-r1 flag-o-matic pam systemd tmpfiles toolchain-funcs + +MY_PV=${PV/_/} +MY_P="${PN}-${MY_PV}" +KERNEL_LIMIT=6.12 + +DESCRIPTION="The OpenAFS distributed file system" +HOMEPAGE="https://www.openafs.org/" +# We always d/l the doc tarball as man pages are not USE=doc material +[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE="" +SRC_URI=" + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2 + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-doc.tar.bz2 +" + +S="${WORKDIR}/${MY_P}" + +LICENSE="IBM BSD openafs-krb5-a APSL-2" +SLOT="0" +KEYWORDS="~amd64 -riscv ~sparc ~x86" + +IUSE="apidoc bitmap-later debug doc fuse kauth kerberos +modules +namei +ncurses perl +pthreaded-ubik selinux +supergroups tsm ubik-read-while-write" + +BDEPEND=" + dev-lang/perl + app-alternatives/lex + app-alternatives/yacc + apidoc? ( + app-text/doxygen[dot] + media-gfx/graphviz + ) + doc? ( + dev-libs/libxslt + || ( + >=dev-java/fop-2.10-r1:0 + app-text/dblatex + app-text/docbook-sgml-utils[jadetex] + ) + ) + perl? ( dev-lang/swig )" +DEPEND=" + virtual/libcrypt:= + virtual/libintl + amd64? ( tsm? ( app-backup/tsm ) ) + doc? ( + app-text/docbook-xsl-stylesheets + app-text/docbook-xml-dtd:4.3 + ) + fuse? ( sys-fs/fuse:0= ) + kauth? ( sys-libs/pam ) + kerberos? ( virtual/krb5 ) + ncurses? ( sys-libs/ncurses:0= )" +RDEPEND=" + ${DEPEND} + selinux? ( sec-policy/selinux-afs )" + +PATCHES=( + "${FILESDIR}"/0001-autoconf-use-AC_CHECK_TOOL-for-as-and-ld.patch + "${FILESDIR}"/0002-pam-paths.patch + "${FILESDIR}"/0003-fbsd.patch + "${FILESDIR}"/0004-sparc.patch + "${FILESDIR}"/0005-uname.patch + "${FILESDIR}"/0006-resolv.patch + "${FILESDIR}"/0007-afsauthent-symbols.patch + "${FILESDIR}"/0008-flags.patch + "${FILESDIR}"/0009-docbook2pdf.patch + "${FILESDIR}"/0010-libperl.patch + "${FILESDIR}"/0011-xbsa.patch + "${FILESDIR}"/0012-xml-dtd.patch + "${FILESDIR}"/0013-kernel-cc-ld.patch +) +# see https://bugs.gentoo.org/943641 +# Upstream performs uses customized autoconf routines to check for +# the availability of various functions and the warnings/errors in +# the config log for implicit function declarations are expected +# and therefore are false positives. +QA_CONFIG_IMPL_DECL_SKIP=("*") + +CONFIG_CHECK="~!AFS_FS KEYS" +ERROR_AFS_FS="OpenAFS conflicts with the in-kernel AFS-support. Make sure not to load both at the same time!" +ERROR_KEYS="OpenAFS needs CONFIG_KEYS option enabled" + +pkg_pretend() { + if use modules && use kernel_linux && kernel_is -ge ${KERNEL_LIMIT/\./ } ; then + ewarn "Gentoo supports kernels which are supported by OpenAFS" + ewarn "which are limited to the kernel versions: < ${KERNEL_LIMIT}" + ewarn "" + ewarn "You are free to utilize eapply_user to provide whatever" + ewarn "support you feel is appropriate, but will not receive" + ewarn "support as a result of those changes." + ewarn "" + ewarn "Please do not file a bug report about this." + ewarn "" + ewarn "Alternatively, you may:" + ewarn "1. Use OpenAFS FUSE client, build OpenAFS with USE=fuse to enable it." + ewarn "2. Use native kernel AFS client: configure your kernel with CONFIG_AFS_FS." + ewarn "net-fs/openafs is not required in this case, but client's functionality will be limited." + fi +} + +pkg_setup() { + use kernel_linux && linux-mod-r1_pkg_setup +} + +src_prepare() { + default + + # fixing 2-nd level makefiles to honor flags + sed -i -r 's/\<CFLAGS[[:space:]]*=/CFLAGS+=/; s/\<LDFLAGS[[:space:]]*=/LDFLAGS+=/' \ + src/*/Makefile.in || die '*/Makefile.in sed failed' + + # build system is very delicate, so we can't run eautoreconf + # run autotools commands based on what is listed in regen.sh + _elibtoolize -c -f -i + eaclocal -I src/cf -I src/external/rra-c-util/m4 -I src/external/autoconf-archive/m4 + eautoconf + eautoconf -o configure-libafs configure-libafs.ac + eautoheader + einfo "Deleting autom4te.cache directory" + rm -rf autom4te.cache || die +} + +src_configure() { + # requires the --enable-static to avoid build errors. This is + # currently an upstream limitation. + local myconf=( + --enable-static + --disable-strip-binaries + $(use_enable bitmap-later) + $(use_enable debug) + $(use_enable debug debug-locks) + $(use_enable debug debug-lwp) + $(use_enable fuse fuse-client) + $(use_enable kauth) + $(use_enable modules kernel-module) + $(use_enable namei namei-fileserver) + $(use_enable ncurses gtx) + $(use_enable pthreaded-ubik) + $(use_enable supergroups) + $(use_enable ubik-read-while-write) + $(use_with apidoc dot) + $(use_with doc docbook-stylesheets /usr/share/sgml/docbook/xsl-stylesheets) + $(use_with kerberos krb5) + $(use_with perl swig) + ) + + # bug #861368 + filter-lto + + if use debug; then + use kauth && myconf+=( --enable-debug-pam ) + use modules && myconf+=( --enable-debug-kernel ) + fi + + if use modules; then + if use kernel_linux; then + if kernel_is -ge 3 17 && kernel_is -le 3 17 2; then + myconf+=( --enable-linux-d_splice_alias-extra-iput ) + fi + myconf+=( --with-linux-kernel-headers="${KV_DIR}" \ + --with-linux-kernel-build="${KV_OUT_DIR}" ) + fi + fi + + use amd64 && use tsm && myconf+=( --enable-tivoli-tsm ) + + local ARCH="$(tc-arch-kernel)" + local MY_ARCH="$(tc-arch)" + local BSD_BUILD_DIR="/usr/src/sys/${MY_ARCH}/compile/GENERIC" + + AFS_SYSKVERS=26 \ + econf "${myconf[@]}" + +} + +src_compile() { + ARCH="$(tc-arch-kernel)" AR="$(tc-getAR)" emake V=1 + local d + if use doc; then + emake -C doc/xml/AdminGuide auagd000.pdf + emake -C doc/xml/AdminRef auarf000.pdf + emake -C doc/xml/QuickStartUnix auqbg000.pdf + emake -C doc/xml/UserGuide auusg000.pdf + fi + if use apidoc; then + doxygen doc/doxygen/Doxyfile || die "Failed to build doxygen files" + fi +} + +src_install() { + local OPENRCDIR="${FILESDIR}/openrc" + local SYSTEMDDIR="${FILESDIR}/systemd" + + emake DESTDIR="${ED}" install_nolibafs + + if use modules; then + if use kernel_linux; then + local srcdir=$(expr "${S}"/src/libafs/MODLOAD-*) + [[ -f ${srcdir}/libafs.ko ]] || die "Couldn't find compiled kernel module" + linux_domodule ${srcdir}/libafs.ko + modules_post_process + fi + fi + + insinto /etc/openafs + doins src/afsd/CellServDB + newins "${FILESDIR}/ThisCell.default" ThisCell + newins "${FILESDIR}/cacheinfo.default" cacheinfo + + # pam_afs and pam_afs.krb have been installed in irregular locations, fix + if use kauth; then + dopammod "${ED}"/usr/$(get_libdir)/pam_afs* + fi + rm -f "${ED}"/usr/$(get_libdir)/pam_afs* || die + + # remove kdump stuff provided by kexec-tools #222455 + rm -rf "${ED}"/usr/sbin/kdump* || die + + # avoid collision with mit_krb5's version of kpasswd + if use kauth; then + mv "${ED}"/usr/bin/kpasswd{,_afs} || die + mv "${ED}"/usr/share/man/man1/kpasswd{,_afs}.1 || die + fi + + # avoid collision with heimdal's pagsh + if has_version app-crypt/heimdal; then + mv "${ED}"/usr/bin/pagsh{,_afs} || die + mv "${ED}"/usr/share/man/man1/pagsh{,_afs}.1 || die + fi + + # move lwp stuff around #200674 #330061 + mv "${ED}"/usr/include/{lwp,lock,timer}.h "${ED}"/usr/include/afs/ || die + mv "${ED}"/usr/$(get_libdir)/liblwp* "${ED}"/usr/$(get_libdir)/afs/ || die + # update paths to the relocated lwp headers + sed -ri \ + -e '/^#include <(lwp|lock|timer).h>/s:<([^>]*)>:<afs/\1>:' \ + "${ED}"/usr/include/*.h \ + "${ED}"/usr/include/*/*.h \ + || die + + # minimal documentation + use kauth && doman src/pam/pam_afs.5 + DOCS=( "${FILESDIR}/README.Gentoo" src/afsd/CellServDB NEWS README ) + + # documentation package + rm -rf doc/txt/winnotes || die # unneeded docs + if use doc; then + DOCS+=( doc/{pdf,protocol,txt} CODING CONTRIBUTING ) + newdoc doc/xml/AdminGuide/auagd000.pdf AdminGuide.pdf + newdoc doc/xml/AdminRef/auarf000.pdf AdminRef.pdf + newdoc doc/xml/QuickStartUnix/auqbg000.pdf QuickStartUnix.pdf + newdoc doc/xml/UserGuide/auusg000.pdf UserGuide.pdf + fi + use apidoc && DOCS+=( doc/doxygen/output/html ) + einstalldocs + + # Gentoo related scripts + newinitd "${OPENRCDIR}"/openafs-client.initd openafs-client + newconfd "${OPENRCDIR}"/openafs-client.confd openafs-client + newinitd "${OPENRCDIR}"/openafs-server.initd openafs-server + newconfd "${OPENRCDIR}"/openafs-server.confd openafs-server + dotmpfiles "${SYSTEMDDIR}"/tmpfiles.d/openafs-client.conf + systemd_dounit "${SYSTEMDDIR}"/openafs-client.service + systemd_dounit "${SYSTEMDDIR}"/openafs-server.service + systemd_install_serviced "${SYSTEMDDIR}"/openafs-client.service.conf + systemd_install_serviced "${SYSTEMDDIR}"/openafs-server.service.conf + + # used directories: client + keepdir /etc/openafs + + # used directories: server + keepdir /etc/openafs/server + diropts -m0700 + keepdir /var/lib/openafs + keepdir /var/lib/openafs/db + diropts -m0755 + keepdir /var/lib/openafs/logs + + # link logfiles to /var/log + dosym ../lib/openafs/logs /var/log/openafs +} + +pkg_preinst() { + ## Somewhat intelligently install default configuration files + ## (when they are not present) + local x + for x in cacheinfo CellServDB ThisCell ; do + if [[ -e "${EROOT}"/etc/openafs/${x} ]] ; then + cp "${EROOT}"/etc/openafs/${x} "${ED}"/etc/openafs/ + fi + done +} + +pkg_postinst() { + use kernel_linux && linux-mod-r1_pkg_postinst + + tmpfiles_process openafs-client.conf + + elog "This installation should work out of the box (at least the" + elog "client part doing global afs-cell browsing, unless you had" + elog "a previous and different configuration). If you want to" + elog "set up your own cell or modify the standard config," + elog "please have a look at the Gentoo OpenAFS documentation" + elog "(warning: it is not yet up to date wrt the new file locations)" + elog + elog "The documentation can be found at:" + elog " https://wiki.gentoo.org/wiki/OpenAFS" + elog + elog "Systemd users should run emerge --config ${CATEGORY}/${PN} before" + elog "first use and whenever ${EROOT}/etc/openafs/cacheinfo is edited." +} + +pkg_config() { + elog "Setting cache options for systemd." + + SERVICED_FILE="${EROOT}"/etc/systemd/system/openafs-client.service.d/00gentoo.conf + [[ ! -e "${SERVICED_FILE}" ]] && die "Systemd service.d file ${SERVICED_FILE} not found." + + CACHESIZE=$(cut -d ':' -f 3 "${EROOT}"/etc/openafs/cacheinfo) + [[ -z ${CACHESIZE} ]] && die "Failed to parse ${EROOT}/etc/openafs/cacheinfo." + + if [[ ${CACHESIZE} -lt 131070 ]]; then + AFSD_CACHE_ARGS="-stat 300 -dcache 100 -daemons 2 -volumes 50" + elif [[ ${CACHESIZE} -lt 524288 ]]; then + AFSD_CACHE_ARGS="-stat 2000 -dcache 800 -daemons 3 -volumes 70" + elif [[ ${CACHESIZE} -lt 1048576 ]]; then + AFSD_CACHE_ARGS="-stat 2800 -dcache 2400 -daemons 5 -volumes 128" + elif [[ ${CACHESIZE} -lt 2209715 ]]; then + AFSD_CACHE_ARGS="-stat 3600 -dcache 3600 -daemons 5 -volumes 196 -files 50000" + else + AFSD_CACHE_ARGS="-stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000" + fi + + # Replace existing env var if exists, else append line + grep -q "^Environment=\"AFSD_CACHE_ARGS=" "${SERVICED_FILE}" && \ + sed -i "s/^Environment=\"AFSD_CACHE_ARGS=.*/Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"/" "${SERVICED_FILE}" || \ + sed -i "$ a\Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"" "${SERVICED_FILE}" || \ + die "Updating ${SERVICED_FILE} failed." +} diff --git a/net-fs/openafs/openafs-1.8.13.2-r1.ebuild b/net-fs/openafs/openafs-1.8.13.2-r1.ebuild new file mode 100644 index 000000000000..c9acb3e8a75f --- /dev/null +++ b/net-fs/openafs/openafs-1.8.13.2-r1.ebuild @@ -0,0 +1,348 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MODULES_OPTIONAL_IUSE="modules" +inherit autotools linux-mod-r1 flag-o-matic pam systemd tmpfiles toolchain-funcs + +MY_PV=${PV/_/} +MY_P="${PN}-${MY_PV}" +KERNEL_LIMIT=6.13 + +DESCRIPTION="The OpenAFS distributed file system" +HOMEPAGE="https://www.openafs.org/" +# We always d/l the doc tarball as man pages are not USE=doc material +[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE="" +SRC_URI=" + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2 + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-doc.tar.bz2 +" + +S="${WORKDIR}/${MY_P}" + +LICENSE="IBM BSD openafs-krb5-a APSL-2" +SLOT="0" +KEYWORDS="amd64 -riscv ~sparc x86" + +IUSE="apidoc bitmap-later debug doc fuse kauth kerberos +modules +namei +ncurses perl +pthreaded-ubik selinux +supergroups tsm ubik-read-while-write" + +BDEPEND=" + dev-lang/perl + app-alternatives/lex + app-alternatives/yacc + apidoc? ( + app-text/doxygen[dot] + media-gfx/graphviz + ) + doc? ( + dev-libs/libxslt + || ( + >=dev-java/fop-2.10-r1:0 + app-text/dblatex + app-text/docbook-sgml-utils[jadetex] + ) + ) + perl? ( dev-lang/swig )" +DEPEND=" + virtual/libcrypt:= + virtual/libintl + amd64? ( tsm? ( app-backup/tsm ) ) + doc? ( + app-text/docbook-xsl-stylesheets + app-text/docbook-xml-dtd:4.3 + ) + fuse? ( sys-fs/fuse:0= ) + kauth? ( sys-libs/pam ) + kerberos? ( virtual/krb5 ) + ncurses? ( sys-libs/ncurses:0= )" +RDEPEND=" + ${DEPEND} + selinux? ( sec-policy/selinux-afs )" + +PATCHES=( + "${FILESDIR}"/0001-autoconf-use-AC_CHECK_TOOL-for-as-and-ld.patch + "${FILESDIR}"/0002-pam-paths.patch + "${FILESDIR}"/0003-fbsd.patch + "${FILESDIR}"/0004-sparc.patch + "${FILESDIR}"/0005-uname.patch + "${FILESDIR}"/0006-resolv.patch + "${FILESDIR}"/0007-afsauthent-symbols.patch + "${FILESDIR}"/0008-flags.patch + "${FILESDIR}"/0009-docbook2pdf.patch + "${FILESDIR}"/0010-libperl.patch + "${FILESDIR}"/0011-xbsa.patch + "${FILESDIR}"/0012-xml-dtd.patch + "${FILESDIR}"/0013-kernel-cc-ld.patch + "${FILESDIR}"/0014-upstream-struct-init.patch + "${FILESDIR}"/0015-upstream-struct-desiginated-init.patch +) +# see https://bugs.gentoo.org/943641 +# Upstream performs uses customized autoconf routines to check for +# the availability of various functions and the warnings/errors in +# the config log for implicit function declarations are expected +# and therefore are false positives. +QA_CONFIG_IMPL_DECL_SKIP=("*") + +CONFIG_CHECK="~!AFS_FS KEYS" +ERROR_AFS_FS="OpenAFS conflicts with the in-kernel AFS-support. Make sure not to load both at the same time!" +ERROR_KEYS="OpenAFS needs CONFIG_KEYS option enabled" + +pkg_pretend() { + if use modules && use kernel_linux && kernel_is -ge ${KERNEL_LIMIT/\./ } ; then + ewarn "Gentoo supports kernels which are supported by OpenAFS" + ewarn "which are limited to the kernel versions: < ${KERNEL_LIMIT}" + ewarn "" + ewarn "You are free to utilize eapply_user to provide whatever" + ewarn "support you feel is appropriate, but will not receive" + ewarn "support as a result of those changes." + ewarn "" + ewarn "Please do not file a bug report about this." + ewarn "" + ewarn "Alternatively, you may:" + ewarn "1. Use OpenAFS FUSE client, build OpenAFS with USE=fuse to enable it." + ewarn "2. Use native kernel AFS client: configure your kernel with CONFIG_AFS_FS." + ewarn "net-fs/openafs is not required in this case, but client's functionality will be limited." + fi +} + +pkg_setup() { + use kernel_linux && linux-mod-r1_pkg_setup +} + +src_prepare() { + default + + # fixing 2-nd level makefiles to honor flags + sed -i -r 's/\<CFLAGS[[:space:]]*=/CFLAGS+=/; s/\<LDFLAGS[[:space:]]*=/LDFLAGS+=/' \ + src/*/Makefile.in || die '*/Makefile.in sed failed' + + # build system is very delicate, so we can't run eautoreconf + # run autotools commands based on what is listed in regen.sh + _elibtoolize -c -f -i + eaclocal -I src/cf -I src/external/rra-c-util/m4 -I src/external/autoconf-archive/m4 + eautoconf + eautoconf -o configure-libafs configure-libafs.ac + eautoheader + einfo "Deleting autom4te.cache directory" + rm -rf autom4te.cache || die +} + +src_configure() { + # requires the --enable-static to avoid build errors. This is + # currently an upstream limitation. + local myconf=( + --enable-static + --disable-strip-binaries + $(use_enable bitmap-later) + $(use_enable debug) + $(use_enable debug debug-locks) + $(use_enable debug debug-lwp) + $(use_enable fuse fuse-client) + $(use_enable kauth) + $(use_enable modules kernel-module) + $(use_enable namei namei-fileserver) + $(use_enable ncurses gtx) + $(use_enable pthreaded-ubik) + $(use_enable supergroups) + $(use_enable ubik-read-while-write) + $(use_with apidoc dot) + $(use_with doc docbook-stylesheets /usr/share/sgml/docbook/xsl-stylesheets) + $(use_with kerberos krb5) + $(use_with perl swig) + ) + + # bug #861368 + filter-lto + + if use debug; then + use kauth && myconf+=( --enable-debug-pam ) + use modules && myconf+=( --enable-debug-kernel ) + fi + + if use modules; then + if use kernel_linux; then + if kernel_is -ge 3 17 && kernel_is -le 3 17 2; then + myconf+=( --enable-linux-d_splice_alias-extra-iput ) + fi + myconf+=( --with-linux-kernel-headers="${KV_DIR}" \ + --with-linux-kernel-build="${KV_OUT_DIR}" ) + fi + fi + + use amd64 && use tsm && myconf+=( --enable-tivoli-tsm ) + + local ARCH="$(tc-arch-kernel)" + local MY_ARCH="$(tc-arch)" + local BSD_BUILD_DIR="/usr/src/sys/${MY_ARCH}/compile/GENERIC" + + AFS_SYSKVERS=26 \ + econf "${myconf[@]}" + +} + +src_compile() { + ARCH="$(tc-arch-kernel)" AR="$(tc-getAR)" emake V=1 + local d + if use doc; then + emake -C doc/xml/AdminGuide auagd000.pdf + emake -C doc/xml/AdminRef auarf000.pdf + emake -C doc/xml/QuickStartUnix auqbg000.pdf + emake -C doc/xml/UserGuide auusg000.pdf + fi + if use apidoc; then + doxygen doc/doxygen/Doxyfile || die "Failed to build doxygen files" + fi +} + +src_install() { + local OPENRCDIR="${FILESDIR}/openrc" + local SYSTEMDDIR="${FILESDIR}/systemd" + + emake DESTDIR="${ED}" install_nolibafs + + if use modules; then + if use kernel_linux; then + local srcdir=$(expr "${S}"/src/libafs/MODLOAD-*) + [[ -f ${srcdir}/libafs.ko ]] || die "Couldn't find compiled kernel module" + linux_domodule ${srcdir}/libafs.ko + modules_post_process + fi + fi + + insinto /etc/openafs + doins src/afsd/CellServDB + newins "${FILESDIR}/ThisCell.default" ThisCell + newins "${FILESDIR}/cacheinfo.default" cacheinfo + + # pam_afs and pam_afs.krb have been installed in irregular locations, fix + if use kauth; then + dopammod "${ED}"/usr/$(get_libdir)/pam_afs* + fi + rm -f "${ED}"/usr/$(get_libdir)/pam_afs* || die + + # remove kdump stuff provided by kexec-tools #222455 + rm -rf "${ED}"/usr/sbin/kdump* || die + + # avoid collision with mit_krb5's version of kpasswd + if use kauth; then + mv "${ED}"/usr/bin/kpasswd{,_afs} || die + mv "${ED}"/usr/share/man/man1/kpasswd{,_afs}.1 || die + fi + + # avoid collision with heimdal's pagsh + if has_version app-crypt/heimdal; then + mv "${ED}"/usr/bin/pagsh{,_afs} || die + mv "${ED}"/usr/share/man/man1/pagsh{,_afs}.1 || die + fi + + # move lwp stuff around #200674 #330061 + mv "${ED}"/usr/include/{lwp,lock,timer}.h "${ED}"/usr/include/afs/ || die + mv "${ED}"/usr/$(get_libdir)/liblwp* "${ED}"/usr/$(get_libdir)/afs/ || die + # update paths to the relocated lwp headers + sed -ri \ + -e '/^#include <(lwp|lock|timer).h>/s:<([^>]*)>:<afs/\1>:' \ + "${ED}"/usr/include/*.h \ + "${ED}"/usr/include/*/*.h \ + || die + + # minimal documentation + use kauth && doman src/pam/pam_afs.5 + DOCS=( "${FILESDIR}/README.Gentoo" src/afsd/CellServDB NEWS README ) + + # documentation package + rm -rf doc/txt/winnotes || die # unneeded docs + if use doc; then + DOCS+=( doc/{pdf,protocol,txt} CODING CONTRIBUTING ) + newdoc doc/xml/AdminGuide/auagd000.pdf AdminGuide.pdf + newdoc doc/xml/AdminRef/auarf000.pdf AdminRef.pdf + newdoc doc/xml/QuickStartUnix/auqbg000.pdf QuickStartUnix.pdf + newdoc doc/xml/UserGuide/auusg000.pdf UserGuide.pdf + fi + use apidoc && DOCS+=( doc/doxygen/output/html ) + einstalldocs + + # Gentoo related scripts + newinitd "${OPENRCDIR}"/openafs-client.initd openafs-client + newconfd "${OPENRCDIR}"/openafs-client.confd openafs-client + newinitd "${OPENRCDIR}"/openafs-server.initd openafs-server + newconfd "${OPENRCDIR}"/openafs-server.confd openafs-server + dotmpfiles "${SYSTEMDDIR}"/tmpfiles.d/openafs-client.conf + systemd_dounit "${SYSTEMDDIR}"/openafs-client.service + systemd_dounit "${SYSTEMDDIR}"/openafs-server.service + systemd_install_serviced "${SYSTEMDDIR}"/openafs-client.service.conf + systemd_install_serviced "${SYSTEMDDIR}"/openafs-server.service.conf + + # used directories: client + keepdir /etc/openafs + + # used directories: server + keepdir /etc/openafs/server + diropts -m0700 + keepdir /var/lib/openafs + keepdir /var/lib/openafs/db + diropts -m0755 + keepdir /var/lib/openafs/logs + + # link logfiles to /var/log + dosym ../lib/openafs/logs /var/log/openafs +} + +pkg_preinst() { + ## Somewhat intelligently install default configuration files + ## (when they are not present) + local x + for x in cacheinfo CellServDB ThisCell ; do + if [[ -e "${EROOT}"/etc/openafs/${x} ]] ; then + cp "${EROOT}"/etc/openafs/${x} "${ED}"/etc/openafs/ + fi + done +} + +pkg_postinst() { + use kernel_linux && linux-mod-r1_pkg_postinst + + tmpfiles_process openafs-client.conf + + elog "This installation should work out of the box (at least the" + elog "client part doing global afs-cell browsing, unless you had" + elog "a previous and different configuration). If you want to" + elog "set up your own cell or modify the standard config," + elog "please have a look at the Gentoo OpenAFS documentation" + elog "(warning: it is not yet up to date wrt the new file locations)" + elog + elog "The documentation can be found at:" + elog " https://wiki.gentoo.org/wiki/OpenAFS" + elog + elog "Systemd users should run emerge --config ${CATEGORY}/${PN} before" + elog "first use and whenever ${EROOT}/etc/openafs/cacheinfo is edited." +} + +pkg_config() { + elog "Setting cache options for systemd." + + SERVICED_FILE="${EROOT}"/etc/systemd/system/openafs-client.service.d/00gentoo.conf + [[ ! -e "${SERVICED_FILE}" ]] && die "Systemd service.d file ${SERVICED_FILE} not found." + + CACHESIZE=$(cut -d ':' -f 3 "${EROOT}"/etc/openafs/cacheinfo) + [[ -z ${CACHESIZE} ]] && die "Failed to parse ${EROOT}/etc/openafs/cacheinfo." + + if [[ ${CACHESIZE} -lt 131070 ]]; then + AFSD_CACHE_ARGS="-stat 300 -dcache 100 -daemons 2 -volumes 50" + elif [[ ${CACHESIZE} -lt 524288 ]]; then + AFSD_CACHE_ARGS="-stat 2000 -dcache 800 -daemons 3 -volumes 70" + elif [[ ${CACHESIZE} -lt 1048576 ]]; then + AFSD_CACHE_ARGS="-stat 2800 -dcache 2400 -daemons 5 -volumes 128" + elif [[ ${CACHESIZE} -lt 2209715 ]]; then + AFSD_CACHE_ARGS="-stat 3600 -dcache 3600 -daemons 5 -volumes 196 -files 50000" + else + AFSD_CACHE_ARGS="-stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000" + fi + + # Replace existing env var if exists, else append line + grep -q "^Environment=\"AFSD_CACHE_ARGS=" "${SERVICED_FILE}" && \ + sed -i "s/^Environment=\"AFSD_CACHE_ARGS=.*/Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"/" "${SERVICED_FILE}" || \ + sed -i "$ a\Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"" "${SERVICED_FILE}" || \ + die "Updating ${SERVICED_FILE} failed." +} diff --git a/net-fs/openafs/openafs-1.8.13.2.ebuild b/net-fs/openafs/openafs-1.8.13.2.ebuild new file mode 100644 index 000000000000..8f6eccfd5f25 --- /dev/null +++ b/net-fs/openafs/openafs-1.8.13.2.ebuild @@ -0,0 +1,346 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MODULES_OPTIONAL_IUSE="modules" +inherit autotools linux-mod-r1 flag-o-matic pam systemd tmpfiles toolchain-funcs + +MY_PV=${PV/_/} +MY_P="${PN}-${MY_PV}" +KERNEL_LIMIT=6.13 + +DESCRIPTION="The OpenAFS distributed file system" +HOMEPAGE="https://www.openafs.org/" +# We always d/l the doc tarball as man pages are not USE=doc material +[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE="" +SRC_URI=" + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2 + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-doc.tar.bz2 +" + +S="${WORKDIR}/${MY_P}" + +LICENSE="IBM BSD openafs-krb5-a APSL-2" +SLOT="0" +KEYWORDS="~amd64 -riscv ~sparc ~x86" + +IUSE="apidoc bitmap-later debug doc fuse kauth kerberos +modules +namei +ncurses perl +pthreaded-ubik selinux +supergroups tsm ubik-read-while-write" + +BDEPEND=" + dev-lang/perl + app-alternatives/lex + app-alternatives/yacc + apidoc? ( + app-text/doxygen[dot] + media-gfx/graphviz + ) + doc? ( + dev-libs/libxslt + || ( + >=dev-java/fop-2.10-r1:0 + app-text/dblatex + app-text/docbook-sgml-utils[jadetex] + ) + ) + perl? ( dev-lang/swig )" +DEPEND=" + virtual/libcrypt:= + virtual/libintl + amd64? ( tsm? ( app-backup/tsm ) ) + doc? ( + app-text/docbook-xsl-stylesheets + app-text/docbook-xml-dtd:4.3 + ) + fuse? ( sys-fs/fuse:0= ) + kauth? ( sys-libs/pam ) + kerberos? ( virtual/krb5 ) + ncurses? ( sys-libs/ncurses:0= )" +RDEPEND=" + ${DEPEND} + selinux? ( sec-policy/selinux-afs )" + +PATCHES=( + "${FILESDIR}"/0001-autoconf-use-AC_CHECK_TOOL-for-as-and-ld.patch + "${FILESDIR}"/0002-pam-paths.patch + "${FILESDIR}"/0003-fbsd.patch + "${FILESDIR}"/0004-sparc.patch + "${FILESDIR}"/0005-uname.patch + "${FILESDIR}"/0006-resolv.patch + "${FILESDIR}"/0007-afsauthent-symbols.patch + "${FILESDIR}"/0008-flags.patch + "${FILESDIR}"/0009-docbook2pdf.patch + "${FILESDIR}"/0010-libperl.patch + "${FILESDIR}"/0011-xbsa.patch + "${FILESDIR}"/0012-xml-dtd.patch + "${FILESDIR}"/0013-kernel-cc-ld.patch +) +# see https://bugs.gentoo.org/943641 +# Upstream performs uses customized autoconf routines to check for +# the availability of various functions and the warnings/errors in +# the config log for implicit function declarations are expected +# and therefore are false positives. +QA_CONFIG_IMPL_DECL_SKIP=("*") + +CONFIG_CHECK="~!AFS_FS KEYS" +ERROR_AFS_FS="OpenAFS conflicts with the in-kernel AFS-support. Make sure not to load both at the same time!" +ERROR_KEYS="OpenAFS needs CONFIG_KEYS option enabled" + +pkg_pretend() { + if use modules && use kernel_linux && kernel_is -ge ${KERNEL_LIMIT/\./ } ; then + ewarn "Gentoo supports kernels which are supported by OpenAFS" + ewarn "which are limited to the kernel versions: < ${KERNEL_LIMIT}" + ewarn "" + ewarn "You are free to utilize eapply_user to provide whatever" + ewarn "support you feel is appropriate, but will not receive" + ewarn "support as a result of those changes." + ewarn "" + ewarn "Please do not file a bug report about this." + ewarn "" + ewarn "Alternatively, you may:" + ewarn "1. Use OpenAFS FUSE client, build OpenAFS with USE=fuse to enable it." + ewarn "2. Use native kernel AFS client: configure your kernel with CONFIG_AFS_FS." + ewarn "net-fs/openafs is not required in this case, but client's functionality will be limited." + fi +} + +pkg_setup() { + use kernel_linux && linux-mod-r1_pkg_setup +} + +src_prepare() { + default + + # fixing 2-nd level makefiles to honor flags + sed -i -r 's/\<CFLAGS[[:space:]]*=/CFLAGS+=/; s/\<LDFLAGS[[:space:]]*=/LDFLAGS+=/' \ + src/*/Makefile.in || die '*/Makefile.in sed failed' + + # build system is very delicate, so we can't run eautoreconf + # run autotools commands based on what is listed in regen.sh + _elibtoolize -c -f -i + eaclocal -I src/cf -I src/external/rra-c-util/m4 -I src/external/autoconf-archive/m4 + eautoconf + eautoconf -o configure-libafs configure-libafs.ac + eautoheader + einfo "Deleting autom4te.cache directory" + rm -rf autom4te.cache || die +} + +src_configure() { + # requires the --enable-static to avoid build errors. This is + # currently an upstream limitation. + local myconf=( + --enable-static + --disable-strip-binaries + $(use_enable bitmap-later) + $(use_enable debug) + $(use_enable debug debug-locks) + $(use_enable debug debug-lwp) + $(use_enable fuse fuse-client) + $(use_enable kauth) + $(use_enable modules kernel-module) + $(use_enable namei namei-fileserver) + $(use_enable ncurses gtx) + $(use_enable pthreaded-ubik) + $(use_enable supergroups) + $(use_enable ubik-read-while-write) + $(use_with apidoc dot) + $(use_with doc docbook-stylesheets /usr/share/sgml/docbook/xsl-stylesheets) + $(use_with kerberos krb5) + $(use_with perl swig) + ) + + # bug #861368 + filter-lto + + if use debug; then + use kauth && myconf+=( --enable-debug-pam ) + use modules && myconf+=( --enable-debug-kernel ) + fi + + if use modules; then + if use kernel_linux; then + if kernel_is -ge 3 17 && kernel_is -le 3 17 2; then + myconf+=( --enable-linux-d_splice_alias-extra-iput ) + fi + myconf+=( --with-linux-kernel-headers="${KV_DIR}" \ + --with-linux-kernel-build="${KV_OUT_DIR}" ) + fi + fi + + use amd64 && use tsm && myconf+=( --enable-tivoli-tsm ) + + local ARCH="$(tc-arch-kernel)" + local MY_ARCH="$(tc-arch)" + local BSD_BUILD_DIR="/usr/src/sys/${MY_ARCH}/compile/GENERIC" + + AFS_SYSKVERS=26 \ + econf "${myconf[@]}" + +} + +src_compile() { + ARCH="$(tc-arch-kernel)" AR="$(tc-getAR)" emake V=1 + local d + if use doc; then + emake -C doc/xml/AdminGuide auagd000.pdf + emake -C doc/xml/AdminRef auarf000.pdf + emake -C doc/xml/QuickStartUnix auqbg000.pdf + emake -C doc/xml/UserGuide auusg000.pdf + fi + if use apidoc; then + doxygen doc/doxygen/Doxyfile || die "Failed to build doxygen files" + fi +} + +src_install() { + local OPENRCDIR="${FILESDIR}/openrc" + local SYSTEMDDIR="${FILESDIR}/systemd" + + emake DESTDIR="${ED}" install_nolibafs + + if use modules; then + if use kernel_linux; then + local srcdir=$(expr "${S}"/src/libafs/MODLOAD-*) + [[ -f ${srcdir}/libafs.ko ]] || die "Couldn't find compiled kernel module" + linux_domodule ${srcdir}/libafs.ko + modules_post_process + fi + fi + + insinto /etc/openafs + doins src/afsd/CellServDB + newins "${FILESDIR}/ThisCell.default" ThisCell + newins "${FILESDIR}/cacheinfo.default" cacheinfo + + # pam_afs and pam_afs.krb have been installed in irregular locations, fix + if use kauth; then + dopammod "${ED}"/usr/$(get_libdir)/pam_afs* + fi + rm -f "${ED}"/usr/$(get_libdir)/pam_afs* || die + + # remove kdump stuff provided by kexec-tools #222455 + rm -rf "${ED}"/usr/sbin/kdump* || die + + # avoid collision with mit_krb5's version of kpasswd + if use kauth; then + mv "${ED}"/usr/bin/kpasswd{,_afs} || die + mv "${ED}"/usr/share/man/man1/kpasswd{,_afs}.1 || die + fi + + # avoid collision with heimdal's pagsh + if has_version app-crypt/heimdal; then + mv "${ED}"/usr/bin/pagsh{,_afs} || die + mv "${ED}"/usr/share/man/man1/pagsh{,_afs}.1 || die + fi + + # move lwp stuff around #200674 #330061 + mv "${ED}"/usr/include/{lwp,lock,timer}.h "${ED}"/usr/include/afs/ || die + mv "${ED}"/usr/$(get_libdir)/liblwp* "${ED}"/usr/$(get_libdir)/afs/ || die + # update paths to the relocated lwp headers + sed -ri \ + -e '/^#include <(lwp|lock|timer).h>/s:<([^>]*)>:<afs/\1>:' \ + "${ED}"/usr/include/*.h \ + "${ED}"/usr/include/*/*.h \ + || die + + # minimal documentation + use kauth && doman src/pam/pam_afs.5 + DOCS=( "${FILESDIR}/README.Gentoo" src/afsd/CellServDB NEWS README ) + + # documentation package + rm -rf doc/txt/winnotes || die # unneeded docs + if use doc; then + DOCS+=( doc/{pdf,protocol,txt} CODING CONTRIBUTING ) + newdoc doc/xml/AdminGuide/auagd000.pdf AdminGuide.pdf + newdoc doc/xml/AdminRef/auarf000.pdf AdminRef.pdf + newdoc doc/xml/QuickStartUnix/auqbg000.pdf QuickStartUnix.pdf + newdoc doc/xml/UserGuide/auusg000.pdf UserGuide.pdf + fi + use apidoc && DOCS+=( doc/doxygen/output/html ) + einstalldocs + + # Gentoo related scripts + newinitd "${OPENRCDIR}"/openafs-client.initd openafs-client + newconfd "${OPENRCDIR}"/openafs-client.confd openafs-client + newinitd "${OPENRCDIR}"/openafs-server.initd openafs-server + newconfd "${OPENRCDIR}"/openafs-server.confd openafs-server + dotmpfiles "${SYSTEMDDIR}"/tmpfiles.d/openafs-client.conf + systemd_dounit "${SYSTEMDDIR}"/openafs-client.service + systemd_dounit "${SYSTEMDDIR}"/openafs-server.service + systemd_install_serviced "${SYSTEMDDIR}"/openafs-client.service.conf + systemd_install_serviced "${SYSTEMDDIR}"/openafs-server.service.conf + + # used directories: client + keepdir /etc/openafs + + # used directories: server + keepdir /etc/openafs/server + diropts -m0700 + keepdir /var/lib/openafs + keepdir /var/lib/openafs/db + diropts -m0755 + keepdir /var/lib/openafs/logs + + # link logfiles to /var/log + dosym ../lib/openafs/logs /var/log/openafs +} + +pkg_preinst() { + ## Somewhat intelligently install default configuration files + ## (when they are not present) + local x + for x in cacheinfo CellServDB ThisCell ; do + if [[ -e "${EROOT}"/etc/openafs/${x} ]] ; then + cp "${EROOT}"/etc/openafs/${x} "${ED}"/etc/openafs/ + fi + done +} + +pkg_postinst() { + use kernel_linux && linux-mod-r1_pkg_postinst + + tmpfiles_process openafs-client.conf + + elog "This installation should work out of the box (at least the" + elog "client part doing global afs-cell browsing, unless you had" + elog "a previous and different configuration). If you want to" + elog "set up your own cell or modify the standard config," + elog "please have a look at the Gentoo OpenAFS documentation" + elog "(warning: it is not yet up to date wrt the new file locations)" + elog + elog "The documentation can be found at:" + elog " https://wiki.gentoo.org/wiki/OpenAFS" + elog + elog "Systemd users should run emerge --config ${CATEGORY}/${PN} before" + elog "first use and whenever ${EROOT}/etc/openafs/cacheinfo is edited." +} + +pkg_config() { + elog "Setting cache options for systemd." + + SERVICED_FILE="${EROOT}"/etc/systemd/system/openafs-client.service.d/00gentoo.conf + [[ ! -e "${SERVICED_FILE}" ]] && die "Systemd service.d file ${SERVICED_FILE} not found." + + CACHESIZE=$(cut -d ':' -f 3 "${EROOT}"/etc/openafs/cacheinfo) + [[ -z ${CACHESIZE} ]] && die "Failed to parse ${EROOT}/etc/openafs/cacheinfo." + + if [[ ${CACHESIZE} -lt 131070 ]]; then + AFSD_CACHE_ARGS="-stat 300 -dcache 100 -daemons 2 -volumes 50" + elif [[ ${CACHESIZE} -lt 524288 ]]; then + AFSD_CACHE_ARGS="-stat 2000 -dcache 800 -daemons 3 -volumes 70" + elif [[ ${CACHESIZE} -lt 1048576 ]]; then + AFSD_CACHE_ARGS="-stat 2800 -dcache 2400 -daemons 5 -volumes 128" + elif [[ ${CACHESIZE} -lt 2209715 ]]; then + AFSD_CACHE_ARGS="-stat 3600 -dcache 3600 -daemons 5 -volumes 196 -files 50000" + else + AFSD_CACHE_ARGS="-stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000" + fi + + # Replace existing env var if exists, else append line + grep -q "^Environment=\"AFSD_CACHE_ARGS=" "${SERVICED_FILE}" && \ + sed -i "s/^Environment=\"AFSD_CACHE_ARGS=.*/Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"/" "${SERVICED_FILE}" || \ + sed -i "$ a\Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"" "${SERVICED_FILE}" || \ + die "Updating ${SERVICED_FILE} failed." +} diff --git a/net-fs/openafs/openafs-1.8.14.ebuild b/net-fs/openafs/openafs-1.8.14.ebuild new file mode 100644 index 000000000000..ff9ab7a55863 --- /dev/null +++ b/net-fs/openafs/openafs-1.8.14.ebuild @@ -0,0 +1,345 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MODULES_OPTIONAL_IUSE="modules" +inherit autotools linux-mod-r1 flag-o-matic pam systemd tmpfiles toolchain-funcs + +MY_PV=${PV/_/} +MY_P="${PN}-${MY_PV}" +KERNEL_LIMIT=6.16 + +DESCRIPTION="The OpenAFS distributed file system" +HOMEPAGE="https://www.openafs.org/" +# We always d/l the doc tarball as man pages are not USE=doc material +[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE="" +SRC_URI=" + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2 + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-doc.tar.bz2 +" + +S="${WORKDIR}/${MY_P}" + +LICENSE="IBM BSD openafs-krb5-a APSL-2" +SLOT="0" +KEYWORDS="~amd64 -riscv ~sparc ~x86" + +IUSE="apidoc bitmap-later debug doc fuse kauth kerberos +modules +namei +ncurses perl +pthreaded-ubik selinux +supergroups tsm ubik-read-while-write" + +BDEPEND=" + dev-lang/perl + app-alternatives/lex + app-alternatives/yacc + apidoc? ( + app-text/doxygen[dot] + media-gfx/graphviz + ) + doc? ( + dev-libs/libxslt + || ( + >=dev-java/fop-2.10-r1:0 + app-text/dblatex + app-text/docbook-sgml-utils[jadetex] + ) + ) + perl? ( dev-lang/swig )" +DEPEND=" + virtual/libcrypt:= + virtual/libintl + amd64? ( tsm? ( app-backup/tsm ) ) + doc? ( + app-text/docbook-xsl-stylesheets + app-text/docbook-xml-dtd:4.3 + ) + fuse? ( sys-fs/fuse:0= ) + kauth? ( sys-libs/pam ) + kerberos? ( virtual/krb5 ) + ncurses? ( sys-libs/ncurses:0= )" +RDEPEND=" + ${DEPEND} + selinux? ( sec-policy/selinux-afs )" + +PATCHES=( + "${FILESDIR}"/0002-pam-paths.patch + "${FILESDIR}"/0003-fbsd.patch + "${FILESDIR}"/0004-sparc.patch + "${FILESDIR}"/0005-uname.patch + "${FILESDIR}"/0006-resolv.patch + "${FILESDIR}"/0007-afsauthent-symbols.patch + "${FILESDIR}"/0008-flags.patch + "${FILESDIR}"/0009-${P}-docbook2pdf.patch + "${FILESDIR}"/0010-libperl.patch + "${FILESDIR}"/0011-xbsa.patch + "${FILESDIR}"/0012-xml-dtd.patch + "${FILESDIR}"/0013-kernel-cc-ld.patch +) +# see https://bugs.gentoo.org/943641 +# Upstream performs uses customized autoconf routines to check for +# the availability of various functions and the warnings/errors in +# the config log for implicit function declarations are expected +# and therefore are false positives. +QA_CONFIG_IMPL_DECL_SKIP=("*") + +CONFIG_CHECK="~!AFS_FS KEYS" +ERROR_AFS_FS="OpenAFS conflicts with the in-kernel AFS-support. Make sure not to load both at the same time!" +ERROR_KEYS="OpenAFS needs CONFIG_KEYS option enabled" + +pkg_pretend() { + if use modules && use kernel_linux && kernel_is -ge ${KERNEL_LIMIT/\./ } ; then + ewarn "Gentoo supports kernels which are supported by OpenAFS" + ewarn "which are limited to the kernel versions: < ${KERNEL_LIMIT}" + ewarn "" + ewarn "You are free to utilize eapply_user to provide whatever" + ewarn "support you feel is appropriate, but will not receive" + ewarn "support as a result of those changes." + ewarn "" + ewarn "Please do not file a bug report about this." + ewarn "" + ewarn "Alternatively, you may:" + ewarn "1. Use OpenAFS FUSE client, build OpenAFS with USE=fuse to enable it." + ewarn "2. Use native kernel AFS client: configure your kernel with CONFIG_AFS_FS." + ewarn "net-fs/openafs is not required in this case, but client's functionality will be limited." + fi +} + +pkg_setup() { + use kernel_linux && linux-mod-r1_pkg_setup +} + +src_prepare() { + default + + # fixing 2-nd level makefiles to honor flags + sed -i -r 's/\<CFLAGS[[:space:]]*=/CFLAGS+=/; s/\<LDFLAGS[[:space:]]*=/LDFLAGS+=/' \ + src/*/Makefile.in || die '*/Makefile.in sed failed' + + # build system is very delicate, so we can't run eautoreconf + # run autotools commands based on what is listed in regen.sh + _elibtoolize -c -f -i + eaclocal -I src/cf -I src/external/rra-c-util/m4 -I src/external/autoconf-archive/m4 + eautoconf + eautoconf -o configure-libafs configure-libafs.ac + eautoheader + einfo "Deleting autom4te.cache directory" + rm -rf autom4te.cache || die +} + +src_configure() { + # requires the --enable-static to avoid build errors. This is + # currently an upstream limitation. + local myconf=( + --enable-static + --disable-strip-binaries + $(use_enable bitmap-later) + $(use_enable debug) + $(use_enable debug debug-locks) + $(use_enable debug debug-lwp) + $(use_enable fuse fuse-client) + $(use_enable kauth) + $(use_enable modules kernel-module) + $(use_enable namei namei-fileserver) + $(use_enable ncurses gtx) + $(use_enable pthreaded-ubik) + $(use_enable supergroups) + $(use_enable ubik-read-while-write) + $(use_with apidoc dot) + $(use_with doc docbook-stylesheets /usr/share/sgml/docbook/xsl-stylesheets) + $(use_with kerberos krb5) + $(use_with perl swig) + ) + + # bug #861368 + filter-lto + + if use debug; then + use kauth && myconf+=( --enable-debug-pam ) + use modules && myconf+=( --enable-debug-kernel ) + fi + + if use modules; then + if use kernel_linux; then + if kernel_is -ge 3 17 && kernel_is -le 3 17 2; then + myconf+=( --enable-linux-d_splice_alias-extra-iput ) + fi + myconf+=( --with-linux-kernel-headers="${KV_DIR}" \ + --with-linux-kernel-build="${KV_OUT_DIR}" ) + fi + fi + + use amd64 && use tsm && myconf+=( --enable-tivoli-tsm ) + + local ARCH="$(tc-arch-kernel)" + local MY_ARCH="$(tc-arch)" + local BSD_BUILD_DIR="/usr/src/sys/${MY_ARCH}/compile/GENERIC" + + AFS_SYSKVERS=26 \ + econf "${myconf[@]}" + +} + +src_compile() { + ARCH="$(tc-arch-kernel)" AR="$(tc-getAR)" emake V=1 + local d + if use doc; then + emake -C doc/xml/AdminGuide auagd000.pdf + emake -C doc/xml/AdminRef auarf000.pdf + emake -C doc/xml/QuickStartUnix auqbg000.pdf + emake -C doc/xml/UserGuide auusg000.pdf + fi + if use apidoc; then + doxygen doc/doxygen/Doxyfile || die "Failed to build doxygen files" + fi +} + +src_install() { + local OPENRCDIR="${FILESDIR}/openrc" + local SYSTEMDDIR="${FILESDIR}/systemd" + + emake DESTDIR="${ED}" install_nolibafs + + if use modules; then + if use kernel_linux; then + local srcdir=$(expr "${S}"/src/libafs/MODLOAD-*) + [[ -f ${srcdir}/libafs.ko ]] || die "Couldn't find compiled kernel module" + linux_domodule ${srcdir}/libafs.ko + modules_post_process + fi + fi + + insinto /etc/openafs + doins src/afsd/CellServDB + newins "${FILESDIR}/ThisCell.default" ThisCell + newins "${FILESDIR}/cacheinfo.default" cacheinfo + + # pam_afs and pam_afs.krb have been installed in irregular locations, fix + if use kauth; then + dopammod "${ED}"/usr/$(get_libdir)/pam_afs* + fi + rm -f "${ED}"/usr/$(get_libdir)/pam_afs* || die + + # remove kdump stuff provided by kexec-tools #222455 + rm -rf "${ED}"/usr/sbin/kdump* || die + + # avoid collision with mit_krb5's version of kpasswd + if use kauth; then + mv "${ED}"/usr/bin/kpasswd{,_afs} || die + mv "${ED}"/usr/share/man/man1/kpasswd{,_afs}.1 || die + fi + + # avoid collision with heimdal's pagsh + if has_version app-crypt/heimdal; then + mv "${ED}"/usr/bin/pagsh{,_afs} || die + mv "${ED}"/usr/share/man/man1/pagsh{,_afs}.1 || die + fi + + # move lwp stuff around #200674 #330061 + mv "${ED}"/usr/include/{lwp,lock,timer}.h "${ED}"/usr/include/afs/ || die + mv "${ED}"/usr/$(get_libdir)/liblwp* "${ED}"/usr/$(get_libdir)/afs/ || die + # update paths to the relocated lwp headers + sed -ri \ + -e '/^#include <(lwp|lock|timer).h>/s:<([^>]*)>:<afs/\1>:' \ + "${ED}"/usr/include/*.h \ + "${ED}"/usr/include/*/*.h \ + || die + + # minimal documentation + use kauth && doman src/pam/pam_afs.5 + DOCS=( "${FILESDIR}/README.Gentoo" src/afsd/CellServDB NEWS README ) + + # documentation package + rm -rf doc/txt/winnotes || die # unneeded docs + if use doc; then + DOCS+=( doc/{pdf,protocol,txt} CODING CONTRIBUTING ) + newdoc doc/xml/AdminGuide/auagd000.pdf AdminGuide.pdf + newdoc doc/xml/AdminRef/auarf000.pdf AdminRef.pdf + newdoc doc/xml/QuickStartUnix/auqbg000.pdf QuickStartUnix.pdf + newdoc doc/xml/UserGuide/auusg000.pdf UserGuide.pdf + fi + use apidoc && DOCS+=( doc/doxygen/output/html ) + einstalldocs + + # Gentoo related scripts + newinitd "${OPENRCDIR}"/openafs-client.initd openafs-client + newconfd "${OPENRCDIR}"/openafs-client.confd openafs-client + newinitd "${OPENRCDIR}"/openafs-server.initd openafs-server + newconfd "${OPENRCDIR}"/openafs-server.confd openafs-server + dotmpfiles "${SYSTEMDDIR}"/tmpfiles.d/openafs-client.conf + systemd_dounit "${SYSTEMDDIR}"/openafs-client.service + systemd_dounit "${SYSTEMDDIR}"/openafs-server.service + systemd_install_serviced "${SYSTEMDDIR}"/openafs-client.service.conf + systemd_install_serviced "${SYSTEMDDIR}"/openafs-server.service.conf + + # used directories: client + keepdir /etc/openafs + + # used directories: server + keepdir /etc/openafs/server + diropts -m0700 + keepdir /var/lib/openafs + keepdir /var/lib/openafs/db + diropts -m0755 + keepdir /var/lib/openafs/logs + + # link logfiles to /var/log + dosym ../lib/openafs/logs /var/log/openafs +} + +pkg_preinst() { + ## Somewhat intelligently install default configuration files + ## (when they are not present) + local x + for x in cacheinfo CellServDB ThisCell ; do + if [[ -e "${EROOT}"/etc/openafs/${x} ]] ; then + cp "${EROOT}"/etc/openafs/${x} "${ED}"/etc/openafs/ + fi + done +} + +pkg_postinst() { + use kernel_linux && linux-mod-r1_pkg_postinst + + tmpfiles_process openafs-client.conf + + elog "This installation should work out of the box (at least the" + elog "client part doing global afs-cell browsing, unless you had" + elog "a previous and different configuration). If you want to" + elog "set up your own cell or modify the standard config," + elog "please have a look at the Gentoo OpenAFS documentation" + elog "(warning: it is not yet up to date wrt the new file locations)" + elog + elog "The documentation can be found at:" + elog " https://wiki.gentoo.org/wiki/OpenAFS" + elog + elog "Systemd users should run emerge --config ${CATEGORY}/${PN} before" + elog "first use and whenever ${EROOT}/etc/openafs/cacheinfo is edited." +} + +pkg_config() { + elog "Setting cache options for systemd." + + SERVICED_FILE="${EROOT}"/etc/systemd/system/openafs-client.service.d/00gentoo.conf + [[ ! -e "${SERVICED_FILE}" ]] && die "Systemd service.d file ${SERVICED_FILE} not found." + + CACHESIZE=$(cut -d ':' -f 3 "${EROOT}"/etc/openafs/cacheinfo) + [[ -z ${CACHESIZE} ]] && die "Failed to parse ${EROOT}/etc/openafs/cacheinfo." + + if [[ ${CACHESIZE} -lt 131070 ]]; then + AFSD_CACHE_ARGS="-stat 300 -dcache 100 -daemons 2 -volumes 50" + elif [[ ${CACHESIZE} -lt 524288 ]]; then + AFSD_CACHE_ARGS="-stat 2000 -dcache 800 -daemons 3 -volumes 70" + elif [[ ${CACHESIZE} -lt 1048576 ]]; then + AFSD_CACHE_ARGS="-stat 2800 -dcache 2400 -daemons 5 -volumes 128" + elif [[ ${CACHESIZE} -lt 2209715 ]]; then + AFSD_CACHE_ARGS="-stat 3600 -dcache 3600 -daemons 5 -volumes 196 -files 50000" + else + AFSD_CACHE_ARGS="-stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000" + fi + + # Replace existing env var if exists, else append line + grep -q "^Environment=\"AFSD_CACHE_ARGS=" "${SERVICED_FILE}" && \ + sed -i "s/^Environment=\"AFSD_CACHE_ARGS=.*/Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"/" "${SERVICED_FILE}" || \ + sed -i "$ a\Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"" "${SERVICED_FILE}" || \ + die "Updating ${SERVICED_FILE} failed." +} diff --git a/net-fs/openafs/openafs-1.8.15.ebuild b/net-fs/openafs/openafs-1.8.15.ebuild new file mode 100644 index 000000000000..88887da63c97 --- /dev/null +++ b/net-fs/openafs/openafs-1.8.15.ebuild @@ -0,0 +1,354 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MODULES_OPTIONAL_IUSE="modules" +inherit autotools linux-mod-r1 flag-o-matic pam systemd tmpfiles toolchain-funcs + +MY_PV=${PV/_/} +MY_P="${PN}-${MY_PV}" +KERNEL_LIMIT=6.17 + +DESCRIPTION="The OpenAFS distributed file system" +HOMEPAGE="https://www.openafs.org/" +# We always d/l the doc tarball as man pages are not USE=doc material +[[ ${PV} == *_pre* ]] && MY_PRE="candidate/" || MY_PRE="" +SRC_URI=" + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-src.tar.bz2 + https://openafs.org/dl/openafs/${MY_PRE}${MY_PV}/${MY_P}-doc.tar.bz2 +" + +S="${WORKDIR}/${MY_P}" + +LICENSE="IBM BSD openafs-krb5-a APSL-2" +SLOT="0" +KEYWORDS="~amd64 -riscv ~sparc ~x86" + +IUSE="apidoc bitmap-later debug doc fuse kauth kerberos +modules +namei +ncurses perl +pthreaded-ubik selinux +supergroups tsm ubik-read-while-write" + +BDEPEND=" + dev-lang/perl + app-alternatives/lex + app-alternatives/yacc + apidoc? ( + app-text/doxygen[dot] + media-gfx/graphviz + ) + doc? ( + dev-libs/libxslt + || ( + >=dev-java/fop-2.10-r1:0 + app-text/dblatex + app-text/docbook-sgml-utils[jadetex] + ) + ) + perl? ( dev-lang/swig )" +DEPEND=" + virtual/libcrypt:= + virtual/libintl + amd64? ( tsm? ( app-backup/tsm ) ) + doc? ( + app-text/docbook-xsl-stylesheets + app-text/docbook-xml-dtd:4.3 + ) + fuse? ( sys-fs/fuse:0= ) + kauth? ( sys-libs/pam ) + kerberos? ( virtual/krb5 ) + ncurses? ( sys-libs/ncurses:0= )" +RDEPEND=" + ${DEPEND} + selinux? ( sec-policy/selinux-afs )" + +PATCHES=( + "${FILESDIR}"/0002-pam-paths.patch + "${FILESDIR}"/0003-fbsd.patch + "${FILESDIR}"/0004-sparc.patch + "${FILESDIR}"/0005-uname.patch + "${FILESDIR}"/0006-resolv.patch + "${FILESDIR}"/0007-afsauthent-symbols.patch + "${FILESDIR}"/0008-flags.patch + "${FILESDIR}"/0017-docbook2pdf.patch + "${FILESDIR}"/0010-libperl.patch + "${FILESDIR}"/0011-xbsa.patch + "${FILESDIR}"/0012-xml-dtd.patch + "${FILESDIR}"/0016-kernel-cc-ld.patch + "${FILESDIR}"/0018-openafs-1.8.15-linux-6.17.patch +) +# see https://bugs.gentoo.org/943641 +# Upstream performs uses customized autoconf routines to check for +# the availability of various functions and the warnings/errors in +# the config log for implicit function declarations are expected +# and therefore are false positives. +QA_CONFIG_IMPL_DECL_SKIP=("*") + +CONFIG_CHECK="~!AFS_FS KEYS" +ERROR_AFS_FS="OpenAFS conflicts with the in-kernel AFS-support. Make sure not to load both at the same time!" +ERROR_KEYS="OpenAFS needs CONFIG_KEYS option enabled" + +pkg_pretend() { + if use modules && use kernel_linux && kernel_is -ge ${KERNEL_LIMIT/\./ } ; then + ewarn "Gentoo supports kernels which are supported by OpenAFS" + ewarn "which are limited to the kernel versions: < ${KERNEL_LIMIT}" + ewarn "" + ewarn "You are free to utilize eapply_user to provide whatever" + ewarn "support you feel is appropriate, but will not receive" + ewarn "support as a result of those changes." + ewarn "" + ewarn "Please do not file a bug report about this." + ewarn "" + ewarn "Alternatively, you may:" + ewarn "1. Use OpenAFS FUSE client, build OpenAFS with USE=fuse to enable it." + ewarn "2. Use native kernel AFS client: configure your kernel with CONFIG_AFS_FS." + ewarn "net-fs/openafs is not required in this case, but client's functionality will be limited." + fi +} + +pkg_setup() { + use kernel_linux && linux-mod-r1_pkg_setup +} + +src_prepare() { + default + + # fixing 2-nd level makefiles to honor flags + sed -i -r 's/\<CFLAGS[[:space:]]*=/CFLAGS+=/; s/\<LDFLAGS[[:space:]]*=/LDFLAGS+=/' \ + src/*/Makefile.in || die '*/Makefile.in sed failed' + + # build system is very delicate, so we can't run eautoreconf + # run autotools commands based on what is listed in regen.sh + _elibtoolize -c -f -i + eaclocal -I src/cf -I src/external/rra-c-util/m4 -I src/external/autoconf-archive/m4 + eautoconf + eautoconf -o configure-libafs configure-libafs.ac + eautoheader + einfo "Deleting autom4te.cache directory" + rm -rf autom4te.cache || die +} + +src_configure() { + # requires the --enable-static to avoid build errors. This is + # currently an upstream limitation. + local myconf=( + --enable-static + --disable-strip-binaries + $(use_enable bitmap-later) + $(use_enable debug) + $(use_enable debug debug-locks) + $(use_enable debug debug-lwp) + $(use_enable fuse fuse-client) + $(use_enable kauth) + $(use_enable modules kernel-module) + $(use_enable namei namei-fileserver) + $(use_enable ncurses gtx) + $(use_enable pthreaded-ubik) + $(use_enable supergroups) + $(use_enable ubik-read-while-write) + $(use_with apidoc dot) + $(use_with doc docbook-stylesheets /usr/share/sgml/docbook/xsl-stylesheets) + $(use_with kerberos krb5) + $(use_with perl swig) + ) + + # bug #861368 + filter-lto + + if use debug; then + use kauth && myconf+=( --enable-debug-pam ) + use modules && myconf+=( --enable-debug-kernel ) + fi + + if use modules; then + if use kernel_linux; then + if kernel_is -ge 3 17 && kernel_is -le 3 17 2; then + myconf+=( --enable-linux-d_splice_alias-extra-iput ) + fi + myconf+=( --with-linux-kernel-headers="${KV_DIR}" \ + --with-linux-kernel-build="${KV_OUT_DIR}" ) + fi + fi + + use amd64 && use tsm && myconf+=( --enable-tivoli-tsm ) + + local ARCH="$(tc-arch-kernel)" + local MY_ARCH="$(tc-arch)" + local BSD_BUILD_DIR="/usr/src/sys/${MY_ARCH}/compile/GENERIC" + + AFS_SYSKVERS=26 \ + econf "${myconf[@]}" + +} + +src_compile() { + ARCH="$(tc-arch-kernel)" AR="$(tc-getAR)" emake V=1 + local d + if use doc; then + emake -C doc/xml/AdminGuide auagd000.pdf + emake -C doc/xml/AdminRef auarf000.pdf + emake -C doc/xml/QuickStartUnix auqbg000.pdf + emake -C doc/xml/UserGuide auusg000.pdf + fi + if use apidoc; then + doxygen doc/doxygen/Doxyfile || die "Failed to build doxygen files" + fi +} + +src_install() { + local OPENRCDIR="${FILESDIR}/openrc" + local SYSTEMDDIR="${FILESDIR}/systemd" + + emake DESTDIR="${ED}" install_nolibafs + + if use modules; then + if use kernel_linux; then + local srcdir=$(expr "${S}"/src/libafs/MODLOAD-*) + [[ -f ${srcdir}/libafs.ko ]] || die "Couldn't find compiled kernel module" + linux_domodule ${srcdir}/libafs.ko + modules_post_process + fi + fi + + insinto /etc/openafs + doins src/afsd/CellServDB + newins "${FILESDIR}/ThisCell.default" ThisCell + newins "${FILESDIR}/cacheinfo.default" cacheinfo + + # pam_afs and pam_afs.krb have been installed in irregular locations, fix + if use kauth; then + dopammod "${ED}"/usr/$(get_libdir)/pam_afs* + fi + rm -f "${ED}"/usr/$(get_libdir)/pam_afs* || die + + # remove kdump stuff provided by kexec-tools #222455 + rm -rf "${ED}"/usr/sbin/kdump* || die + + # avoid collision with mit_krb5's version of kpasswd + if use kauth; then + mv "${ED}"/usr/bin/kpasswd{,_afs} || die + mv "${ED}"/usr/share/man/man1/kpasswd{,_afs}.1 || die + fi + + # avoid collision with heimdal's pagsh + if has_version app-crypt/heimdal; then + mv "${ED}"/usr/bin/pagsh{,_afs} || die + mv "${ED}"/usr/share/man/man1/pagsh{,_afs}.1 || die + fi + + # move lwp stuff around #200674 #330061 + mv "${ED}"/usr/include/{lock,lwp,timer}.h "${ED}"/usr/include/afs/ || die + mv "${ED}"/usr/$(get_libdir)/liblwp* "${ED}"/usr/$(get_libdir)/afs/ || die + # update paths to the relocated lwp headers + sed -ri \ + -e '/^#include <(lock,lwp|timer).h>/s:<([^>]*)>:<afs/\1>:' \ + "${ED}"/usr/include/*.h \ + "${ED}"/usr/include/*/*.h \ + || die + + # minimal documentation + use kauth && doman src/pam/pam_afs.5 + DOCS=( "${FILESDIR}/README.Gentoo" src/afsd/CellServDB NEWS README ) + + # documentation package + rm -rf doc/txt/winnotes || die # unneeded docs + if use doc; then + DOCS+=( doc/{pdf,protocol,txt} CODING CONTRIBUTING ) + newdoc doc/xml/AdminGuide/auagd000.pdf AdminGuide.pdf + newdoc doc/xml/AdminRef/auarf000.pdf AdminRef.pdf + newdoc doc/xml/QuickStartUnix/auqbg000.pdf QuickStartUnix.pdf + newdoc doc/xml/UserGuide/auusg000.pdf UserGuide.pdf + fi + use apidoc && DOCS+=( doc/doxygen/output/html ) + einstalldocs + + # Gentoo related scripts + newinitd "${OPENRCDIR}"/openafs-client.initd openafs-client + newconfd "${OPENRCDIR}"/openafs-client.confd openafs-client + newinitd "${OPENRCDIR}"/openafs-server.initd openafs-server + newconfd "${OPENRCDIR}"/openafs-server.confd openafs-server + dotmpfiles "${SYSTEMDDIR}"/tmpfiles.d/openafs-client.conf + systemd_newunit "${SYSTEMDDIR}"/01-openafs-client.service openafs-client.service + systemd_dounit "${SYSTEMDDIR}"/openafs-server.service + + systemd_install_serviced "${SYSTEMDDIR}"/openafs-server.service.conf + + exeinto /usr/libexec/openafs + doexe "${SYSTEMDDIR}"/openafs-client-systemd-helper.sh + # used directories: client + keepdir /etc/openafs + + # used directories: server + keepdir /etc/openafs/server + diropts -m0700 + keepdir /var/lib/openafs + keepdir /var/lib/openafs/db + diropts -m0755 + keepdir /var/lib/openafs/logs + + # link logfiles to /var/log + dosym ../lib/openafs/logs /var/log/openafs +} + +pkg_preinst() { + ## Somewhat intelligently install default configuration files + ## (when they are not present) + local x + for x in cacheinfo CellServDB ThisCell ; do + if [[ -e "${EROOT}"/etc/openafs/${x} ]] ; then + cp "${EROOT}"/etc/openafs/${x} "${ED}"/etc/openafs/ + fi + done +} + +pkg_postinst() { + use kernel_linux && linux-mod-r1_pkg_postinst + + tmpfiles_process openafs-client.conf + + elog "This installation should work out of the box (at least the" + elog "client part doing global afs-cell browsing, unless you had" + elog "a previous and different configuration). If you want to" + elog "set up your own cell or modify the standard config," + elog "please have a look at the Gentoo OpenAFS documentation" + elog "(warning: it is not yet up to date wrt the new file locations)" + elog + elog "The documentation can be found at:" + elog " https://wiki.gentoo.org/wiki/OpenAFS" + elog + elog "openafs-1.8.15 introduced a helper script for the systemd" + elog "openafs-client service." + elog + elog "Systemd users should run emerge --config ${CATEGORY}/${PN} before" + elog "first use and whenever ${EROOT}/etc/openafs/cacheinfo is edited." + +} + +pkg_config() { + elog "Setting cache options for systemd." + + SERVICED_FILE="${EROOT}"/etc/systemd/system/openafs-client.service.d/00gentoo.conf + [[ ! -e "${SERVICED_FILE}" ]] && die "Systemd service.d file ${SERVICED_FILE} not found." + + CACHESIZE=$(cut -d ':' -f 3 "${EROOT}"/etc/openafs/cacheinfo) + [[ -z ${CACHESIZE} ]] && die "Failed to parse ${EROOT}/etc/openafs/cacheinfo." + + if [[ ${CACHESIZE} -lt 131070 ]]; then + AFSD_CACHE_ARGS="-stat 300 -dcache 100 -daemons 2 -volumes 50" + elif [[ ${CACHESIZE} -lt 524288 ]]; then + AFSD_CACHE_ARGS="-stat 2000 -dcache 800 -daemons 3 -volumes 70" + elif [[ ${CACHESIZE} -lt 1048576 ]]; then + AFSD_CACHE_ARGS="-stat 2800 -dcache 2400 -daemons 5 -volumes 128" + elif [[ ${CACHESIZE} -lt 2209715 ]]; then + AFSD_CACHE_ARGS="-stat 3600 -dcache 3600 -daemons 5 -volumes 196 -files 50000" + else + AFSD_CACHE_ARGS="-stat 4000 -dcache 4000 -daemons 6 -volumes 256 -files 50000" + fi + + # Replace existing env var if exists, else append line + grep -q "^Environment=\"AFSD_CACHE_ARGS=" "${SERVICED_FILE}" && \ + sed -i "s/^Environment=\"AFSD_CACHE_ARGS=.*/Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"/" \ + "${SERVICED_FILE}" || \ + sed -i "$ a\Environment=\"AFSD_CACHE_ARGS=${AFSD_CACHE_ARGS}\"" \ + "${SERVICED_FILE}" || \ + die "Updating ${SERVICED_FILE} failed." +} diff --git a/net-fs/s3backer/Manifest b/net-fs/s3backer/Manifest new file mode 100644 index 000000000000..89a38f57b426 --- /dev/null +++ b/net-fs/s3backer/Manifest @@ -0,0 +1,2 @@ +DIST s3backer-2.1.3.tar.gz 156859 BLAKE2B 0a28f739f29e2d63a6626247a16d437696a0b3ce2a2b83ae5875f40005ca7f61a3117cf4ecd4646006372cf3eb0afd7a423dca8dfe3db7041c53fc9fffce6b2b SHA512 14e892e3b327ba1c1c164aec30689c0a63e9ede162d4e4a99f9b4fcc0a4a3ef9c81fbacf775cb78f3830ab504e1759bc162af30d1b09a761e97de7191c3e60c8 +DIST s3backer-2.1.6.tar.gz 160282 BLAKE2B aabf38d482eb15e7c97ffcae49be938b5777cdf2bb165cef962212fdd981249d4c030c13995702edd88d1bde80527922cfc1e461f766f2ebc351c594066198a6 SHA512 7d8ac90ae4b22eccf3fd838f0abc196cdc9b59283e068f1d4755d9a00ff70ff6cfab841d7169dd35256773ebd269bd46c34139d327645632cb014d109d1c54c4 diff --git a/net-fs/s3backer/metadata.xml b/net-fs/s3backer/metadata.xml new file mode 100644 index 000000000000..af27462af85c --- /dev/null +++ b/net-fs/s3backer/metadata.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person" proxied="yes"> + <email>kaikaikai@yandex.ru</email> + <name>Alexey Korepanov</name> + </maintainer> + <maintainer type="project" proxied="proxy"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <use> + <flag name="nbd"> + Support export as an nbd device + </flag> + </use> + <upstream> + <remote-id type="google-code">s3backer</remote-id> + <remote-id type="github">archiecobbs/s3backer</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-fs/s3backer/s3backer-2.1.3.ebuild b/net-fs/s3backer/s3backer-2.1.3.ebuild new file mode 100644 index 000000000000..f723557fcb33 --- /dev/null +++ b/net-fs/s3backer/s3backer-2.1.3.ebuild @@ -0,0 +1,53 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools + +DESCRIPTION="A filesystem that contains a single file backed by Amazon S3" +HOMEPAGE="https://github.com/archiecobbs/s3backer" +SRC_URI="https://github.com/archiecobbs/s3backer/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="nbd" + +RDEPEND=" + app-arch/zstd:= + dev-libs/expat + dev-libs/openssl:0= + net-misc/curl + sys-fs/fuse:0 + virtual/zlib:= + nbd? ( sys-block/nbd sys-block/nbdkit ) +" +DEPEND="${RDEPEND} + elibc_musl? ( sys-libs/queue-standalone ) +" +BDEPEND=" + virtual/pkgconfig +" + +src_prepare() { + default + + sed -e "/docdir=/s:packages/\$(PACKAGE):${PF}:" \ + -e "/doc_DATA=/d" \ + -i Makefile.am || die + + eautoreconf +} + +src_configure() { + econf $(use_enable nbd) +} + +src_install() { + default + + if use nbd ; then + rm "${ED}/usr/$(get_libdir)/nbdkit/plugins/nbdkit-s3backer-plugin.la" || die + fi +} diff --git a/net-fs/s3backer/s3backer-2.1.6.ebuild b/net-fs/s3backer/s3backer-2.1.6.ebuild new file mode 100644 index 000000000000..1592079e36e4 --- /dev/null +++ b/net-fs/s3backer/s3backer-2.1.6.ebuild @@ -0,0 +1,53 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools + +DESCRIPTION="A filesystem that contains a single file backed by Amazon S3" +HOMEPAGE="https://github.com/archiecobbs/s3backer" +SRC_URI="https://github.com/archiecobbs/s3backer/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="nbd" + +RDEPEND=" + app-arch/zstd:= + dev-libs/expat + dev-libs/openssl:0= + net-misc/curl + sys-fs/fuse:3 + virtual/zlib:= + nbd? ( sys-block/nbd sys-block/nbdkit ) +" +DEPEND="${RDEPEND} + elibc_musl? ( sys-libs/queue-standalone ) +" +BDEPEND=" + virtual/pkgconfig +" + +src_prepare() { + default + + sed -e "/docdir=/s:packages/\$(PACKAGE):${PF}:" \ + -e "/doc_DATA=/d" \ + -i Makefile.am || die + + eautoreconf +} + +src_configure() { + econf $(use_enable nbd) +} + +src_install() { + default + + if use nbd ; then + rm "${ED}/usr/$(get_libdir)/nbdkit/plugins/nbdkit-s3backer-plugin.la" || die + fi +} diff --git a/net-fs/s3fs/Manifest b/net-fs/s3fs/Manifest new file mode 100644 index 000000000000..5df49b76bc67 --- /dev/null +++ b/net-fs/s3fs/Manifest @@ -0,0 +1,2 @@ +DIST s3fs-1.95.tar.gz 285599 BLAKE2B 4cb34f50d4efd0c1e0ef8196c3c9a53c380338317b736dbc229ef37ef22cec9dcf634a5b253bcdd23b25f16badffe39817c8c59530a49963cde17a2721a7b678 SHA512 73fd33895ace0e60fe8df392d474624f913a310c8df136bcc60b7d644ce7a92681ac7ced9bf9fcb9ef248f48b3bee3d4e871c172368c0b07626cb8f2ed3ba1b9 +DIST s3fs-1.96.tar.gz 307254 BLAKE2B 960be8000d531e4aeee2ba10d9f451d41f14a6e272cdf25361beeb27d85e9734e6fc41145067842f21f465fb7affb3bcc80ed89833cf518853457b80151ae2e3 SHA512 1ad5a99e6bb86e04e95d4de6a56d460766b6f8aaec22b1d06685eee4344decfd0b14ecf37bbc6e8511a1863a21586465401c72112eca2589a80c16c0f4bb0f1d diff --git a/net-fs/s3fs/metadata.xml b/net-fs/s3fs/metadata.xml new file mode 100644 index 000000000000..b9a262d42a8d --- /dev/null +++ b/net-fs/s3fs/metadata.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <!-- maintainer-needed --> + <use> + <flag name="nss">Enable <pkg>dev-libs/nss</pkg> crypto backend</flag> + <flag name="gnutls">Enable <pkg>net-libs/gnutls</pkg> crypto backend</flag> + <flag name="nettle">Use <pkg>dev-libs/nettle</pkg> network functions with GnuTLS.</flag> + </use> + <upstream> + <remote-id type="github">s3fs-fuse/s3fs-fuse</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-fs/s3fs/s3fs-1.95-r1.ebuild b/net-fs/s3fs/s3fs-1.95-r1.ebuild new file mode 100644 index 000000000000..36e6974f3b67 --- /dev/null +++ b/net-fs/s3fs/s3fs-1.95-r1.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools + +MY_PN=${PN}-fuse +MY_P=${MY_PN}-${PV} + +DESCRIPTION="Amazon S3 mounting via fuse" +HOMEPAGE="https://github.com/s3fs-fuse/s3fs-fuse/" +SRC_URI=" + https://github.com/${MY_PN}/${MY_PN}/archive/v${PV}.tar.gz + -> ${P}.tar.gz +" +S="${WORKDIR}/${MY_P}" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="amd64 ~riscv x86" +IUSE="gnutls nettle nss" +REQUIRED_USE="nettle? ( gnutls !nss )" + +# Requires active internet connection and it tries to download some binaries for later execution +RESTRICT="test" + +DEPEND=" + dev-libs/libxml2:2= + net-misc/curl + sys-fs/fuse:0 + nss? ( dev-libs/nss ) + !nss? ( + gnutls? ( + net-libs/gnutls:= + nettle? ( dev-libs/nettle:= ) + ) + !gnutls? ( dev-libs/openssl:0= ) + ) +" + +RDEPEND=" + ${DEPEND} + app-misc/mime-types +" + +BDEPEND="virtual/pkgconfig" + +src_prepare() { + default + + sed -i 's/ -D_FORTIFY_SOURCE=3//' configure.ac || die + + eautoreconf +} + +src_configure() { + local myeconfargs=( + $(use_with nettle) + ) + if use nss; then + myeconfargs+=( $(use_with nss) ) + elif use gnutls; then + myeconfargs+=( $(use_with gnutls) ) + else + myeconfargs+=( --with-openssl ) + fi + + econf "${myeconfargs[@]}" +} diff --git a/net-fs/s3fs/s3fs-1.96.ebuild b/net-fs/s3fs/s3fs-1.96.ebuild new file mode 100644 index 000000000000..9b92498fe3a1 --- /dev/null +++ b/net-fs/s3fs/s3fs-1.96.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools + +MY_PN=${PN}-fuse +MY_P=${MY_PN}-${PV} + +DESCRIPTION="Amazon S3 mounting via fuse" +HOMEPAGE="https://github.com/s3fs-fuse/s3fs-fuse/" +SRC_URI=" + https://github.com/${MY_PN}/${MY_PN}/archive/v${PV}.tar.gz + -> ${P}.tar.gz +" +S="${WORKDIR}/${MY_P}" + +LICENSE="GPL-2+" +SLOT="0" +KEYWORDS="amd64 ~riscv x86" +IUSE="gnutls nettle nss" +REQUIRED_USE="nettle? ( gnutls !nss )" + +# Requires active internet connection and it tries to download some binaries for later execution +RESTRICT="test" + +DEPEND=" + dev-libs/libxml2:2= + net-misc/curl + sys-fs/fuse:3= + nss? ( dev-libs/nss ) + !nss? ( + gnutls? ( + net-libs/gnutls:= + nettle? ( dev-libs/nettle:= ) + ) + !gnutls? ( dev-libs/openssl:0= ) + ) +" + +RDEPEND=" + ${DEPEND} + app-misc/mime-types +" + +BDEPEND="virtual/pkgconfig" + +src_prepare() { + default + + sed -i 's/ -D_FORTIFY_SOURCE=3//' configure.ac || die #895676 + + eautoreconf +} + +src_configure() { + local myeconfargs=( + $(use_with nettle) + ) + if use nss; then + myeconfargs+=( $(use_with nss) ) + elif use gnutls; then + myeconfargs+=( $(use_with gnutls) ) + else + myeconfargs+=( --with-openssl ) + fi + + econf "${myeconfargs[@]}" +} diff --git a/net-fs/samba/Manifest b/net-fs/samba/Manifest new file mode 100644 index 000000000000..22fa87fcc3f4 --- /dev/null +++ b/net-fs/samba/Manifest @@ -0,0 +1,9 @@ +DIST samba-4.22.10.tar.gz 42927839 BLAKE2B d75280581c0e22789aa274a957745a211435c78f8762aa5f571700156c03d087fdfa01820c2e4893b1e9e4c678834ed1b06bc8220aacd867fc4240cf1ea83077 SHA512 2f2169c6c2805c12c72069052b7864f6938a850ae20f7916eb63aaae5526df3944b205bb181f097d9e6140144ff565421b57b96ec202cf6c2f3dc4b20d60f245 +DIST samba-4.22.5.tar.gz 42876122 BLAKE2B c6ee4c98c4aced9faa0b5f90c61a3ea9473fc8c90e7c3ceb470aba9354fb4bb21cdd16a7d19bb6b0faee4454259e02546b4bb5093e8e8fe64a67b5635fc1152b SHA512 ee183e664768076f814c252afef0cd2225961d173174e8f4703d8cf59fe2abc2d1a089e293905849201ab2af75e27d8666360072a85bcce2b0dc735324d6b02e +DIST samba-4.22.9.tar.gz 42873956 BLAKE2B 8f238f0d6ca94c729bcb3af7e56399bbc86d20e15d77908de5beb824f10502407f99079f908001200b3b540ba6673037a7580dcd6090ef53aa285ff503729d01 SHA512 e97dc94b22bd05e37c6612ab778da2ca5d58007d9c08ce3ee9a6d595f020fcfd9613831811278e167dc010050da088966190ae9a322154dba4cab7c01b96e565 +DIST samba-4.23.6.tar.gz 43306831 BLAKE2B c5c567bfc4734429790ec7362150eda231ce7e3e7dbdfaa2ca2dc81bd178c9c15cc9360b21f4c5dd1f1423d46337bc5a7b581efcff8ed647adb69a9b47922320 SHA512 61dc2a80f1ea5a7a04bc45ba7896107fd1c619ec3f841f9f6adb9c166a3ce3a5cee7b0d097cfa2c768ba65e35167c0739099cc76a5478c0d6f41521a621336c9 +DIST samba-4.23.7.tar.gz 43305961 BLAKE2B 1c3847855a2cde457498856fddd25957c78240e58d2bdc65c5fe5805afc0a650638908393e3e83ff112b9c9a2c0c31fa5a186bb102d0ec6c063ab4e728dfdf0a SHA512 4cecc3ff3a2e1738a40bcd499c86c0503e79c49a99864423eb348d825c130febdeb44589cf2db007817c7d633a614ad4d58a887c10a579093ae2cda009c979b0 +DIST samba-4.23.8.tar.gz 43360349 BLAKE2B 7500080f8fb28b3a236064a52e4b259ceffa0f96b0cd0f78d2a7071cff088eac6ee9174d9719509326efadbf434632aa93c97116624e42e61a7cffe4a4130fb1 SHA512 5a18e5ef52b2be2cdc9ef39ac5699698c0ed8a0cb3d43db801efbec79014e2e862511b124b3371846c39c5fbb1d53b3b7ed8b0adaf88f670d1ece5dc0b92b077 +DIST samba-4.24.1.tar.gz 43389244 BLAKE2B 51459d4db739e47bc05692046ce0a8b3044de923b3d1e7a51589bb838a7ef9865b6d6034656ade87e099374157a92dac0cba70a5f293a4d1e2b623341b3e75ca SHA512 419653355fd609443b1cd321986e7e83c6479a52d7a998e1197846cdb591305b1173b77022a65cf643c46a3a8810de05499a9eba903b839a87fac7a270ebc85f +DIST samba-4.24.2.tar.gz 43409510 BLAKE2B 464b9324b1c4d9e50d70c0d921c65b775f49db9e9b82314cc072ad03087f2d2f3ca4c9cf2925a3628c07c2f4664f58f9a36528078a14666d1fcb20ddb7949b44 SHA512 54f65c200815f7f05eca5ee1e69e554acd93be912913d5e8fde1f8ed9b1b809dad4b47559053e4ce9780f271cf61b0abc3a25dce331ca237730574417cf5c5e7 +DIST samba-4.24.3.tar.gz 43446520 BLAKE2B 7804075e3153ac2252549e33ee421c54aaa355ad53cb06790875f32a802c1b8fc9fc77f70f7a4e231df40f8c32a87651e87ed93218e3e27bf97734204cecad5d SHA512 769445f861bfd978bc8eccc53135c03d94b5e2b402f45df8c3ae202999d6f8e35a2a78bb4bada34f09cf177cfe8be4013ffd6da8d311cf6a7ff2a4a8222c6b4f diff --git a/net-fs/samba/files/4.4/samba4.confd b/net-fs/samba/files/4.4/samba4.confd new file mode 100644 index 000000000000..629a605021a2 --- /dev/null +++ b/net-fs/samba/files/4.4/samba4.confd @@ -0,0 +1,45 @@ +# Add "winbind" to the daemon_list if you also want winbind to start. +# Replace "smbd nmbd" by "samba4" if you want the active directory domain controller part or the ntvfs +# file server part or the rpc proxy to start. +# Note that samba4 controls 'smbd' by itself, thus it can't be started manually. You can, however, +# tweak the behaviour of a samba4-controlled smbd by modifying your '/etc/samba/smb.conf' file +# accordingly. +daemon_list="smbd nmbd" + +piddir="/run/samba" + +#---------------------------------------------------------------------------- +# Daemons calls: <daemon_name>_<command_option> +#---------------------------------------------------------------------------- +my_service_name="samba" +my_service_PRE="unset TMP TMPDIR" +my_service_POST="" + +#---------------------------------------------------------------------------- +# Daemons calls: <daemon_name>_<command_option> +#---------------------------------------------------------------------------- +smbd_start_options="-D" +smbd_command="/usr/sbin/smbd" +smbd_start="start-stop-daemon --start --exec ${smbd_command} -- ${smbd_start_options}" +smbd_stop="start-stop-daemon --stop --exec ${smbd_command}" +smbd_reload="killall -HUP smbd" + +nmbd_start_options="-D" +nmbd_command="/usr/sbin/nmbd" +nmbd_start="start-stop-daemon --start --exec ${nmbd_command} -- ${nmbd_start_options}" +nmbd_stop="start-stop-daemon --stop --exec ${nmbd_command}" +nmbd_reload="killall -HUP nmbd" + +samba4_start_options="" +samba4_command="/usr/sbin/samba" +samba4_pidfile="${piddir}/samba.pid" +samba4_start="start-stop-daemon --start --exec ${samba4_command} --pidfile ${samba4_pidfile} -- ${samba4_start_options}" +samba4_stop="start-stop-daemon --stop --exec ${samba4_command} --pidfile ${samba4_pidfile}" +samba4_reload="killall -HUP samba" + +winbind_start_options="" +winbind_command="/usr/sbin/winbindd" +winbind_start="start-stop-daemon --start --exec ${winbind_command} -- ${winbind_start_options}" +winbind_stop="start-stop-daemon --stop --exec ${winbind_command}" +winbind_reload="killall -HUP winbindd" + diff --git a/net-fs/samba/files/4.4/samba4.initd-r1 b/net-fs/samba/files/4.4/samba4.initd-r1 new file mode 100644 index 000000000000..0a5289828525 --- /dev/null +++ b/net-fs/samba/files/4.4/samba4.initd-r1 @@ -0,0 +1,54 @@ +#!/sbin/openrc-run +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License, v2 or later + +extra_started_commands="reload" +[ -z "${piddir}" ] && piddir="/run/samba" + +depend() { + after slapd + use cupsd +} + +DAEMONNAME="${SVCNAME##samba.}" +[ "${DAEMONNAME}" != "samba" ] && daemon_list=${DAEMONNAME} + +signal_do() { + local signal="$1" + [ -z "${signal}" ] && return 0 + + local result=0 last_result=0 daemon= cmd_exec= + for daemon in ${daemon_list} ; do + eval cmd_exec=\$${daemon}_${signal} + if [ -n "${cmd_exec}" ]; then + ebegin "${my_service_name} -> ${signal}: ${daemon}" + #echo ${cmd} '->' ${!cmd} + ${cmd_exec} > /dev/null + last_result=$? + eend ${last_result} + fi + result=$(( ${result} + ${last_result} )) + done + return ${result} +} + +start() { + ${my_service_PRE} + [ -d "${piddir}" ] || mkdir -p "${piddir}" + signal_do start && return 0 + + eerror "Error: starting services (see system logs)" + signal_do stop + return 1 +} +stop() { + ${my_service_PRE} + if signal_do stop ; then + ${my_service_POST} + return 0 + fi +} +reload() { + ${my_service_PRE} + signal_do reload +} diff --git a/net-fs/samba/files/4.4/system-auth-winbind.pam b/net-fs/samba/files/4.4/system-auth-winbind.pam new file mode 100644 index 000000000000..8d6746b7aeb6 --- /dev/null +++ b/net-fs/samba/files/4.4/system-auth-winbind.pam @@ -0,0 +1,18 @@ +#%PAM-1.0 +# $Id$ + +auth required pam_env.so +auth sufficient pam_winbind.so +auth sufficient pam_unix.so likeauth nullok use_first_pass +auth required pam_deny.so + +account sufficient pam_winbind.so +account required pam_unix.so + +password required pam_cracklib.so retry=3 +password sufficient pam_unix.so nullok use_authtok md5 shadow +password required pam_deny.so + +session required pam_mkhomedir.so skel=/etc/skel/ umask=0022 +session required pam_limits.so +session required pam_unix.so diff --git a/net-fs/samba/files/ldb-2.5.2-skip-wav-tevent-check.patch b/net-fs/samba/files/ldb-2.5.2-skip-wav-tevent-check.patch new file mode 100644 index 000000000000..4578435064b0 --- /dev/null +++ b/net-fs/samba/files/ldb-2.5.2-skip-wav-tevent-check.patch @@ -0,0 +1,12 @@ +--- ldb-1.3.6/lib/tevent/wscript ++++ ldb-1.3.6/lib/tevent/wscript +@@ -34,8 +34,7 @@ + if conf.CHECK_BUNDLED_SYSTEM_PKG('tevent', minversion=VERSION, + onlyif='talloc', implied_deps='replace talloc'): + conf.define('USING_SYSTEM_TEVENT', 1) +- if not conf.env.disable_python and \ +- conf.CHECK_BUNDLED_SYSTEM_PYTHON('pytevent', 'tevent', minversion=VERSION): ++ if not conf.env.disable_python: + conf.define('USING_SYSTEM_PYTEVENT', 1) + + if conf.CHECK_FUNCS('epoll_create', headers='sys/epoll.h'): diff --git a/net-fs/samba/files/samba-4.18.4-pam.patch b/net-fs/samba/files/samba-4.18.4-pam.patch new file mode 100644 index 000000000000..381f77ccd32d --- /dev/null +++ b/net-fs/samba/files/samba-4.18.4-pam.patch @@ -0,0 +1,29 @@ +--- a/source3/wscript ++++ b/source3/wscript +@@ -863,7 +863,7 @@ + if conf.env.with_iconv: + conf.DEFINE('HAVE_ICONV', 1) + +- if Options.options.with_pam: ++ if Options.options.with_pam != False: + use_pam=True + conf.CHECK_HEADERS('security/pam_appl.h pam/pam_appl.h') + if not conf.CONFIG_SET('HAVE_SECURITY_PAM_APPL_H') and not conf.CONFIG_SET('HAVE_PAM_PAM_APPL_H'): +@@ -940,6 +940,17 @@ + "or headers not found. Use --without-pam to disable " + "PAM support."); + ++ else: ++ Logs.warn("PAM disabled") ++ use_pam=False ++ conf.undefine('WITH_PAM') ++ conf.undefine('WITH_PAM_MODULES') ++ conf.undefine('HAVE_SECURITY_PAM_APPL_H') ++ conf.undefine('PAM_RHOST') ++ conf.undefine('PAM_TTY') ++ conf.undefine('HAVE_PAM_PAM_APPL_H') ++ ++ + seteuid = False + + # diff --git a/net-fs/samba/files/samba.conf b/net-fs/samba/files/samba.conf new file mode 100644 index 000000000000..8e6e9dd8a158 --- /dev/null +++ b/net-fs/samba/files/samba.conf @@ -0,0 +1,8 @@ +d /run/samba +d /run/ctdb +d /run/lock/samba +d /var/cache/samba +d /var/lib/ctdb +d /var/lib/samba/bind-dns +d /var/lib/samba/private +d /var/log/samba diff --git a/net-fs/samba/metadata.xml b/net-fs/samba/metadata.xml new file mode 100644 index 000000000000..b2a746fcfc9b --- /dev/null +++ b/net-fs/samba/metadata.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>samba@gentoo.org</email> + <name>Samba Team</name> + </maintainer> + <longdescription> + Samba is an Open Source/Free Software suite that provides seamless file and print services to SMB/CIFS clients. Integration with various accounting and antivirus backends. License: GNU General Public License. + </longdescription> + <use> + <flag name="addc">Enable Active Directory Domain Controller support</flag> + <flag name="ads">Enable Active Directory support</flag> + <flag name="ceph">Enable support for Ceph distributed filesystem via <pkg>sys-cluster/ceph</pkg></flag> + <flag name="client">Enables the client part</flag> + <flag name="cluster">Enable support for clustering</flag> + <flag name="glusterfs">Enable support for Glusterfs filesystem via <pkg>sys-cluster/glusterfs</pkg></flag> + <flag name="gpg">Use <pkg>app-crypt/gpgme</pkg> for AD DC</flag> + <flag name="iprint">Enabling iPrint technology by Novell</flag> + <flag name="json">Enable json audit support through <pkg>dev-libs/jansson</pkg></flag> + <flag name="lmdb">Enable LMDB backend for bundled ldb</flag> + <flag name="profiling-data">Enables support for collecting profiling data</flag> + <flag name="quota">Enables support for user quotas</flag> + <flag name="regedit">Enable support for regedit command-line tool</flag> + <flag name="snapper">Enable vfs_snapper module (requires <pkg>sys-apps/dbus</pkg>)</flag> + <flag name="spotlight">Enable support for spotlight backend</flag> + <flag name="system-heimdal">Use <pkg>app-crypt/heimdal</pkg> instead of + bundled heimdal.</flag> + <flag name="system-mitkrb5">Use <pkg>app-crypt/mit-krb5</pkg> instead of + <pkg>app-crypt/heimdal</pkg>.</flag> + <flag name="unwind">Enable libunwind usage for backtraces</flag> + <flag name="winbind">Enables support for the winbind auth daemon</flag> + </use> + <upstream> + <remote-id type="cpe">cpe:/a:samba:samba</remote-id> + <remote-id type="gitlab">samba-team/samba</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-fs/samba/samba-4.22.10.ebuild b/net-fs/samba/samba-4.22.10.ebuild new file mode 100644 index 000000000000..9e26e4655be7 --- /dev/null +++ b/net-fs/samba/samba-4.22.10.ebuild @@ -0,0 +1,397 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) +PYTHON_REQ_USE="threads(+),xml(+)" +inherit python-single-r1 flag-o-matic waf-utils multilib-minimal linux-info optfeature systemd pam tmpfiles + +DESCRIPTION="Samba Suite Version 4" +HOMEPAGE="https://samba.org/" + +MY_PV="${PV/_rc/rc}" +MY_P="${PN}-${MY_PV}" +if [[ ${PV} == *_rc* ]]; then + SRC_URI="https://download.samba.org/pub/samba/rc/${MY_P}.tar.gz" +else + SRC_URI="https://download.samba.org/pub/samba/stable/${MY_P}.tar.gz" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86" +fi +S="${WORKDIR}/${MY_P}" + +LICENSE="GPL-3" +SLOT="0/2.10.0" +IUSE="acl addc ads ceph client cluster cups debug fam glusterfs gpg" +IUSE+=" iprint json ldap llvm-libunwind lmdb pam profiling-data python quota" +IUSE+=" +regedit selinux snapper spotlight syslog system-heimdal +system-mitkrb5" +IUSE+=" systemd test unwind winbind zeroconf" + +# ldap needs ads (bug #941578) +REQUIRED_USE="${PYTHON_REQUIRED_USE} + addc? ( json python !system-mitkrb5 winbind ) + ads? ( acl ldap python winbind ) + cluster? ( ads ) + gpg? ( addc ) + ldap? ( ads ) + spotlight? ( json ) + test? ( python ) + !ads? ( !addc ) + ?? ( system-heimdal system-mitkrb5 ) +" + +# 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" + +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 +) + +TALLOC_VERSION="2.4.3" +TDB_VERSION="1.4.13" +TEVENT_VERSION="0.16.2" + +COMMON_DEPEND=" + >=app-arch/libarchive-3.1.2:=[${MULTILIB_USEDEP}] + dev-lang/perl:= + dev-libs/icu:=[${MULTILIB_USEDEP}] + dev-libs/libbsd[${MULTILIB_USEDEP}] + dev-libs/libtasn1:=[${MULTILIB_USEDEP}] + dev-libs/popt[${MULTILIB_USEDEP}] + dev-perl/Parse-Yapp + >=net-libs/gnutls-3.4.7:=[${MULTILIB_USEDEP}] + >=sys-fs/e2fsprogs-1.46.4-r51[${MULTILIB_USEDEP}] + !sys-libs/ldb + sys-libs/libcap[${MULTILIB_USEDEP}] + sys-libs/liburing:=[${MULTILIB_USEDEP}] + sys-libs/ncurses:= + sys-libs/readline:= + >=sys-libs/talloc-${TALLOC_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tdb-${TDB_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tevent-${TEVENT_VERSION}[${MULTILIB_USEDEP}] + virtual/zlib:=[${MULTILIB_USEDEP}] + virtual/libcrypt:=[${MULTILIB_USEDEP}] + virtual/libiconv + $(python_gen_cond_dep ' + addc? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ads? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ') + acl? ( virtual/acl ) + ceph? ( sys-cluster/ceph ) + cluster? ( net-libs/rpcsvc-proto ) + cups? ( net-print/cups ) + debug? ( dev-util/lttng-ust ) + fam? ( virtual/fam ) + gpg? ( app-crypt/gpgme:= ) + json? ( dev-libs/jansson:= ) + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] ) + lmdb? ( >=dev-db/lmdb-0.9.16:=[${MULTILIB_USEDEP}] ) + pam? ( sys-libs/pam ) + python? ( + sys-libs/talloc[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tdb[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tevent[python,${PYTHON_SINGLE_USEDEP}] + ) + snapper? ( sys-apps/dbus ) + system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl(-),${MULTILIB_USEDEP}] ) + system-mitkrb5? ( >=app-crypt/mit-krb5-1.19[${MULTILIB_USEDEP}] ) + !system-heimdal? ( !system-mitkrb5? ( sys-apps/keyutils[${MULTILIB_USEDEP}] ) ) + systemd? ( sys-apps/systemd:= ) + unwind? ( + llvm-libunwind? ( llvm-runtimes/libunwind:= ) + !llvm-libunwind? ( sys-libs/libunwind:= ) + ) + zeroconf? ( net-dns/avahi[dbus] ) +" +DEPEND="${COMMON_DEPEND} + dev-perl/JSON + net-libs/libtirpc[${MULTILIB_USEDEP}] + net-libs/rpcsvc-proto + spotlight? ( dev-libs/glib ) + test? ( + >=dev-util/cmocka-1.1.3[${MULTILIB_USEDEP}] + $(python_gen_cond_dep "dev-python/python-subunit[\${PYTHON_USEDEP},${MULTILIB_USEDEP}]" ) + !system-mitkrb5? ( + >=net-dns/resolv_wrapper-1.1.4 + >=net-libs/socket_wrapper-1.1.9 + >=sys-libs/nss_wrapper-1.1.3 + >=sys-libs/uid_wrapper-1.2.1 + ) + )" +RDEPEND="${COMMON_DEPEND} + client? ( net-fs/cifs-utils[ads?] ) + python? ( ${PYTHON_DEPS} ) + selinux? ( sec-policy/selinux-samba ) +" +BDEPEND="${PYTHON_DEPS} + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-4.18.4-pam.patch + "${FILESDIR}"/ldb-2.5.2-skip-wav-tevent-check.patch +) + +CONFDIR="${FILESDIR}/4.4" +WAF_BINARY="${S}/buildtools/bin/waf" +SHAREDMODS="" + +pkg_setup() { + # Package fails to build with distcc + export DISTCC_DISABLE=1 + export PYTHONHASHSEED=1 + + python-single-r1_pkg_setup + + SHAREDMODS="$(usev !snapper '!')vfs_snapper" + if use cluster ; then + SHAREDMODS+=",idmap_rid,idmap_tdb2,idmap_ad" + elif use ads ; then + SHAREDMODS+=",idmap_ad" + fi +} + +check_samba_dep_versions() { + actual_talloc_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/talloc/wscript || die) + if [[ ${actual_talloc_version} != ${TALLOC_VERSION} ]] ; then + eerror "Source talloc version: ${TALLOC_VERSION}" + eerror "Ebuild talloc version: ${actual_talloc_version}" + die "Ebuild needs to fix TALLOC_VERSION!" + fi + + actual_tdb_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tdb/wscript || die) + if [[ ${actual_tdb_version} != ${TDB_VERSION} ]] ; then + eerror "Source tdb version: ${TDB_VERSION}" + eerror "Ebuild tdb version: ${actual_tdb_version}" + die "Ebuild needs to fix TDB_VERSION!" + fi + + actual_tevent_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tevent/wscript || die) + if [[ ${actual_tevent_version} != ${TEVENT_VERSION} ]] ; then + eerror "Source tevent version: ${TEVENT_VERSION}" + eerror "Ebuild tevent version: ${actual_tevent_version}" + die "Ebuild needs to fix TEVENT_VERSION!" + fi +} + +src_prepare() { + default + + check_samba_dep_versions + + # Unbundle dnspython + sed -i -e '/"dns.resolver":/d' "${S}"/third_party/wscript || die + + # Unbundle iso8601 unless tests are enabled + if ! use test ; then + 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 + + # bug #943942 + append-cflags -std=gnu17 + + # WAF + 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 + + # We "use" bundled cmocka when we're not running tests as we're + # not using it anyway. Means we avoid making users install it for + # no reason. bug #802531 + if ! use test ; then + bundled_libs="cmocka,${bundled_libs}" + fi + + # bug #874633 + if use llvm-libunwind ; then + mkdir -p "${T}"/${ABI}/pkgconfig || die + + local -x PKG_CONFIG_PATH="${T}/${ABI}/pkgconfig:${PKG_CONFIG_PATH}" + + cat <<-EOF > "${T}"/${ABI}/pkgconfig/libunwind-generic.pc || die + exec_prefix=\${prefix} + libdir=/usr/$(get_libdir) + includedir=\${prefix}/include + + Name: libunwind-generic + Description: libunwind generic library + Version: 1.70 + Libs: -L\${libdir} -lunwind + Cflags: -I\${includedir} + EOF + fi + + local 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 + --without-winexe + $(multilib_native_use_with acl acl-support) + $(multilib_native_usex addc '' '--without-ad-dc') + $(multilib_native_use_enable ceph cephfs) + $(multilib_native_use_with cluster cluster-support) + $(multilib_native_use_enable cups) + --without-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 pam) + $(multilib_native_usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '') + $(multilib_native_use_with quota quotas) + $(multilib_native_use_with regedit) + $(multilib_native_use_enable spotlight) + $(multilib_native_use_with syslog) + $(multilib_native_use_with systemd) + --systemd-install-services + --with-systemddir="$(systemd_get_systemunitdir)" + $(multilib_native_use_with unwind libunwind) + $(multilib_native_use_with winbind) + $(multilib_native_usex python '' '--disable-python') + $(multilib_native_use_enable zeroconf avahi) + $(multilib_native_usex test '--enable-selftest' '') + $(usev system-mitkrb5 "--with-system-mitkrb5 ${ESYSROOT}/usr $(multilib_native_usex addc --with-experimental-mit-ad-dc '')") + $(use_with ads) + $(use_with debug lttng) + $(use_with ldap) + $(use_with profiling-data) + --private-libraries='!ldb' + $(usex lmdb '' --without-ldb-lmdb) + # bug #683148 + --jobs 1 + ) + + if multilib_is_native_abi ; then + myconf+=( --with-shared-modules=${SHAREDMODS} ) + else + myconf+=( --with-shared-modules=DEFAULT,!vfs_snapper ) + fi + + append-ldflags $(test-flags-CCLD -Wl,--undefined-version) # bug 914898 + + append-cppflags "-I${ESYSROOT}/usr/include/et" + + waf-utils_src_configure ${myconf[@]} +} + +multilib_src_compile() { + waf-utils_src_compile +} + +multilib_src_test() { + if multilib_is_native_abi ; then + "${WAF_BINARY}" test || die "Test failed" + fi +} + +multilib_src_install() { + waf-utils_src_install + + # Make all .so files executable + find "${ED}" -type f -name "*.so" -exec chmod +x {} + || die + # smbspool_krb5_wrapper must only be accessible to root, bug #880739 + find "${ED}" -type f -name "smbspool_krb5_wrapper" -exec chmod go-rwx {} + || die + + # Remove empty runtime dirs created by build system (bug #892341) + find "${ED}"/{run,var} -type d -empty -delete || die + + 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 ../../../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 (bug #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 + + dotmpfiles "${FILESDIR}"/samba.conf + if ! use addc ; then + rm "${D}/$(systemd_get_systemunitdir)/samba.service" \ + || die + fi + + # Preserve functionality for old gentoo-specific unit names + dosym nmb.service "$(systemd_get_systemunitdir)/nmbd.service" + dosym smb.service "$(systemd_get_systemunitdir)/smbd.service" + dosym winbind.service "$(systemd_get_systemunitdir)/winbindd.service" + + use python && python_optimize + fi + + if use pam && use winbind ; then + newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind + # bugs #376853 and #590374 + insinto /etc/security + doins examples/pam_winbind/pam_winbind.conf + fi +} + +pkg_postinst() { + tmpfiles_process samba.conf + + if use addc || use ads ; then + optfeature "Hide passwords from command line when using samba-tool or samba-gpupdate" dev-python/setproctitle + fi +} diff --git a/net-fs/samba/samba-4.22.5-r1.ebuild b/net-fs/samba/samba-4.22.5-r1.ebuild new file mode 100644 index 000000000000..f1d54eb271a6 --- /dev/null +++ b/net-fs/samba/samba-4.22.5-r1.ebuild @@ -0,0 +1,393 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) +PYTHON_REQ_USE="threads(+),xml(+)" +inherit python-single-r1 flag-o-matic waf-utils multilib-minimal linux-info systemd pam tmpfiles + +DESCRIPTION="Samba Suite Version 4" +HOMEPAGE="https://samba.org/" + +MY_PV="${PV/_rc/rc}" +MY_P="${PN}-${MY_PV}" +if [[ ${PV} == *_rc* ]]; then + SRC_URI="https://download.samba.org/pub/samba/rc/${MY_P}.tar.gz" +else + SRC_URI="https://download.samba.org/pub/samba/stable/${MY_P}.tar.gz" + KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~sparc x86" +fi +S="${WORKDIR}/${MY_P}" + +LICENSE="GPL-3" +SLOT="0/2.10.0" +IUSE="acl addc ads ceph client cluster cups debug fam glusterfs gpg" +IUSE+=" iprint json ldap llvm-libunwind lmdb pam profiling-data python quota" +IUSE+=" +regedit selinux snapper spotlight syslog system-heimdal +system-mitkrb5" +IUSE+=" systemd test unwind winbind zeroconf" + +# ldap needs ads (bug #941578) +REQUIRED_USE="${PYTHON_REQUIRED_USE} + addc? ( json python !system-mitkrb5 winbind ) + ads? ( acl ldap python winbind ) + cluster? ( ads ) + gpg? ( addc ) + ldap? ( ads ) + spotlight? ( json ) + test? ( python ) + !ads? ( !addc ) + ?? ( system-heimdal system-mitkrb5 ) +" + +# 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" + +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 +) + +TALLOC_VERSION="2.4.3" +TDB_VERSION="1.4.13" +TEVENT_VERSION="0.16.2" + +COMMON_DEPEND=" + >=app-arch/libarchive-3.1.2:=[${MULTILIB_USEDEP}] + dev-lang/perl:= + dev-libs/icu:=[${MULTILIB_USEDEP}] + dev-libs/libbsd[${MULTILIB_USEDEP}] + dev-libs/libtasn1:=[${MULTILIB_USEDEP}] + dev-libs/popt[${MULTILIB_USEDEP}] + dev-perl/Parse-Yapp + >=net-libs/gnutls-3.4.7:=[${MULTILIB_USEDEP}] + >=sys-fs/e2fsprogs-1.46.4-r51[${MULTILIB_USEDEP}] + !sys-libs/ldb + sys-libs/libcap[${MULTILIB_USEDEP}] + sys-libs/liburing:=[${MULTILIB_USEDEP}] + sys-libs/ncurses:= + sys-libs/readline:= + >=sys-libs/talloc-${TALLOC_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tdb-${TDB_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tevent-${TEVENT_VERSION}[${MULTILIB_USEDEP}] + virtual/zlib:=[${MULTILIB_USEDEP}] + virtual/libcrypt:=[${MULTILIB_USEDEP}] + virtual/libiconv + $(python_gen_cond_dep ' + addc? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ads? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ') + acl? ( virtual/acl ) + ceph? ( sys-cluster/ceph ) + cluster? ( net-libs/rpcsvc-proto ) + cups? ( net-print/cups ) + debug? ( dev-util/lttng-ust ) + fam? ( virtual/fam ) + gpg? ( app-crypt/gpgme:= ) + json? ( dev-libs/jansson:= ) + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] ) + lmdb? ( >=dev-db/lmdb-0.9.16:=[${MULTILIB_USEDEP}] ) + pam? ( sys-libs/pam ) + python? ( + sys-libs/talloc[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tdb[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tevent[python,${PYTHON_SINGLE_USEDEP}] + ) + snapper? ( sys-apps/dbus ) + system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl(-),${MULTILIB_USEDEP}] ) + system-mitkrb5? ( >=app-crypt/mit-krb5-1.19[${MULTILIB_USEDEP}] ) + !system-heimdal? ( !system-mitkrb5? ( sys-apps/keyutils[${MULTILIB_USEDEP}] ) ) + systemd? ( sys-apps/systemd:= ) + unwind? ( + llvm-libunwind? ( llvm-runtimes/libunwind:= ) + !llvm-libunwind? ( sys-libs/libunwind:= ) + ) + zeroconf? ( net-dns/avahi[dbus] ) +" +DEPEND="${COMMON_DEPEND} + dev-perl/JSON + net-libs/libtirpc[${MULTILIB_USEDEP}] + net-libs/rpcsvc-proto + spotlight? ( dev-libs/glib ) + test? ( + >=dev-util/cmocka-1.1.3[${MULTILIB_USEDEP}] + $(python_gen_cond_dep "dev-python/python-subunit[\${PYTHON_USEDEP},${MULTILIB_USEDEP}]" ) + !system-mitkrb5? ( + >=net-dns/resolv_wrapper-1.1.4 + >=net-libs/socket_wrapper-1.1.9 + >=sys-libs/nss_wrapper-1.1.3 + >=sys-libs/uid_wrapper-1.2.1 + ) + )" +RDEPEND="${COMMON_DEPEND} + client? ( net-fs/cifs-utils[ads?] ) + python? ( ${PYTHON_DEPS} ) + selinux? ( sec-policy/selinux-samba ) +" +BDEPEND="${PYTHON_DEPS} + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-4.18.4-pam.patch + "${FILESDIR}"/ldb-2.5.2-skip-wav-tevent-check.patch +) + +CONFDIR="${FILESDIR}/4.4" +WAF_BINARY="${S}/buildtools/bin/waf" +SHAREDMODS="" + +pkg_setup() { + # Package fails to build with distcc + export DISTCC_DISABLE=1 + export PYTHONHASHSEED=1 + + python-single-r1_pkg_setup + + SHAREDMODS="$(usev !snapper '!')vfs_snapper" + if use cluster ; then + SHAREDMODS+=",idmap_rid,idmap_tdb2,idmap_ad" + elif use ads ; then + SHAREDMODS+=",idmap_ad" + fi +} + +check_samba_dep_versions() { + actual_talloc_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/talloc/wscript || die) + if [[ ${actual_talloc_version} != ${TALLOC_VERSION} ]] ; then + eerror "Source talloc version: ${TALLOC_VERSION}" + eerror "Ebuild talloc version: ${actual_talloc_version}" + die "Ebuild needs to fix TALLOC_VERSION!" + fi + + actual_tdb_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tdb/wscript || die) + if [[ ${actual_tdb_version} != ${TDB_VERSION} ]] ; then + eerror "Source tdb version: ${TDB_VERSION}" + eerror "Ebuild tdb version: ${actual_tdb_version}" + die "Ebuild needs to fix TDB_VERSION!" + fi + + actual_tevent_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tevent/wscript || die) + if [[ ${actual_tevent_version} != ${TEVENT_VERSION} ]] ; then + eerror "Source tevent version: ${TEVENT_VERSION}" + eerror "Ebuild tevent version: ${actual_tevent_version}" + die "Ebuild needs to fix TEVENT_VERSION!" + fi +} + +src_prepare() { + default + + check_samba_dep_versions + + # Unbundle dnspython + sed -i -e '/"dns.resolver":/d' "${S}"/third_party/wscript || die + + # Unbundle iso8601 unless tests are enabled + if ! use test ; then + 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 + + # bug #943942 + append-cflags -std=gnu17 + + # WAF + 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 + + # We "use" bundled cmocka when we're not running tests as we're + # not using it anyway. Means we avoid making users install it for + # no reason. bug #802531 + if ! use test ; then + bundled_libs="cmocka,${bundled_libs}" + fi + + # bug #874633 + if use llvm-libunwind ; then + mkdir -p "${T}"/${ABI}/pkgconfig || die + + local -x PKG_CONFIG_PATH="${T}/${ABI}/pkgconfig:${PKG_CONFIG_PATH}" + + cat <<-EOF > "${T}"/${ABI}/pkgconfig/libunwind-generic.pc || die + exec_prefix=\${prefix} + libdir=/usr/$(get_libdir) + includedir=\${prefix}/include + + Name: libunwind-generic + Description: libunwind generic library + Version: 1.70 + Libs: -L\${libdir} -lunwind + Cflags: -I\${includedir} + EOF + fi + + local 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 + --without-winexe + $(multilib_native_use_with acl acl-support) + $(multilib_native_usex addc '' '--without-ad-dc') + $(multilib_native_use_enable ceph cephfs) + $(multilib_native_use_with cluster cluster-support) + $(multilib_native_use_enable cups) + --without-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 pam) + $(multilib_native_usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '') + $(multilib_native_use_with quota quotas) + $(multilib_native_use_with regedit) + $(multilib_native_use_enable spotlight) + $(multilib_native_use_with syslog) + $(multilib_native_use_with systemd) + --systemd-install-services + --with-systemddir="$(systemd_get_systemunitdir)" + $(multilib_native_use_with unwind libunwind) + $(multilib_native_use_with winbind) + $(multilib_native_usex python '' '--disable-python') + $(multilib_native_use_enable zeroconf avahi) + $(multilib_native_usex test '--enable-selftest' '') + $(usev system-mitkrb5 "--with-system-mitkrb5 ${ESYSROOT}/usr $(multilib_native_usex addc --with-experimental-mit-ad-dc '')") + $(use_with ads) + $(use_with debug lttng) + $(use_with ldap) + $(use_with profiling-data) + --private-libraries='!ldb' + $(usex lmdb '' --without-ldb-lmdb) + # bug #683148 + --jobs 1 + ) + + if multilib_is_native_abi ; then + myconf+=( --with-shared-modules=${SHAREDMODS} ) + else + myconf+=( --with-shared-modules=DEFAULT,!vfs_snapper ) + fi + + append-ldflags $(test-flags-CCLD -Wl,--undefined-version) # bug 914898 + + append-cppflags "-I${ESYSROOT}/usr/include/et" + + waf-utils_src_configure ${myconf[@]} +} + +multilib_src_compile() { + waf-utils_src_compile +} + +multilib_src_test() { + if multilib_is_native_abi ; then + "${WAF_BINARY}" test || die "Test failed" + fi +} + +multilib_src_install() { + waf-utils_src_install + + # Make all .so files executable + find "${ED}" -type f -name "*.so" -exec chmod +x {} + || die + # smbspool_krb5_wrapper must only be accessible to root, bug #880739 + find "${ED}" -type f -name "smbspool_krb5_wrapper" -exec chmod go-rwx {} + || die + + # Remove empty runtime dirs created by build system (bug #892341) + find "${ED}"/{run,var} -type d -empty -delete || die + + 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 ../../../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 (bug #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 + + dotmpfiles "${FILESDIR}"/samba.conf + if ! use addc ; then + rm "${D}/$(systemd_get_systemunitdir)/samba.service" \ + || die + fi + + # Preserve functionality for old gentoo-specific unit names + dosym nmb.service "$(systemd_get_systemunitdir)/nmbd.service" + dosym smb.service "$(systemd_get_systemunitdir)/smbd.service" + dosym winbind.service "$(systemd_get_systemunitdir)/winbindd.service" + + use python && python_optimize + fi + + if use pam && use winbind ; then + newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind + # bugs #376853 and #590374 + insinto /etc/security + doins examples/pam_winbind/pam_winbind.conf + fi +} + +pkg_postinst() { + tmpfiles_process samba.conf +} diff --git a/net-fs/samba/samba-4.22.9.ebuild b/net-fs/samba/samba-4.22.9.ebuild new file mode 100644 index 000000000000..9e26e4655be7 --- /dev/null +++ b/net-fs/samba/samba-4.22.9.ebuild @@ -0,0 +1,397 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) +PYTHON_REQ_USE="threads(+),xml(+)" +inherit python-single-r1 flag-o-matic waf-utils multilib-minimal linux-info optfeature systemd pam tmpfiles + +DESCRIPTION="Samba Suite Version 4" +HOMEPAGE="https://samba.org/" + +MY_PV="${PV/_rc/rc}" +MY_P="${PN}-${MY_PV}" +if [[ ${PV} == *_rc* ]]; then + SRC_URI="https://download.samba.org/pub/samba/rc/${MY_P}.tar.gz" +else + SRC_URI="https://download.samba.org/pub/samba/stable/${MY_P}.tar.gz" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86" +fi +S="${WORKDIR}/${MY_P}" + +LICENSE="GPL-3" +SLOT="0/2.10.0" +IUSE="acl addc ads ceph client cluster cups debug fam glusterfs gpg" +IUSE+=" iprint json ldap llvm-libunwind lmdb pam profiling-data python quota" +IUSE+=" +regedit selinux snapper spotlight syslog system-heimdal +system-mitkrb5" +IUSE+=" systemd test unwind winbind zeroconf" + +# ldap needs ads (bug #941578) +REQUIRED_USE="${PYTHON_REQUIRED_USE} + addc? ( json python !system-mitkrb5 winbind ) + ads? ( acl ldap python winbind ) + cluster? ( ads ) + gpg? ( addc ) + ldap? ( ads ) + spotlight? ( json ) + test? ( python ) + !ads? ( !addc ) + ?? ( system-heimdal system-mitkrb5 ) +" + +# 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" + +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 +) + +TALLOC_VERSION="2.4.3" +TDB_VERSION="1.4.13" +TEVENT_VERSION="0.16.2" + +COMMON_DEPEND=" + >=app-arch/libarchive-3.1.2:=[${MULTILIB_USEDEP}] + dev-lang/perl:= + dev-libs/icu:=[${MULTILIB_USEDEP}] + dev-libs/libbsd[${MULTILIB_USEDEP}] + dev-libs/libtasn1:=[${MULTILIB_USEDEP}] + dev-libs/popt[${MULTILIB_USEDEP}] + dev-perl/Parse-Yapp + >=net-libs/gnutls-3.4.7:=[${MULTILIB_USEDEP}] + >=sys-fs/e2fsprogs-1.46.4-r51[${MULTILIB_USEDEP}] + !sys-libs/ldb + sys-libs/libcap[${MULTILIB_USEDEP}] + sys-libs/liburing:=[${MULTILIB_USEDEP}] + sys-libs/ncurses:= + sys-libs/readline:= + >=sys-libs/talloc-${TALLOC_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tdb-${TDB_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tevent-${TEVENT_VERSION}[${MULTILIB_USEDEP}] + virtual/zlib:=[${MULTILIB_USEDEP}] + virtual/libcrypt:=[${MULTILIB_USEDEP}] + virtual/libiconv + $(python_gen_cond_dep ' + addc? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ads? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ') + acl? ( virtual/acl ) + ceph? ( sys-cluster/ceph ) + cluster? ( net-libs/rpcsvc-proto ) + cups? ( net-print/cups ) + debug? ( dev-util/lttng-ust ) + fam? ( virtual/fam ) + gpg? ( app-crypt/gpgme:= ) + json? ( dev-libs/jansson:= ) + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] ) + lmdb? ( >=dev-db/lmdb-0.9.16:=[${MULTILIB_USEDEP}] ) + pam? ( sys-libs/pam ) + python? ( + sys-libs/talloc[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tdb[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tevent[python,${PYTHON_SINGLE_USEDEP}] + ) + snapper? ( sys-apps/dbus ) + system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl(-),${MULTILIB_USEDEP}] ) + system-mitkrb5? ( >=app-crypt/mit-krb5-1.19[${MULTILIB_USEDEP}] ) + !system-heimdal? ( !system-mitkrb5? ( sys-apps/keyutils[${MULTILIB_USEDEP}] ) ) + systemd? ( sys-apps/systemd:= ) + unwind? ( + llvm-libunwind? ( llvm-runtimes/libunwind:= ) + !llvm-libunwind? ( sys-libs/libunwind:= ) + ) + zeroconf? ( net-dns/avahi[dbus] ) +" +DEPEND="${COMMON_DEPEND} + dev-perl/JSON + net-libs/libtirpc[${MULTILIB_USEDEP}] + net-libs/rpcsvc-proto + spotlight? ( dev-libs/glib ) + test? ( + >=dev-util/cmocka-1.1.3[${MULTILIB_USEDEP}] + $(python_gen_cond_dep "dev-python/python-subunit[\${PYTHON_USEDEP},${MULTILIB_USEDEP}]" ) + !system-mitkrb5? ( + >=net-dns/resolv_wrapper-1.1.4 + >=net-libs/socket_wrapper-1.1.9 + >=sys-libs/nss_wrapper-1.1.3 + >=sys-libs/uid_wrapper-1.2.1 + ) + )" +RDEPEND="${COMMON_DEPEND} + client? ( net-fs/cifs-utils[ads?] ) + python? ( ${PYTHON_DEPS} ) + selinux? ( sec-policy/selinux-samba ) +" +BDEPEND="${PYTHON_DEPS} + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-4.18.4-pam.patch + "${FILESDIR}"/ldb-2.5.2-skip-wav-tevent-check.patch +) + +CONFDIR="${FILESDIR}/4.4" +WAF_BINARY="${S}/buildtools/bin/waf" +SHAREDMODS="" + +pkg_setup() { + # Package fails to build with distcc + export DISTCC_DISABLE=1 + export PYTHONHASHSEED=1 + + python-single-r1_pkg_setup + + SHAREDMODS="$(usev !snapper '!')vfs_snapper" + if use cluster ; then + SHAREDMODS+=",idmap_rid,idmap_tdb2,idmap_ad" + elif use ads ; then + SHAREDMODS+=",idmap_ad" + fi +} + +check_samba_dep_versions() { + actual_talloc_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/talloc/wscript || die) + if [[ ${actual_talloc_version} != ${TALLOC_VERSION} ]] ; then + eerror "Source talloc version: ${TALLOC_VERSION}" + eerror "Ebuild talloc version: ${actual_talloc_version}" + die "Ebuild needs to fix TALLOC_VERSION!" + fi + + actual_tdb_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tdb/wscript || die) + if [[ ${actual_tdb_version} != ${TDB_VERSION} ]] ; then + eerror "Source tdb version: ${TDB_VERSION}" + eerror "Ebuild tdb version: ${actual_tdb_version}" + die "Ebuild needs to fix TDB_VERSION!" + fi + + actual_tevent_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tevent/wscript || die) + if [[ ${actual_tevent_version} != ${TEVENT_VERSION} ]] ; then + eerror "Source tevent version: ${TEVENT_VERSION}" + eerror "Ebuild tevent version: ${actual_tevent_version}" + die "Ebuild needs to fix TEVENT_VERSION!" + fi +} + +src_prepare() { + default + + check_samba_dep_versions + + # Unbundle dnspython + sed -i -e '/"dns.resolver":/d' "${S}"/third_party/wscript || die + + # Unbundle iso8601 unless tests are enabled + if ! use test ; then + 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 + + # bug #943942 + append-cflags -std=gnu17 + + # WAF + 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 + + # We "use" bundled cmocka when we're not running tests as we're + # not using it anyway. Means we avoid making users install it for + # no reason. bug #802531 + if ! use test ; then + bundled_libs="cmocka,${bundled_libs}" + fi + + # bug #874633 + if use llvm-libunwind ; then + mkdir -p "${T}"/${ABI}/pkgconfig || die + + local -x PKG_CONFIG_PATH="${T}/${ABI}/pkgconfig:${PKG_CONFIG_PATH}" + + cat <<-EOF > "${T}"/${ABI}/pkgconfig/libunwind-generic.pc || die + exec_prefix=\${prefix} + libdir=/usr/$(get_libdir) + includedir=\${prefix}/include + + Name: libunwind-generic + Description: libunwind generic library + Version: 1.70 + Libs: -L\${libdir} -lunwind + Cflags: -I\${includedir} + EOF + fi + + local 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 + --without-winexe + $(multilib_native_use_with acl acl-support) + $(multilib_native_usex addc '' '--without-ad-dc') + $(multilib_native_use_enable ceph cephfs) + $(multilib_native_use_with cluster cluster-support) + $(multilib_native_use_enable cups) + --without-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 pam) + $(multilib_native_usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '') + $(multilib_native_use_with quota quotas) + $(multilib_native_use_with regedit) + $(multilib_native_use_enable spotlight) + $(multilib_native_use_with syslog) + $(multilib_native_use_with systemd) + --systemd-install-services + --with-systemddir="$(systemd_get_systemunitdir)" + $(multilib_native_use_with unwind libunwind) + $(multilib_native_use_with winbind) + $(multilib_native_usex python '' '--disable-python') + $(multilib_native_use_enable zeroconf avahi) + $(multilib_native_usex test '--enable-selftest' '') + $(usev system-mitkrb5 "--with-system-mitkrb5 ${ESYSROOT}/usr $(multilib_native_usex addc --with-experimental-mit-ad-dc '')") + $(use_with ads) + $(use_with debug lttng) + $(use_with ldap) + $(use_with profiling-data) + --private-libraries='!ldb' + $(usex lmdb '' --without-ldb-lmdb) + # bug #683148 + --jobs 1 + ) + + if multilib_is_native_abi ; then + myconf+=( --with-shared-modules=${SHAREDMODS} ) + else + myconf+=( --with-shared-modules=DEFAULT,!vfs_snapper ) + fi + + append-ldflags $(test-flags-CCLD -Wl,--undefined-version) # bug 914898 + + append-cppflags "-I${ESYSROOT}/usr/include/et" + + waf-utils_src_configure ${myconf[@]} +} + +multilib_src_compile() { + waf-utils_src_compile +} + +multilib_src_test() { + if multilib_is_native_abi ; then + "${WAF_BINARY}" test || die "Test failed" + fi +} + +multilib_src_install() { + waf-utils_src_install + + # Make all .so files executable + find "${ED}" -type f -name "*.so" -exec chmod +x {} + || die + # smbspool_krb5_wrapper must only be accessible to root, bug #880739 + find "${ED}" -type f -name "smbspool_krb5_wrapper" -exec chmod go-rwx {} + || die + + # Remove empty runtime dirs created by build system (bug #892341) + find "${ED}"/{run,var} -type d -empty -delete || die + + 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 ../../../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 (bug #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 + + dotmpfiles "${FILESDIR}"/samba.conf + if ! use addc ; then + rm "${D}/$(systemd_get_systemunitdir)/samba.service" \ + || die + fi + + # Preserve functionality for old gentoo-specific unit names + dosym nmb.service "$(systemd_get_systemunitdir)/nmbd.service" + dosym smb.service "$(systemd_get_systemunitdir)/smbd.service" + dosym winbind.service "$(systemd_get_systemunitdir)/winbindd.service" + + use python && python_optimize + fi + + if use pam && use winbind ; then + newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind + # bugs #376853 and #590374 + insinto /etc/security + doins examples/pam_winbind/pam_winbind.conf + fi +} + +pkg_postinst() { + tmpfiles_process samba.conf + + if use addc || use ads ; then + optfeature "Hide passwords from command line when using samba-tool or samba-gpupdate" dev-python/setproctitle + fi +} diff --git a/net-fs/samba/samba-4.23.6.ebuild b/net-fs/samba/samba-4.23.6.ebuild new file mode 100644 index 000000000000..c6cdba0f9410 --- /dev/null +++ b/net-fs/samba/samba-4.23.6.ebuild @@ -0,0 +1,400 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) +PYTHON_REQ_USE="threads(+),xml(+)" +inherit python-single-r1 flag-o-matic waf-utils multilib-minimal linux-info optfeature systemd pam tmpfiles + +DESCRIPTION="Samba Suite Version 4" +HOMEPAGE="https://samba.org/" + +MY_PV="${PV/_rc/rc}" +MY_P="${PN}-${MY_PV}" +if [[ ${PV} == *_rc* ]]; then + SRC_URI="https://download.samba.org/pub/samba/rc/${MY_P}.tar.gz" +else + SRC_URI="https://download.samba.org/pub/samba/stable/${MY_P}.tar.gz" + KEYWORDS="amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~sparc x86" +fi +S="${WORKDIR}/${MY_P}" + +LICENSE="GPL-3" +SLOT="0/2.11.0" +IUSE="acl addc ads ceph client cluster cups debug fam glusterfs gpg" +IUSE+=" iprint json ldap llvm-libunwind lmdb pam profiling-data python quota" +IUSE+=" +regedit selinux snapper spotlight syslog system-heimdal +system-mitkrb5" +IUSE+=" systemd test unwind winbind zeroconf" + +# ldap needs ads (bug #941578) +REQUIRED_USE="${PYTHON_REQUIRED_USE} + addc? ( json python !system-mitkrb5 winbind ) + ads? ( acl ldap python winbind ) + cluster? ( ads ) + gpg? ( addc ) + ldap? ( ads ) + spotlight? ( json ) + test? ( python ) + !ads? ( !addc ) + ?? ( system-heimdal system-mitkrb5 ) +" + +# 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" + +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 +) + +TALLOC_VERSION="2.4.3" +TDB_VERSION="1.4.14" +TEVENT_VERSION="0.17.1" + +COMMON_DEPEND=" + >=app-arch/libarchive-3.1.2:=[${MULTILIB_USEDEP}] + dev-lang/perl:= + dev-libs/icu:=[${MULTILIB_USEDEP}] + dev-libs/libbsd[${MULTILIB_USEDEP}] + dev-libs/libtasn1:=[${MULTILIB_USEDEP}] + dev-libs/popt[${MULTILIB_USEDEP}] + dev-perl/Parse-Yapp + >=net-libs/gnutls-3.4.7:=[${MULTILIB_USEDEP}] + >=net-libs/ngtcp2-1.12.0[gnutls,${MULTILIB_USEDEP}] + >=sys-fs/e2fsprogs-1.46.4-r51[${MULTILIB_USEDEP}] + !sys-libs/ldb + sys-libs/libcap[${MULTILIB_USEDEP}] + sys-libs/liburing:=[${MULTILIB_USEDEP}] + sys-libs/ncurses:= + sys-libs/readline:= + >=sys-libs/talloc-${TALLOC_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tdb-${TDB_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tevent-${TEVENT_VERSION}[${MULTILIB_USEDEP}] + virtual/zlib:=[${MULTILIB_USEDEP}] + virtual/libcrypt:=[${MULTILIB_USEDEP}] + virtual/libiconv + $(python_gen_cond_dep ' + addc? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ads? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ') + acl? ( virtual/acl ) + ceph? ( sys-cluster/ceph ) + cluster? ( net-libs/rpcsvc-proto ) + cups? ( net-print/cups ) + debug? ( dev-util/lttng-ust ) + fam? ( virtual/fam ) + gpg? ( app-crypt/gpgme:= ) + json? ( dev-libs/jansson:= ) + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] ) + lmdb? ( >=dev-db/lmdb-0.9.16:=[${MULTILIB_USEDEP}] ) + pam? ( sys-libs/pam ) + python? ( + sys-libs/talloc[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tdb[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tevent[python,${PYTHON_SINGLE_USEDEP}] + ) + snapper? ( sys-apps/dbus ) + system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl(-),${MULTILIB_USEDEP}] ) + system-mitkrb5? ( >=app-crypt/mit-krb5-1.19[${MULTILIB_USEDEP}] ) + !system-heimdal? ( !system-mitkrb5? ( sys-apps/keyutils[${MULTILIB_USEDEP}] ) ) + systemd? ( sys-apps/systemd:= ) + unwind? ( + llvm-libunwind? ( llvm-runtimes/libunwind:= ) + !llvm-libunwind? ( sys-libs/libunwind:= ) + ) + zeroconf? ( net-dns/avahi[dbus] ) +" +DEPEND="${COMMON_DEPEND} + dev-perl/JSON + net-libs/libtirpc[${MULTILIB_USEDEP}] + net-libs/rpcsvc-proto + spotlight? ( dev-libs/glib ) + test? ( + >=dev-util/cmocka-1.1.3[${MULTILIB_USEDEP}] + $(python_gen_cond_dep "dev-python/python-subunit[\${PYTHON_USEDEP},${MULTILIB_USEDEP}]" ) + !system-mitkrb5? ( + >=net-dns/resolv_wrapper-1.1.4 + >=net-libs/socket_wrapper-1.1.9 + >=sys-libs/nss_wrapper-1.1.3 + >=sys-libs/uid_wrapper-1.2.1 + ) + )" +RDEPEND="${COMMON_DEPEND} + client? ( net-fs/cifs-utils[ads?] ) + python? ( ${PYTHON_DEPS} ) + selinux? ( sec-policy/selinux-samba ) +" +BDEPEND="${PYTHON_DEPS} + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-4.18.4-pam.patch + "${FILESDIR}"/ldb-2.5.2-skip-wav-tevent-check.patch +) + +CONFDIR="${FILESDIR}/4.4" +WAF_BINARY="${S}/buildtools/bin/waf" +SHAREDMODS="" + +pkg_setup() { + # Package fails to build with distcc + export DISTCC_DISABLE=1 + export PYTHONHASHSEED=1 + + python-single-r1_pkg_setup + + SHAREDMODS="$(usev !snapper '!')vfs_snapper" + if use cluster ; then + SHAREDMODS+=",idmap_rid,idmap_tdb2,idmap_ad" + elif use ads ; then + SHAREDMODS+=",idmap_ad" + fi +} + +check_samba_dep_versions() { + actual_talloc_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/talloc/wscript || die) + if [[ ${actual_talloc_version} != ${TALLOC_VERSION} ]] ; then + eerror "Source talloc version: ${TALLOC_VERSION}" + eerror "Ebuild talloc version: ${actual_talloc_version}" + die "Ebuild needs to fix TALLOC_VERSION!" + fi + + actual_tdb_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tdb/wscript || die) + if [[ ${actual_tdb_version} != ${TDB_VERSION} ]] ; then + eerror "Source tdb version: ${TDB_VERSION}" + eerror "Ebuild tdb version: ${actual_tdb_version}" + die "Ebuild needs to fix TDB_VERSION!" + fi + + actual_tevent_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tevent/wscript || die) + if [[ ${actual_tevent_version} != ${TEVENT_VERSION} ]] ; then + eerror "Source tevent version: ${TEVENT_VERSION}" + eerror "Ebuild tevent version: ${actual_tevent_version}" + die "Ebuild needs to fix TEVENT_VERSION!" + fi +} + +src_prepare() { + default + + check_samba_dep_versions + + # Unbundle dnspython + sed -i -e '/"dns.resolver":/d' "${S}"/third_party/wscript || die + + # Unbundle iso8601 unless tests are enabled + if ! use test ; then + 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 + + # bug #943942 + append-cflags -std=gnu17 + + # WAF + 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 + + # We "use" bundled cmocka when we're not running tests as we're + # not using it anyway. Means we avoid making users install it for + # no reason. bug #802531 + if ! use test ; then + bundled_libs="cmocka,${bundled_libs}" + fi + + # bug #874633 + if use llvm-libunwind ; then + mkdir -p "${T}"/${ABI}/pkgconfig || die + + local -x PKG_CONFIG_PATH="${T}/${ABI}/pkgconfig:${PKG_CONFIG_PATH}" + + cat <<-EOF > "${T}"/${ABI}/pkgconfig/libunwind-generic.pc || die + exec_prefix=\${prefix} + libdir=/usr/$(get_libdir) + includedir=\${prefix}/include + + Name: libunwind-generic + Description: libunwind generic library + Version: 1.70 + Libs: -L\${libdir} -lunwind + Cflags: -I\${includedir} + EOF + fi + + bundled_libs="libquic,${bundled_libs}" + + local 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 + --without-winexe + $(multilib_native_use_with acl acl-support) + $(multilib_native_usex addc '' '--without-ad-dc') + $(multilib_native_use_enable ceph cephfs) + $(multilib_native_use_with cluster cluster-support) + $(multilib_native_use_enable cups) + --without-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 pam) + $(multilib_native_usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '') + $(multilib_native_use_with quota quotas) + $(multilib_native_use_with regedit) + $(multilib_native_use_enable spotlight) + $(multilib_native_use_with syslog) + $(multilib_native_use_with systemd) + --systemd-install-services + --with-systemddir="$(systemd_get_systemunitdir)" + $(multilib_native_use_with unwind libunwind) + $(multilib_native_use_with winbind) + $(multilib_native_usex python '' '--disable-python') + $(multilib_native_use_enable zeroconf avahi) + $(multilib_native_usex test '--enable-selftest' '') + $(usev system-mitkrb5 "--with-system-mitkrb5 $(multilib_native_usex addc --with-experimental-mit-ad-dc '')") + $(use_with ads) + $(use_with debug lttng) + $(use_with ldap) + $(use_with profiling-data) + --private-libraries='!ldb' + $(usex lmdb '' --without-ldb-lmdb) + # bug #683148 + --jobs 1 + ) + + if multilib_is_native_abi ; then + myconf+=( --with-shared-modules=${SHAREDMODS} ) + else + myconf+=( --with-shared-modules=DEFAULT,!vfs_snapper ) + fi + + append-ldflags $(test-flags-CCLD -Wl,--undefined-version) # bug 914898 + + append-cppflags "-I${ESYSROOT}/usr/include/et" + + waf-utils_src_configure ${myconf[@]} +} + +multilib_src_compile() { + waf-utils_src_compile +} + +multilib_src_test() { + if multilib_is_native_abi ; then + "${WAF_BINARY}" test || die "Test failed" + fi +} + +multilib_src_install() { + waf-utils_src_install + + # Make all .so files executable + find "${ED}" -type f -name "*.so" -exec chmod +x {} + || die + # smbspool_krb5_wrapper must only be accessible to root, bug #880739 + find "${ED}" -type f -name "smbspool_krb5_wrapper" -exec chmod go-rwx {} + || die + + # Remove empty runtime dirs created by build system (bug #892341) + find "${ED}"/{run,var} -type d -empty -delete || die + + 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 ../../../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 (bug #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 + + dotmpfiles "${FILESDIR}"/samba.conf + if ! use addc ; then + rm "${D}/$(systemd_get_systemunitdir)/samba.service" \ + || die + fi + + # Preserve functionality for old gentoo-specific unit names + dosym nmb.service "$(systemd_get_systemunitdir)/nmbd.service" + dosym smb.service "$(systemd_get_systemunitdir)/smbd.service" + dosym winbind.service "$(systemd_get_systemunitdir)/winbindd.service" + + use python && python_optimize + fi + + if use pam && use winbind ; then + newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind + # bugs #376853 and #590374 + insinto /etc/security + doins examples/pam_winbind/pam_winbind.conf + fi +} + +pkg_postinst() { + tmpfiles_process samba.conf + + if use addc || use ads ; then + optfeature "Hide passwords from command line when using samba-tool or samba-gpupdate" dev-python/setproctitle + fi +} diff --git a/net-fs/samba/samba-4.23.7.ebuild b/net-fs/samba/samba-4.23.7.ebuild new file mode 100644 index 000000000000..4f18dd5bd505 --- /dev/null +++ b/net-fs/samba/samba-4.23.7.ebuild @@ -0,0 +1,400 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) +PYTHON_REQ_USE="threads(+),xml(+)" +inherit python-single-r1 flag-o-matic waf-utils multilib-minimal linux-info optfeature systemd pam tmpfiles + +DESCRIPTION="Samba Suite Version 4" +HOMEPAGE="https://samba.org/" + +MY_PV="${PV/_rc/rc}" +MY_P="${PN}-${MY_PV}" +if [[ ${PV} == *_rc* ]]; then + SRC_URI="https://download.samba.org/pub/samba/rc/${MY_P}.tar.gz" +else + SRC_URI="https://download.samba.org/pub/samba/stable/${MY_P}.tar.gz" + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86" +fi +S="${WORKDIR}/${MY_P}" + +LICENSE="GPL-3" +SLOT="0/2.11.0" +IUSE="acl addc ads ceph client cluster cups debug fam glusterfs gpg" +IUSE+=" iprint json ldap llvm-libunwind lmdb pam profiling-data python quota" +IUSE+=" +regedit selinux snapper spotlight syslog system-heimdal +system-mitkrb5" +IUSE+=" systemd test unwind winbind zeroconf" + +# ldap needs ads (bug #941578) +REQUIRED_USE="${PYTHON_REQUIRED_USE} + addc? ( json python !system-mitkrb5 winbind ) + ads? ( acl ldap python winbind ) + cluster? ( ads ) + gpg? ( addc ) + ldap? ( ads ) + spotlight? ( json ) + test? ( python ) + !ads? ( !addc ) + ?? ( system-heimdal system-mitkrb5 ) +" + +# 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" + +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 +) + +TALLOC_VERSION="2.4.3" +TDB_VERSION="1.4.14" +TEVENT_VERSION="0.17.1" + +COMMON_DEPEND=" + >=app-arch/libarchive-3.1.2:=[${MULTILIB_USEDEP}] + dev-lang/perl:= + dev-libs/icu:=[${MULTILIB_USEDEP}] + dev-libs/libbsd[${MULTILIB_USEDEP}] + dev-libs/libtasn1:=[${MULTILIB_USEDEP}] + dev-libs/popt[${MULTILIB_USEDEP}] + dev-perl/Parse-Yapp + >=net-libs/gnutls-3.4.7:=[${MULTILIB_USEDEP}] + >=net-libs/ngtcp2-1.12.0[gnutls,${MULTILIB_USEDEP}] + >=sys-fs/e2fsprogs-1.46.4-r51[${MULTILIB_USEDEP}] + !sys-libs/ldb + sys-libs/libcap[${MULTILIB_USEDEP}] + sys-libs/liburing:=[${MULTILIB_USEDEP}] + sys-libs/ncurses:= + sys-libs/readline:= + >=sys-libs/talloc-${TALLOC_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tdb-${TDB_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tevent-${TEVENT_VERSION}[${MULTILIB_USEDEP}] + virtual/zlib:=[${MULTILIB_USEDEP}] + virtual/libcrypt:=[${MULTILIB_USEDEP}] + virtual/libiconv + $(python_gen_cond_dep ' + addc? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ads? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ') + acl? ( virtual/acl ) + ceph? ( sys-cluster/ceph ) + cluster? ( net-libs/rpcsvc-proto ) + cups? ( net-print/cups ) + debug? ( dev-util/lttng-ust ) + fam? ( virtual/fam ) + gpg? ( app-crypt/gpgme:= ) + json? ( dev-libs/jansson:= ) + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] ) + lmdb? ( >=dev-db/lmdb-0.9.16:=[${MULTILIB_USEDEP}] ) + pam? ( sys-libs/pam ) + python? ( + sys-libs/talloc[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tdb[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tevent[python,${PYTHON_SINGLE_USEDEP}] + ) + snapper? ( sys-apps/dbus ) + system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl(-),${MULTILIB_USEDEP}] ) + system-mitkrb5? ( >=app-crypt/mit-krb5-1.19[${MULTILIB_USEDEP}] ) + !system-heimdal? ( !system-mitkrb5? ( sys-apps/keyutils[${MULTILIB_USEDEP}] ) ) + systemd? ( sys-apps/systemd:= ) + unwind? ( + llvm-libunwind? ( llvm-runtimes/libunwind:= ) + !llvm-libunwind? ( sys-libs/libunwind:= ) + ) + zeroconf? ( net-dns/avahi[dbus] ) +" +DEPEND="${COMMON_DEPEND} + dev-perl/JSON + net-libs/libtirpc[${MULTILIB_USEDEP}] + net-libs/rpcsvc-proto + spotlight? ( dev-libs/glib ) + test? ( + >=dev-util/cmocka-1.1.3[${MULTILIB_USEDEP}] + $(python_gen_cond_dep "dev-python/python-subunit[\${PYTHON_USEDEP},${MULTILIB_USEDEP}]" ) + !system-mitkrb5? ( + >=net-dns/resolv_wrapper-1.1.4 + >=net-libs/socket_wrapper-1.1.9 + >=sys-libs/nss_wrapper-1.1.3 + >=sys-libs/uid_wrapper-1.2.1 + ) + )" +RDEPEND="${COMMON_DEPEND} + client? ( net-fs/cifs-utils[ads?] ) + python? ( ${PYTHON_DEPS} ) + selinux? ( sec-policy/selinux-samba ) +" +BDEPEND="${PYTHON_DEPS} + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-4.18.4-pam.patch + "${FILESDIR}"/ldb-2.5.2-skip-wav-tevent-check.patch +) + +CONFDIR="${FILESDIR}/4.4" +WAF_BINARY="${S}/buildtools/bin/waf" +SHAREDMODS="" + +pkg_setup() { + # Package fails to build with distcc + export DISTCC_DISABLE=1 + export PYTHONHASHSEED=1 + + python-single-r1_pkg_setup + + SHAREDMODS="$(usev !snapper '!')vfs_snapper" + if use cluster ; then + SHAREDMODS+=",idmap_rid,idmap_tdb2,idmap_ad" + elif use ads ; then + SHAREDMODS+=",idmap_ad" + fi +} + +check_samba_dep_versions() { + actual_talloc_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/talloc/wscript || die) + if [[ ${actual_talloc_version} != ${TALLOC_VERSION} ]] ; then + eerror "Source talloc version: ${TALLOC_VERSION}" + eerror "Ebuild talloc version: ${actual_talloc_version}" + die "Ebuild needs to fix TALLOC_VERSION!" + fi + + actual_tdb_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tdb/wscript || die) + if [[ ${actual_tdb_version} != ${TDB_VERSION} ]] ; then + eerror "Source tdb version: ${TDB_VERSION}" + eerror "Ebuild tdb version: ${actual_tdb_version}" + die "Ebuild needs to fix TDB_VERSION!" + fi + + actual_tevent_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tevent/wscript || die) + if [[ ${actual_tevent_version} != ${TEVENT_VERSION} ]] ; then + eerror "Source tevent version: ${TEVENT_VERSION}" + eerror "Ebuild tevent version: ${actual_tevent_version}" + die "Ebuild needs to fix TEVENT_VERSION!" + fi +} + +src_prepare() { + default + + check_samba_dep_versions + + # Unbundle dnspython + sed -i -e '/"dns.resolver":/d' "${S}"/third_party/wscript || die + + # Unbundle iso8601 unless tests are enabled + if ! use test ; then + 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 + + # bug #943942 + append-cflags -std=gnu17 + + # WAF + 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 + + # We "use" bundled cmocka when we're not running tests as we're + # not using it anyway. Means we avoid making users install it for + # no reason. bug #802531 + if ! use test ; then + bundled_libs="cmocka,${bundled_libs}" + fi + + # bug #874633 + if use llvm-libunwind ; then + mkdir -p "${T}"/${ABI}/pkgconfig || die + + local -x PKG_CONFIG_PATH="${T}/${ABI}/pkgconfig:${PKG_CONFIG_PATH}" + + cat <<-EOF > "${T}"/${ABI}/pkgconfig/libunwind-generic.pc || die + exec_prefix=\${prefix} + libdir=/usr/$(get_libdir) + includedir=\${prefix}/include + + Name: libunwind-generic + Description: libunwind generic library + Version: 1.70 + Libs: -L\${libdir} -lunwind + Cflags: -I\${includedir} + EOF + fi + + bundled_libs="libquic,${bundled_libs}" + + local 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 + --without-winexe + $(multilib_native_use_with acl acl-support) + $(multilib_native_usex addc '' '--without-ad-dc') + $(multilib_native_use_enable ceph cephfs) + $(multilib_native_use_with cluster cluster-support) + $(multilib_native_use_enable cups) + --without-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 pam) + $(multilib_native_usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '') + $(multilib_native_use_with quota quotas) + $(multilib_native_use_with regedit) + $(multilib_native_use_enable spotlight) + $(multilib_native_use_with syslog) + $(multilib_native_use_with systemd) + --systemd-install-services + --with-systemddir="$(systemd_get_systemunitdir)" + $(multilib_native_use_with unwind libunwind) + $(multilib_native_use_with winbind) + $(multilib_native_usex python '' '--disable-python') + $(multilib_native_use_enable zeroconf avahi) + $(multilib_native_usex test '--enable-selftest' '') + $(usev system-mitkrb5 "--with-system-mitkrb5 $(multilib_native_usex addc --with-experimental-mit-ad-dc '')") + $(use_with ads) + $(use_with debug lttng) + $(use_with ldap) + $(use_with profiling-data) + --private-libraries='!ldb' + $(usex lmdb '' --without-ldb-lmdb) + # bug #683148 + --jobs 1 + ) + + if multilib_is_native_abi ; then + myconf+=( --with-shared-modules=${SHAREDMODS} ) + else + myconf+=( --with-shared-modules=DEFAULT,!vfs_snapper ) + fi + + append-ldflags $(test-flags-CCLD -Wl,--undefined-version) # bug 914898 + + append-cppflags "-I${ESYSROOT}/usr/include/et" + + waf-utils_src_configure ${myconf[@]} +} + +multilib_src_compile() { + waf-utils_src_compile +} + +multilib_src_test() { + if multilib_is_native_abi ; then + "${WAF_BINARY}" test || die "Test failed" + fi +} + +multilib_src_install() { + waf-utils_src_install + + # Make all .so files executable + find "${ED}" -type f -name "*.so" -exec chmod +x {} + || die + # smbspool_krb5_wrapper must only be accessible to root, bug #880739 + find "${ED}" -type f -name "smbspool_krb5_wrapper" -exec chmod go-rwx {} + || die + + # Remove empty runtime dirs created by build system (bug #892341) + find "${ED}"/{run,var} -type d -empty -delete || die + + 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 ../../../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 (bug #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 + + dotmpfiles "${FILESDIR}"/samba.conf + if ! use addc ; then + rm "${D}/$(systemd_get_systemunitdir)/samba.service" \ + || die + fi + + # Preserve functionality for old gentoo-specific unit names + dosym nmb.service "$(systemd_get_systemunitdir)/nmbd.service" + dosym smb.service "$(systemd_get_systemunitdir)/smbd.service" + dosym winbind.service "$(systemd_get_systemunitdir)/winbindd.service" + + use python && python_optimize + fi + + if use pam && use winbind ; then + newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind + # bugs #376853 and #590374 + insinto /etc/security + doins examples/pam_winbind/pam_winbind.conf + fi +} + +pkg_postinst() { + tmpfiles_process samba.conf + + if use addc || use ads ; then + optfeature "Hide passwords from command line when using samba-tool or samba-gpupdate" dev-python/setproctitle + fi +} diff --git a/net-fs/samba/samba-4.23.8.ebuild b/net-fs/samba/samba-4.23.8.ebuild new file mode 100644 index 000000000000..4f18dd5bd505 --- /dev/null +++ b/net-fs/samba/samba-4.23.8.ebuild @@ -0,0 +1,400 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) +PYTHON_REQ_USE="threads(+),xml(+)" +inherit python-single-r1 flag-o-matic waf-utils multilib-minimal linux-info optfeature systemd pam tmpfiles + +DESCRIPTION="Samba Suite Version 4" +HOMEPAGE="https://samba.org/" + +MY_PV="${PV/_rc/rc}" +MY_P="${PN}-${MY_PV}" +if [[ ${PV} == *_rc* ]]; then + SRC_URI="https://download.samba.org/pub/samba/rc/${MY_P}.tar.gz" +else + SRC_URI="https://download.samba.org/pub/samba/stable/${MY_P}.tar.gz" + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86" +fi +S="${WORKDIR}/${MY_P}" + +LICENSE="GPL-3" +SLOT="0/2.11.0" +IUSE="acl addc ads ceph client cluster cups debug fam glusterfs gpg" +IUSE+=" iprint json ldap llvm-libunwind lmdb pam profiling-data python quota" +IUSE+=" +regedit selinux snapper spotlight syslog system-heimdal +system-mitkrb5" +IUSE+=" systemd test unwind winbind zeroconf" + +# ldap needs ads (bug #941578) +REQUIRED_USE="${PYTHON_REQUIRED_USE} + addc? ( json python !system-mitkrb5 winbind ) + ads? ( acl ldap python winbind ) + cluster? ( ads ) + gpg? ( addc ) + ldap? ( ads ) + spotlight? ( json ) + test? ( python ) + !ads? ( !addc ) + ?? ( system-heimdal system-mitkrb5 ) +" + +# 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" + +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 +) + +TALLOC_VERSION="2.4.3" +TDB_VERSION="1.4.14" +TEVENT_VERSION="0.17.1" + +COMMON_DEPEND=" + >=app-arch/libarchive-3.1.2:=[${MULTILIB_USEDEP}] + dev-lang/perl:= + dev-libs/icu:=[${MULTILIB_USEDEP}] + dev-libs/libbsd[${MULTILIB_USEDEP}] + dev-libs/libtasn1:=[${MULTILIB_USEDEP}] + dev-libs/popt[${MULTILIB_USEDEP}] + dev-perl/Parse-Yapp + >=net-libs/gnutls-3.4.7:=[${MULTILIB_USEDEP}] + >=net-libs/ngtcp2-1.12.0[gnutls,${MULTILIB_USEDEP}] + >=sys-fs/e2fsprogs-1.46.4-r51[${MULTILIB_USEDEP}] + !sys-libs/ldb + sys-libs/libcap[${MULTILIB_USEDEP}] + sys-libs/liburing:=[${MULTILIB_USEDEP}] + sys-libs/ncurses:= + sys-libs/readline:= + >=sys-libs/talloc-${TALLOC_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tdb-${TDB_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tevent-${TEVENT_VERSION}[${MULTILIB_USEDEP}] + virtual/zlib:=[${MULTILIB_USEDEP}] + virtual/libcrypt:=[${MULTILIB_USEDEP}] + virtual/libiconv + $(python_gen_cond_dep ' + addc? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ads? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ') + acl? ( virtual/acl ) + ceph? ( sys-cluster/ceph ) + cluster? ( net-libs/rpcsvc-proto ) + cups? ( net-print/cups ) + debug? ( dev-util/lttng-ust ) + fam? ( virtual/fam ) + gpg? ( app-crypt/gpgme:= ) + json? ( dev-libs/jansson:= ) + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] ) + lmdb? ( >=dev-db/lmdb-0.9.16:=[${MULTILIB_USEDEP}] ) + pam? ( sys-libs/pam ) + python? ( + sys-libs/talloc[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tdb[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tevent[python,${PYTHON_SINGLE_USEDEP}] + ) + snapper? ( sys-apps/dbus ) + system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl(-),${MULTILIB_USEDEP}] ) + system-mitkrb5? ( >=app-crypt/mit-krb5-1.19[${MULTILIB_USEDEP}] ) + !system-heimdal? ( !system-mitkrb5? ( sys-apps/keyutils[${MULTILIB_USEDEP}] ) ) + systemd? ( sys-apps/systemd:= ) + unwind? ( + llvm-libunwind? ( llvm-runtimes/libunwind:= ) + !llvm-libunwind? ( sys-libs/libunwind:= ) + ) + zeroconf? ( net-dns/avahi[dbus] ) +" +DEPEND="${COMMON_DEPEND} + dev-perl/JSON + net-libs/libtirpc[${MULTILIB_USEDEP}] + net-libs/rpcsvc-proto + spotlight? ( dev-libs/glib ) + test? ( + >=dev-util/cmocka-1.1.3[${MULTILIB_USEDEP}] + $(python_gen_cond_dep "dev-python/python-subunit[\${PYTHON_USEDEP},${MULTILIB_USEDEP}]" ) + !system-mitkrb5? ( + >=net-dns/resolv_wrapper-1.1.4 + >=net-libs/socket_wrapper-1.1.9 + >=sys-libs/nss_wrapper-1.1.3 + >=sys-libs/uid_wrapper-1.2.1 + ) + )" +RDEPEND="${COMMON_DEPEND} + client? ( net-fs/cifs-utils[ads?] ) + python? ( ${PYTHON_DEPS} ) + selinux? ( sec-policy/selinux-samba ) +" +BDEPEND="${PYTHON_DEPS} + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-4.18.4-pam.patch + "${FILESDIR}"/ldb-2.5.2-skip-wav-tevent-check.patch +) + +CONFDIR="${FILESDIR}/4.4" +WAF_BINARY="${S}/buildtools/bin/waf" +SHAREDMODS="" + +pkg_setup() { + # Package fails to build with distcc + export DISTCC_DISABLE=1 + export PYTHONHASHSEED=1 + + python-single-r1_pkg_setup + + SHAREDMODS="$(usev !snapper '!')vfs_snapper" + if use cluster ; then + SHAREDMODS+=",idmap_rid,idmap_tdb2,idmap_ad" + elif use ads ; then + SHAREDMODS+=",idmap_ad" + fi +} + +check_samba_dep_versions() { + actual_talloc_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/talloc/wscript || die) + if [[ ${actual_talloc_version} != ${TALLOC_VERSION} ]] ; then + eerror "Source talloc version: ${TALLOC_VERSION}" + eerror "Ebuild talloc version: ${actual_talloc_version}" + die "Ebuild needs to fix TALLOC_VERSION!" + fi + + actual_tdb_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tdb/wscript || die) + if [[ ${actual_tdb_version} != ${TDB_VERSION} ]] ; then + eerror "Source tdb version: ${TDB_VERSION}" + eerror "Ebuild tdb version: ${actual_tdb_version}" + die "Ebuild needs to fix TDB_VERSION!" + fi + + actual_tevent_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tevent/wscript || die) + if [[ ${actual_tevent_version} != ${TEVENT_VERSION} ]] ; then + eerror "Source tevent version: ${TEVENT_VERSION}" + eerror "Ebuild tevent version: ${actual_tevent_version}" + die "Ebuild needs to fix TEVENT_VERSION!" + fi +} + +src_prepare() { + default + + check_samba_dep_versions + + # Unbundle dnspython + sed -i -e '/"dns.resolver":/d' "${S}"/third_party/wscript || die + + # Unbundle iso8601 unless tests are enabled + if ! use test ; then + 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 + + # bug #943942 + append-cflags -std=gnu17 + + # WAF + 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 + + # We "use" bundled cmocka when we're not running tests as we're + # not using it anyway. Means we avoid making users install it for + # no reason. bug #802531 + if ! use test ; then + bundled_libs="cmocka,${bundled_libs}" + fi + + # bug #874633 + if use llvm-libunwind ; then + mkdir -p "${T}"/${ABI}/pkgconfig || die + + local -x PKG_CONFIG_PATH="${T}/${ABI}/pkgconfig:${PKG_CONFIG_PATH}" + + cat <<-EOF > "${T}"/${ABI}/pkgconfig/libunwind-generic.pc || die + exec_prefix=\${prefix} + libdir=/usr/$(get_libdir) + includedir=\${prefix}/include + + Name: libunwind-generic + Description: libunwind generic library + Version: 1.70 + Libs: -L\${libdir} -lunwind + Cflags: -I\${includedir} + EOF + fi + + bundled_libs="libquic,${bundled_libs}" + + local 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 + --without-winexe + $(multilib_native_use_with acl acl-support) + $(multilib_native_usex addc '' '--without-ad-dc') + $(multilib_native_use_enable ceph cephfs) + $(multilib_native_use_with cluster cluster-support) + $(multilib_native_use_enable cups) + --without-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 pam) + $(multilib_native_usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '') + $(multilib_native_use_with quota quotas) + $(multilib_native_use_with regedit) + $(multilib_native_use_enable spotlight) + $(multilib_native_use_with syslog) + $(multilib_native_use_with systemd) + --systemd-install-services + --with-systemddir="$(systemd_get_systemunitdir)" + $(multilib_native_use_with unwind libunwind) + $(multilib_native_use_with winbind) + $(multilib_native_usex python '' '--disable-python') + $(multilib_native_use_enable zeroconf avahi) + $(multilib_native_usex test '--enable-selftest' '') + $(usev system-mitkrb5 "--with-system-mitkrb5 $(multilib_native_usex addc --with-experimental-mit-ad-dc '')") + $(use_with ads) + $(use_with debug lttng) + $(use_with ldap) + $(use_with profiling-data) + --private-libraries='!ldb' + $(usex lmdb '' --without-ldb-lmdb) + # bug #683148 + --jobs 1 + ) + + if multilib_is_native_abi ; then + myconf+=( --with-shared-modules=${SHAREDMODS} ) + else + myconf+=( --with-shared-modules=DEFAULT,!vfs_snapper ) + fi + + append-ldflags $(test-flags-CCLD -Wl,--undefined-version) # bug 914898 + + append-cppflags "-I${ESYSROOT}/usr/include/et" + + waf-utils_src_configure ${myconf[@]} +} + +multilib_src_compile() { + waf-utils_src_compile +} + +multilib_src_test() { + if multilib_is_native_abi ; then + "${WAF_BINARY}" test || die "Test failed" + fi +} + +multilib_src_install() { + waf-utils_src_install + + # Make all .so files executable + find "${ED}" -type f -name "*.so" -exec chmod +x {} + || die + # smbspool_krb5_wrapper must only be accessible to root, bug #880739 + find "${ED}" -type f -name "smbspool_krb5_wrapper" -exec chmod go-rwx {} + || die + + # Remove empty runtime dirs created by build system (bug #892341) + find "${ED}"/{run,var} -type d -empty -delete || die + + 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 ../../../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 (bug #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 + + dotmpfiles "${FILESDIR}"/samba.conf + if ! use addc ; then + rm "${D}/$(systemd_get_systemunitdir)/samba.service" \ + || die + fi + + # Preserve functionality for old gentoo-specific unit names + dosym nmb.service "$(systemd_get_systemunitdir)/nmbd.service" + dosym smb.service "$(systemd_get_systemunitdir)/smbd.service" + dosym winbind.service "$(systemd_get_systemunitdir)/winbindd.service" + + use python && python_optimize + fi + + if use pam && use winbind ; then + newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind + # bugs #376853 and #590374 + insinto /etc/security + doins examples/pam_winbind/pam_winbind.conf + fi +} + +pkg_postinst() { + tmpfiles_process samba.conf + + if use addc || use ads ; then + optfeature "Hide passwords from command line when using samba-tool or samba-gpupdate" dev-python/setproctitle + fi +} diff --git a/net-fs/samba/samba-4.24.1.ebuild b/net-fs/samba/samba-4.24.1.ebuild new file mode 100644 index 000000000000..0a56b5c9d029 --- /dev/null +++ b/net-fs/samba/samba-4.24.1.ebuild @@ -0,0 +1,400 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) +PYTHON_REQ_USE="threads(+),xml(+)" +inherit python-single-r1 flag-o-matic waf-utils multilib-minimal linux-info optfeature systemd pam tmpfiles + +DESCRIPTION="Samba Suite Version 4" +HOMEPAGE="https://samba.org/" + +MY_PV="${PV/_rc/rc}" +MY_P="${PN}-${MY_PV}" +if [[ ${PV} == *_rc* ]]; then + SRC_URI="https://download.samba.org/pub/samba/rc/${MY_P}.tar.gz" +else + SRC_URI="https://download.samba.org/pub/samba/stable/${MY_P}.tar.gz" + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86" +fi +S="${WORKDIR}/${MY_P}" + +LICENSE="GPL-3" +SLOT="0/2.11.0" +IUSE="acl addc ads ceph client cluster cups debug fam glusterfs gpg" +IUSE+=" iprint json ldap llvm-libunwind lmdb pam profiling-data python quota" +IUSE+=" +regedit selinux snapper spotlight syslog system-heimdal +system-mitkrb5" +IUSE+=" systemd test unwind winbind zeroconf" + +# ldap needs ads (bug #941578) +REQUIRED_USE="${PYTHON_REQUIRED_USE} + addc? ( json python !system-mitkrb5 winbind ) + ads? ( acl ldap python winbind ) + cluster? ( ads ) + gpg? ( addc ) + ldap? ( ads ) + spotlight? ( json ) + test? ( python ) + !ads? ( !addc ) + ?? ( system-heimdal system-mitkrb5 ) +" + +# 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" + +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 +) + +TALLOC_VERSION="2.4.4" +TDB_VERSION="1.4.15" +TEVENT_VERSION="0.17.1" + +COMMON_DEPEND=" + >=app-arch/libarchive-3.1.2:=[${MULTILIB_USEDEP}] + dev-lang/perl:= + dev-libs/icu:=[${MULTILIB_USEDEP}] + dev-libs/libbsd[${MULTILIB_USEDEP}] + dev-libs/libtasn1:=[${MULTILIB_USEDEP}] + dev-libs/popt[${MULTILIB_USEDEP}] + dev-perl/Parse-Yapp + >=net-libs/gnutls-3.4.7:=[${MULTILIB_USEDEP}] + >=net-libs/ngtcp2-1.12.0[gnutls,${MULTILIB_USEDEP}] + >=sys-fs/e2fsprogs-1.46.4-r51[${MULTILIB_USEDEP}] + !sys-libs/ldb + sys-libs/libcap[${MULTILIB_USEDEP}] + sys-libs/liburing:=[${MULTILIB_USEDEP}] + sys-libs/ncurses:= + sys-libs/readline:= + >=sys-libs/talloc-${TALLOC_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tdb-${TDB_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tevent-${TEVENT_VERSION}[${MULTILIB_USEDEP}] + virtual/zlib:=[${MULTILIB_USEDEP}] + virtual/libcrypt:=[${MULTILIB_USEDEP}] + virtual/libiconv + $(python_gen_cond_dep ' + addc? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ads? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ') + acl? ( virtual/acl ) + ceph? ( sys-cluster/ceph ) + cluster? ( net-libs/rpcsvc-proto ) + cups? ( net-print/cups ) + debug? ( dev-util/lttng-ust ) + fam? ( virtual/fam ) + gpg? ( app-crypt/gpgme:= ) + json? ( dev-libs/jansson:= ) + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] ) + lmdb? ( >=dev-db/lmdb-0.9.16:=[${MULTILIB_USEDEP}] ) + pam? ( sys-libs/pam ) + python? ( + sys-libs/talloc[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tdb[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tevent[python,${PYTHON_SINGLE_USEDEP}] + ) + snapper? ( sys-apps/dbus ) + system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl(-),${MULTILIB_USEDEP}] ) + system-mitkrb5? ( >=app-crypt/mit-krb5-1.19[${MULTILIB_USEDEP}] ) + !system-heimdal? ( !system-mitkrb5? ( sys-apps/keyutils[${MULTILIB_USEDEP}] ) ) + systemd? ( sys-apps/systemd:= ) + unwind? ( + llvm-libunwind? ( llvm-runtimes/libunwind:= ) + !llvm-libunwind? ( sys-libs/libunwind:= ) + ) + zeroconf? ( net-dns/avahi[dbus] ) +" +DEPEND="${COMMON_DEPEND} + dev-perl/JSON + net-libs/libtirpc[${MULTILIB_USEDEP}] + net-libs/rpcsvc-proto + spotlight? ( dev-libs/glib ) + test? ( + >=dev-util/cmocka-1.1.3[${MULTILIB_USEDEP}] + $(python_gen_cond_dep "dev-python/python-subunit[\${PYTHON_USEDEP},${MULTILIB_USEDEP}]" ) + !system-mitkrb5? ( + >=net-dns/resolv_wrapper-1.1.4 + >=net-libs/socket_wrapper-1.1.9 + >=sys-libs/nss_wrapper-1.1.3 + >=sys-libs/uid_wrapper-1.2.1 + ) + )" +RDEPEND="${COMMON_DEPEND} + client? ( net-fs/cifs-utils[ads?] ) + python? ( ${PYTHON_DEPS} ) + selinux? ( sec-policy/selinux-samba ) +" +BDEPEND="${PYTHON_DEPS} + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-4.18.4-pam.patch + "${FILESDIR}"/ldb-2.5.2-skip-wav-tevent-check.patch +) + +CONFDIR="${FILESDIR}/4.4" +WAF_BINARY="${S}/buildtools/bin/waf" +SHAREDMODS="" + +pkg_setup() { + # Package fails to build with distcc + export DISTCC_DISABLE=1 + export PYTHONHASHSEED=1 + + python-single-r1_pkg_setup + + SHAREDMODS="$(usev !snapper '!')vfs_snapper" + if use cluster ; then + SHAREDMODS+=",idmap_rid,idmap_tdb2,idmap_ad" + elif use ads ; then + SHAREDMODS+=",idmap_ad" + fi +} + +check_samba_dep_versions() { + actual_talloc_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/talloc/wscript || die) + if [[ ${actual_talloc_version} != ${TALLOC_VERSION} ]] ; then + eerror "Source talloc version: ${TALLOC_VERSION}" + eerror "Ebuild talloc version: ${actual_talloc_version}" + die "Ebuild needs to fix TALLOC_VERSION!" + fi + + actual_tdb_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tdb/wscript || die) + if [[ ${actual_tdb_version} != ${TDB_VERSION} ]] ; then + eerror "Source tdb version: ${TDB_VERSION}" + eerror "Ebuild tdb version: ${actual_tdb_version}" + die "Ebuild needs to fix TDB_VERSION!" + fi + + actual_tevent_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tevent/wscript || die) + if [[ ${actual_tevent_version} != ${TEVENT_VERSION} ]] ; then + eerror "Source tevent version: ${TEVENT_VERSION}" + eerror "Ebuild tevent version: ${actual_tevent_version}" + die "Ebuild needs to fix TEVENT_VERSION!" + fi +} + +src_prepare() { + default + + check_samba_dep_versions + + # Unbundle dnspython + sed -i -e '/"dns.resolver":/d' "${S}"/third_party/wscript || die + + # Unbundle iso8601 unless tests are enabled + if ! use test ; then + 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 + + # bug #943942 + append-cflags -std=gnu17 + + # WAF + 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 + + # We "use" bundled cmocka when we're not running tests as we're + # not using it anyway. Means we avoid making users install it for + # no reason. bug #802531 + if ! use test ; then + bundled_libs="cmocka,${bundled_libs}" + fi + + # bug #874633 + if use llvm-libunwind ; then + mkdir -p "${T}"/${ABI}/pkgconfig || die + + local -x PKG_CONFIG_PATH="${T}/${ABI}/pkgconfig:${PKG_CONFIG_PATH}" + + cat <<-EOF > "${T}"/${ABI}/pkgconfig/libunwind-generic.pc || die + exec_prefix=\${prefix} + libdir=/usr/$(get_libdir) + includedir=\${prefix}/include + + Name: libunwind-generic + Description: libunwind generic library + Version: 1.70 + Libs: -L\${libdir} -lunwind + Cflags: -I\${includedir} + EOF + fi + + bundled_libs="libquic,${bundled_libs}" + + local 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 + --without-winexe + $(multilib_native_use_with acl acl-support) + $(multilib_native_usex addc '' '--without-ad-dc') + $(multilib_native_use_enable ceph cephfs) + $(multilib_native_use_with cluster cluster-support) + $(multilib_native_use_enable cups) + --without-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 pam) + $(multilib_native_usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '') + $(multilib_native_use_with quota quotas) + $(multilib_native_use_with regedit) + $(multilib_native_use_enable spotlight) + $(multilib_native_use_with syslog) + $(multilib_native_use_with systemd) + --systemd-install-services + --with-systemddir="$(systemd_get_systemunitdir)" + $(multilib_native_use_with unwind libunwind) + $(multilib_native_use_with winbind) + $(multilib_native_usex python '' '--disable-python') + $(multilib_native_use_enable zeroconf avahi) + $(multilib_native_usex test '--enable-selftest' '') + $(usev system-mitkrb5 "--with-system-mitkrb5 $(multilib_native_usex addc --with-experimental-mit-ad-dc '')") + $(use_with ads) + $(use_with debug lttng) + $(use_with ldap) + $(use_with profiling-data) + --private-libraries='!ldb' + $(usex lmdb '' --without-ldb-lmdb) + # bug #683148 + --jobs 1 + ) + + if multilib_is_native_abi ; then + myconf+=( --with-shared-modules=${SHAREDMODS} ) + else + myconf+=( --with-shared-modules=DEFAULT,!vfs_snapper ) + fi + + append-ldflags $(test-flags-CCLD -Wl,--undefined-version) # bug 914898 + + append-cppflags "-I${ESYSROOT}/usr/include/et" + + waf-utils_src_configure ${myconf[@]} +} + +multilib_src_compile() { + waf-utils_src_compile +} + +multilib_src_test() { + if multilib_is_native_abi ; then + "${WAF_BINARY}" test || die "Test failed" + fi +} + +multilib_src_install() { + waf-utils_src_install + + # Make all .so files executable + find "${ED}" -type f -name "*.so" -exec chmod +x {} + || die + # smbspool_krb5_wrapper must only be accessible to root, bug #880739 + find "${ED}" -type f -name "smbspool_krb5_wrapper" -exec chmod go-rwx {} + || die + + # Remove empty runtime dirs created by build system (bug #892341) + find "${ED}"/{run,var} -type d -empty -delete || die + + 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 ../../../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 (bug #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 + + dotmpfiles "${FILESDIR}"/samba.conf + if ! use addc ; then + rm "${D}/$(systemd_get_systemunitdir)/samba.service" \ + || die + fi + + # Preserve functionality for old gentoo-specific unit names + dosym nmb.service "$(systemd_get_systemunitdir)/nmbd.service" + dosym smb.service "$(systemd_get_systemunitdir)/smbd.service" + dosym winbind.service "$(systemd_get_systemunitdir)/winbindd.service" + + use python && python_optimize + fi + + if use pam && use winbind ; then + newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind + # bugs #376853 and #590374 + insinto /etc/security + doins examples/pam_winbind/pam_winbind.conf + fi +} + +pkg_postinst() { + tmpfiles_process samba.conf + + if use addc || use ads ; then + optfeature "Hide passwords from command line when using samba-tool or samba-gpupdate" dev-python/setproctitle + fi +} diff --git a/net-fs/samba/samba-4.24.2.ebuild b/net-fs/samba/samba-4.24.2.ebuild new file mode 100644 index 000000000000..0a56b5c9d029 --- /dev/null +++ b/net-fs/samba/samba-4.24.2.ebuild @@ -0,0 +1,400 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) +PYTHON_REQ_USE="threads(+),xml(+)" +inherit python-single-r1 flag-o-matic waf-utils multilib-minimal linux-info optfeature systemd pam tmpfiles + +DESCRIPTION="Samba Suite Version 4" +HOMEPAGE="https://samba.org/" + +MY_PV="${PV/_rc/rc}" +MY_P="${PN}-${MY_PV}" +if [[ ${PV} == *_rc* ]]; then + SRC_URI="https://download.samba.org/pub/samba/rc/${MY_P}.tar.gz" +else + SRC_URI="https://download.samba.org/pub/samba/stable/${MY_P}.tar.gz" + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86" +fi +S="${WORKDIR}/${MY_P}" + +LICENSE="GPL-3" +SLOT="0/2.11.0" +IUSE="acl addc ads ceph client cluster cups debug fam glusterfs gpg" +IUSE+=" iprint json ldap llvm-libunwind lmdb pam profiling-data python quota" +IUSE+=" +regedit selinux snapper spotlight syslog system-heimdal +system-mitkrb5" +IUSE+=" systemd test unwind winbind zeroconf" + +# ldap needs ads (bug #941578) +REQUIRED_USE="${PYTHON_REQUIRED_USE} + addc? ( json python !system-mitkrb5 winbind ) + ads? ( acl ldap python winbind ) + cluster? ( ads ) + gpg? ( addc ) + ldap? ( ads ) + spotlight? ( json ) + test? ( python ) + !ads? ( !addc ) + ?? ( system-heimdal system-mitkrb5 ) +" + +# 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" + +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 +) + +TALLOC_VERSION="2.4.4" +TDB_VERSION="1.4.15" +TEVENT_VERSION="0.17.1" + +COMMON_DEPEND=" + >=app-arch/libarchive-3.1.2:=[${MULTILIB_USEDEP}] + dev-lang/perl:= + dev-libs/icu:=[${MULTILIB_USEDEP}] + dev-libs/libbsd[${MULTILIB_USEDEP}] + dev-libs/libtasn1:=[${MULTILIB_USEDEP}] + dev-libs/popt[${MULTILIB_USEDEP}] + dev-perl/Parse-Yapp + >=net-libs/gnutls-3.4.7:=[${MULTILIB_USEDEP}] + >=net-libs/ngtcp2-1.12.0[gnutls,${MULTILIB_USEDEP}] + >=sys-fs/e2fsprogs-1.46.4-r51[${MULTILIB_USEDEP}] + !sys-libs/ldb + sys-libs/libcap[${MULTILIB_USEDEP}] + sys-libs/liburing:=[${MULTILIB_USEDEP}] + sys-libs/ncurses:= + sys-libs/readline:= + >=sys-libs/talloc-${TALLOC_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tdb-${TDB_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tevent-${TEVENT_VERSION}[${MULTILIB_USEDEP}] + virtual/zlib:=[${MULTILIB_USEDEP}] + virtual/libcrypt:=[${MULTILIB_USEDEP}] + virtual/libiconv + $(python_gen_cond_dep ' + addc? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ads? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ') + acl? ( virtual/acl ) + ceph? ( sys-cluster/ceph ) + cluster? ( net-libs/rpcsvc-proto ) + cups? ( net-print/cups ) + debug? ( dev-util/lttng-ust ) + fam? ( virtual/fam ) + gpg? ( app-crypt/gpgme:= ) + json? ( dev-libs/jansson:= ) + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] ) + lmdb? ( >=dev-db/lmdb-0.9.16:=[${MULTILIB_USEDEP}] ) + pam? ( sys-libs/pam ) + python? ( + sys-libs/talloc[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tdb[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tevent[python,${PYTHON_SINGLE_USEDEP}] + ) + snapper? ( sys-apps/dbus ) + system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl(-),${MULTILIB_USEDEP}] ) + system-mitkrb5? ( >=app-crypt/mit-krb5-1.19[${MULTILIB_USEDEP}] ) + !system-heimdal? ( !system-mitkrb5? ( sys-apps/keyutils[${MULTILIB_USEDEP}] ) ) + systemd? ( sys-apps/systemd:= ) + unwind? ( + llvm-libunwind? ( llvm-runtimes/libunwind:= ) + !llvm-libunwind? ( sys-libs/libunwind:= ) + ) + zeroconf? ( net-dns/avahi[dbus] ) +" +DEPEND="${COMMON_DEPEND} + dev-perl/JSON + net-libs/libtirpc[${MULTILIB_USEDEP}] + net-libs/rpcsvc-proto + spotlight? ( dev-libs/glib ) + test? ( + >=dev-util/cmocka-1.1.3[${MULTILIB_USEDEP}] + $(python_gen_cond_dep "dev-python/python-subunit[\${PYTHON_USEDEP},${MULTILIB_USEDEP}]" ) + !system-mitkrb5? ( + >=net-dns/resolv_wrapper-1.1.4 + >=net-libs/socket_wrapper-1.1.9 + >=sys-libs/nss_wrapper-1.1.3 + >=sys-libs/uid_wrapper-1.2.1 + ) + )" +RDEPEND="${COMMON_DEPEND} + client? ( net-fs/cifs-utils[ads?] ) + python? ( ${PYTHON_DEPS} ) + selinux? ( sec-policy/selinux-samba ) +" +BDEPEND="${PYTHON_DEPS} + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-4.18.4-pam.patch + "${FILESDIR}"/ldb-2.5.2-skip-wav-tevent-check.patch +) + +CONFDIR="${FILESDIR}/4.4" +WAF_BINARY="${S}/buildtools/bin/waf" +SHAREDMODS="" + +pkg_setup() { + # Package fails to build with distcc + export DISTCC_DISABLE=1 + export PYTHONHASHSEED=1 + + python-single-r1_pkg_setup + + SHAREDMODS="$(usev !snapper '!')vfs_snapper" + if use cluster ; then + SHAREDMODS+=",idmap_rid,idmap_tdb2,idmap_ad" + elif use ads ; then + SHAREDMODS+=",idmap_ad" + fi +} + +check_samba_dep_versions() { + actual_talloc_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/talloc/wscript || die) + if [[ ${actual_talloc_version} != ${TALLOC_VERSION} ]] ; then + eerror "Source talloc version: ${TALLOC_VERSION}" + eerror "Ebuild talloc version: ${actual_talloc_version}" + die "Ebuild needs to fix TALLOC_VERSION!" + fi + + actual_tdb_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tdb/wscript || die) + if [[ ${actual_tdb_version} != ${TDB_VERSION} ]] ; then + eerror "Source tdb version: ${TDB_VERSION}" + eerror "Ebuild tdb version: ${actual_tdb_version}" + die "Ebuild needs to fix TDB_VERSION!" + fi + + actual_tevent_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tevent/wscript || die) + if [[ ${actual_tevent_version} != ${TEVENT_VERSION} ]] ; then + eerror "Source tevent version: ${TEVENT_VERSION}" + eerror "Ebuild tevent version: ${actual_tevent_version}" + die "Ebuild needs to fix TEVENT_VERSION!" + fi +} + +src_prepare() { + default + + check_samba_dep_versions + + # Unbundle dnspython + sed -i -e '/"dns.resolver":/d' "${S}"/third_party/wscript || die + + # Unbundle iso8601 unless tests are enabled + if ! use test ; then + 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 + + # bug #943942 + append-cflags -std=gnu17 + + # WAF + 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 + + # We "use" bundled cmocka when we're not running tests as we're + # not using it anyway. Means we avoid making users install it for + # no reason. bug #802531 + if ! use test ; then + bundled_libs="cmocka,${bundled_libs}" + fi + + # bug #874633 + if use llvm-libunwind ; then + mkdir -p "${T}"/${ABI}/pkgconfig || die + + local -x PKG_CONFIG_PATH="${T}/${ABI}/pkgconfig:${PKG_CONFIG_PATH}" + + cat <<-EOF > "${T}"/${ABI}/pkgconfig/libunwind-generic.pc || die + exec_prefix=\${prefix} + libdir=/usr/$(get_libdir) + includedir=\${prefix}/include + + Name: libunwind-generic + Description: libunwind generic library + Version: 1.70 + Libs: -L\${libdir} -lunwind + Cflags: -I\${includedir} + EOF + fi + + bundled_libs="libquic,${bundled_libs}" + + local 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 + --without-winexe + $(multilib_native_use_with acl acl-support) + $(multilib_native_usex addc '' '--without-ad-dc') + $(multilib_native_use_enable ceph cephfs) + $(multilib_native_use_with cluster cluster-support) + $(multilib_native_use_enable cups) + --without-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 pam) + $(multilib_native_usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '') + $(multilib_native_use_with quota quotas) + $(multilib_native_use_with regedit) + $(multilib_native_use_enable spotlight) + $(multilib_native_use_with syslog) + $(multilib_native_use_with systemd) + --systemd-install-services + --with-systemddir="$(systemd_get_systemunitdir)" + $(multilib_native_use_with unwind libunwind) + $(multilib_native_use_with winbind) + $(multilib_native_usex python '' '--disable-python') + $(multilib_native_use_enable zeroconf avahi) + $(multilib_native_usex test '--enable-selftest' '') + $(usev system-mitkrb5 "--with-system-mitkrb5 $(multilib_native_usex addc --with-experimental-mit-ad-dc '')") + $(use_with ads) + $(use_with debug lttng) + $(use_with ldap) + $(use_with profiling-data) + --private-libraries='!ldb' + $(usex lmdb '' --without-ldb-lmdb) + # bug #683148 + --jobs 1 + ) + + if multilib_is_native_abi ; then + myconf+=( --with-shared-modules=${SHAREDMODS} ) + else + myconf+=( --with-shared-modules=DEFAULT,!vfs_snapper ) + fi + + append-ldflags $(test-flags-CCLD -Wl,--undefined-version) # bug 914898 + + append-cppflags "-I${ESYSROOT}/usr/include/et" + + waf-utils_src_configure ${myconf[@]} +} + +multilib_src_compile() { + waf-utils_src_compile +} + +multilib_src_test() { + if multilib_is_native_abi ; then + "${WAF_BINARY}" test || die "Test failed" + fi +} + +multilib_src_install() { + waf-utils_src_install + + # Make all .so files executable + find "${ED}" -type f -name "*.so" -exec chmod +x {} + || die + # smbspool_krb5_wrapper must only be accessible to root, bug #880739 + find "${ED}" -type f -name "smbspool_krb5_wrapper" -exec chmod go-rwx {} + || die + + # Remove empty runtime dirs created by build system (bug #892341) + find "${ED}"/{run,var} -type d -empty -delete || die + + 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 ../../../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 (bug #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 + + dotmpfiles "${FILESDIR}"/samba.conf + if ! use addc ; then + rm "${D}/$(systemd_get_systemunitdir)/samba.service" \ + || die + fi + + # Preserve functionality for old gentoo-specific unit names + dosym nmb.service "$(systemd_get_systemunitdir)/nmbd.service" + dosym smb.service "$(systemd_get_systemunitdir)/smbd.service" + dosym winbind.service "$(systemd_get_systemunitdir)/winbindd.service" + + use python && python_optimize + fi + + if use pam && use winbind ; then + newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind + # bugs #376853 and #590374 + insinto /etc/security + doins examples/pam_winbind/pam_winbind.conf + fi +} + +pkg_postinst() { + tmpfiles_process samba.conf + + if use addc || use ads ; then + optfeature "Hide passwords from command line when using samba-tool or samba-gpupdate" dev-python/setproctitle + fi +} diff --git a/net-fs/samba/samba-4.24.3.ebuild b/net-fs/samba/samba-4.24.3.ebuild new file mode 100644 index 000000000000..0a56b5c9d029 --- /dev/null +++ b/net-fs/samba/samba-4.24.3.ebuild @@ -0,0 +1,400 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{13..14} ) +PYTHON_REQ_USE="threads(+),xml(+)" +inherit python-single-r1 flag-o-matic waf-utils multilib-minimal linux-info optfeature systemd pam tmpfiles + +DESCRIPTION="Samba Suite Version 4" +HOMEPAGE="https://samba.org/" + +MY_PV="${PV/_rc/rc}" +MY_P="${PN}-${MY_PV}" +if [[ ${PV} == *_rc* ]]; then + SRC_URI="https://download.samba.org/pub/samba/rc/${MY_P}.tar.gz" +else + SRC_URI="https://download.samba.org/pub/samba/stable/${MY_P}.tar.gz" + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86" +fi +S="${WORKDIR}/${MY_P}" + +LICENSE="GPL-3" +SLOT="0/2.11.0" +IUSE="acl addc ads ceph client cluster cups debug fam glusterfs gpg" +IUSE+=" iprint json ldap llvm-libunwind lmdb pam profiling-data python quota" +IUSE+=" +regedit selinux snapper spotlight syslog system-heimdal +system-mitkrb5" +IUSE+=" systemd test unwind winbind zeroconf" + +# ldap needs ads (bug #941578) +REQUIRED_USE="${PYTHON_REQUIRED_USE} + addc? ( json python !system-mitkrb5 winbind ) + ads? ( acl ldap python winbind ) + cluster? ( ads ) + gpg? ( addc ) + ldap? ( ads ) + spotlight? ( json ) + test? ( python ) + !ads? ( !addc ) + ?? ( system-heimdal system-mitkrb5 ) +" + +# 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" + +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 +) + +TALLOC_VERSION="2.4.4" +TDB_VERSION="1.4.15" +TEVENT_VERSION="0.17.1" + +COMMON_DEPEND=" + >=app-arch/libarchive-3.1.2:=[${MULTILIB_USEDEP}] + dev-lang/perl:= + dev-libs/icu:=[${MULTILIB_USEDEP}] + dev-libs/libbsd[${MULTILIB_USEDEP}] + dev-libs/libtasn1:=[${MULTILIB_USEDEP}] + dev-libs/popt[${MULTILIB_USEDEP}] + dev-perl/Parse-Yapp + >=net-libs/gnutls-3.4.7:=[${MULTILIB_USEDEP}] + >=net-libs/ngtcp2-1.12.0[gnutls,${MULTILIB_USEDEP}] + >=sys-fs/e2fsprogs-1.46.4-r51[${MULTILIB_USEDEP}] + !sys-libs/ldb + sys-libs/libcap[${MULTILIB_USEDEP}] + sys-libs/liburing:=[${MULTILIB_USEDEP}] + sys-libs/ncurses:= + sys-libs/readline:= + >=sys-libs/talloc-${TALLOC_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tdb-${TDB_VERSION}[${MULTILIB_USEDEP}] + >=sys-libs/tevent-${TEVENT_VERSION}[${MULTILIB_USEDEP}] + virtual/zlib:=[${MULTILIB_USEDEP}] + virtual/libcrypt:=[${MULTILIB_USEDEP}] + virtual/libiconv + $(python_gen_cond_dep ' + addc? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ads? ( + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/dnspython:=[${PYTHON_USEDEP}] + dev-python/markdown[${PYTHON_USEDEP}] + net-dns/bind[gssapi] + ) + ') + acl? ( virtual/acl ) + ceph? ( sys-cluster/ceph ) + cluster? ( net-libs/rpcsvc-proto ) + cups? ( net-print/cups ) + debug? ( dev-util/lttng-ust ) + fam? ( virtual/fam ) + gpg? ( app-crypt/gpgme:= ) + json? ( dev-libs/jansson:= ) + ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] ) + lmdb? ( >=dev-db/lmdb-0.9.16:=[${MULTILIB_USEDEP}] ) + pam? ( sys-libs/pam ) + python? ( + sys-libs/talloc[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tdb[python,${PYTHON_SINGLE_USEDEP}] + sys-libs/tevent[python,${PYTHON_SINGLE_USEDEP}] + ) + snapper? ( sys-apps/dbus ) + system-heimdal? ( >=app-crypt/heimdal-1.5[-ssl(-),${MULTILIB_USEDEP}] ) + system-mitkrb5? ( >=app-crypt/mit-krb5-1.19[${MULTILIB_USEDEP}] ) + !system-heimdal? ( !system-mitkrb5? ( sys-apps/keyutils[${MULTILIB_USEDEP}] ) ) + systemd? ( sys-apps/systemd:= ) + unwind? ( + llvm-libunwind? ( llvm-runtimes/libunwind:= ) + !llvm-libunwind? ( sys-libs/libunwind:= ) + ) + zeroconf? ( net-dns/avahi[dbus] ) +" +DEPEND="${COMMON_DEPEND} + dev-perl/JSON + net-libs/libtirpc[${MULTILIB_USEDEP}] + net-libs/rpcsvc-proto + spotlight? ( dev-libs/glib ) + test? ( + >=dev-util/cmocka-1.1.3[${MULTILIB_USEDEP}] + $(python_gen_cond_dep "dev-python/python-subunit[\${PYTHON_USEDEP},${MULTILIB_USEDEP}]" ) + !system-mitkrb5? ( + >=net-dns/resolv_wrapper-1.1.4 + >=net-libs/socket_wrapper-1.1.9 + >=sys-libs/nss_wrapper-1.1.3 + >=sys-libs/uid_wrapper-1.2.1 + ) + )" +RDEPEND="${COMMON_DEPEND} + client? ( net-fs/cifs-utils[ads?] ) + python? ( ${PYTHON_DEPS} ) + selinux? ( sec-policy/selinux-samba ) +" +BDEPEND="${PYTHON_DEPS} + app-text/docbook-xsl-stylesheets + dev-libs/libxslt + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${PN}-4.18.4-pam.patch + "${FILESDIR}"/ldb-2.5.2-skip-wav-tevent-check.patch +) + +CONFDIR="${FILESDIR}/4.4" +WAF_BINARY="${S}/buildtools/bin/waf" +SHAREDMODS="" + +pkg_setup() { + # Package fails to build with distcc + export DISTCC_DISABLE=1 + export PYTHONHASHSEED=1 + + python-single-r1_pkg_setup + + SHAREDMODS="$(usev !snapper '!')vfs_snapper" + if use cluster ; then + SHAREDMODS+=",idmap_rid,idmap_tdb2,idmap_ad" + elif use ads ; then + SHAREDMODS+=",idmap_ad" + fi +} + +check_samba_dep_versions() { + actual_talloc_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/talloc/wscript || die) + if [[ ${actual_talloc_version} != ${TALLOC_VERSION} ]] ; then + eerror "Source talloc version: ${TALLOC_VERSION}" + eerror "Ebuild talloc version: ${actual_talloc_version}" + die "Ebuild needs to fix TALLOC_VERSION!" + fi + + actual_tdb_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tdb/wscript || die) + if [[ ${actual_tdb_version} != ${TDB_VERSION} ]] ; then + eerror "Source tdb version: ${TDB_VERSION}" + eerror "Ebuild tdb version: ${actual_tdb_version}" + die "Ebuild needs to fix TDB_VERSION!" + fi + + actual_tevent_version=$(sed -En '/^VERSION =/{s/[^0-9.]//gp}' lib/tevent/wscript || die) + if [[ ${actual_tevent_version} != ${TEVENT_VERSION} ]] ; then + eerror "Source tevent version: ${TEVENT_VERSION}" + eerror "Ebuild tevent version: ${actual_tevent_version}" + die "Ebuild needs to fix TEVENT_VERSION!" + fi +} + +src_prepare() { + default + + check_samba_dep_versions + + # Unbundle dnspython + sed -i -e '/"dns.resolver":/d' "${S}"/third_party/wscript || die + + # Unbundle iso8601 unless tests are enabled + if ! use test ; then + 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 + + # bug #943942 + append-cflags -std=gnu17 + + # WAF + 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 + + # We "use" bundled cmocka when we're not running tests as we're + # not using it anyway. Means we avoid making users install it for + # no reason. bug #802531 + if ! use test ; then + bundled_libs="cmocka,${bundled_libs}" + fi + + # bug #874633 + if use llvm-libunwind ; then + mkdir -p "${T}"/${ABI}/pkgconfig || die + + local -x PKG_CONFIG_PATH="${T}/${ABI}/pkgconfig:${PKG_CONFIG_PATH}" + + cat <<-EOF > "${T}"/${ABI}/pkgconfig/libunwind-generic.pc || die + exec_prefix=\${prefix} + libdir=/usr/$(get_libdir) + includedir=\${prefix}/include + + Name: libunwind-generic + Description: libunwind generic library + Version: 1.70 + Libs: -L\${libdir} -lunwind + Cflags: -I\${includedir} + EOF + fi + + bundled_libs="libquic,${bundled_libs}" + + local 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 + --without-winexe + $(multilib_native_use_with acl acl-support) + $(multilib_native_usex addc '' '--without-ad-dc') + $(multilib_native_use_enable ceph cephfs) + $(multilib_native_use_with cluster cluster-support) + $(multilib_native_use_enable cups) + --without-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 pam) + $(multilib_native_usex pam "--with-pammodulesdir=${EPREFIX}/$(get_libdir)/security" '') + $(multilib_native_use_with quota quotas) + $(multilib_native_use_with regedit) + $(multilib_native_use_enable spotlight) + $(multilib_native_use_with syslog) + $(multilib_native_use_with systemd) + --systemd-install-services + --with-systemddir="$(systemd_get_systemunitdir)" + $(multilib_native_use_with unwind libunwind) + $(multilib_native_use_with winbind) + $(multilib_native_usex python '' '--disable-python') + $(multilib_native_use_enable zeroconf avahi) + $(multilib_native_usex test '--enable-selftest' '') + $(usev system-mitkrb5 "--with-system-mitkrb5 $(multilib_native_usex addc --with-experimental-mit-ad-dc '')") + $(use_with ads) + $(use_with debug lttng) + $(use_with ldap) + $(use_with profiling-data) + --private-libraries='!ldb' + $(usex lmdb '' --without-ldb-lmdb) + # bug #683148 + --jobs 1 + ) + + if multilib_is_native_abi ; then + myconf+=( --with-shared-modules=${SHAREDMODS} ) + else + myconf+=( --with-shared-modules=DEFAULT,!vfs_snapper ) + fi + + append-ldflags $(test-flags-CCLD -Wl,--undefined-version) # bug 914898 + + append-cppflags "-I${ESYSROOT}/usr/include/et" + + waf-utils_src_configure ${myconf[@]} +} + +multilib_src_compile() { + waf-utils_src_compile +} + +multilib_src_test() { + if multilib_is_native_abi ; then + "${WAF_BINARY}" test || die "Test failed" + fi +} + +multilib_src_install() { + waf-utils_src_install + + # Make all .so files executable + find "${ED}" -type f -name "*.so" -exec chmod +x {} + || die + # smbspool_krb5_wrapper must only be accessible to root, bug #880739 + find "${ED}" -type f -name "smbspool_krb5_wrapper" -exec chmod go-rwx {} + || die + + # Remove empty runtime dirs created by build system (bug #892341) + find "${ED}"/{run,var} -type d -empty -delete || die + + 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 ../../../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 (bug #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 + + dotmpfiles "${FILESDIR}"/samba.conf + if ! use addc ; then + rm "${D}/$(systemd_get_systemunitdir)/samba.service" \ + || die + fi + + # Preserve functionality for old gentoo-specific unit names + dosym nmb.service "$(systemd_get_systemunitdir)/nmbd.service" + dosym smb.service "$(systemd_get_systemunitdir)/smbd.service" + dosym winbind.service "$(systemd_get_systemunitdir)/winbindd.service" + + use python && python_optimize + fi + + if use pam && use winbind ; then + newpamd "${CONFDIR}/system-auth-winbind.pam" system-auth-winbind + # bugs #376853 and #590374 + insinto /etc/security + doins examples/pam_winbind/pam_winbind.conf + fi +} + +pkg_postinst() { + tmpfiles_process samba.conf + + if use addc || use ads ; then + optfeature "Hide passwords from command line when using samba-tool or samba-gpupdate" dev-python/setproctitle + fi +} diff --git a/net-fs/smbnetfs/Manifest b/net-fs/smbnetfs/Manifest new file mode 100644 index 000000000000..250994bd0ac1 --- /dev/null +++ b/net-fs/smbnetfs/Manifest @@ -0,0 +1 @@ +DIST smbnetfs-0.6.3.tar.bz2 187460 BLAKE2B d6906fa1e513253ae423031486e3be31308254506fd218f15395ac30591ecdc3179fd0998ec1e717ba4d787e7d6d8e951bc417b1c68d89193408a333d90a693c SHA512 19b1ec6a9cc9722e5e80c26ff4bd8b62dcdf7f3bb71a3c7b2a0b2b32af6902fd3fb95c27188a51b2a1f0df20fadad799ca685db28daba101f1e3b2c03ee295cc diff --git a/net-fs/smbnetfs/files/smbnetfs-0.6.1-docdir.patch b/net-fs/smbnetfs/files/smbnetfs-0.6.1-docdir.patch new file mode 100644 index 000000000000..e5e403e31198 --- /dev/null +++ b/net-fs/smbnetfs/files/smbnetfs-0.6.1-docdir.patch @@ -0,0 +1,18 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,4 +1,3 @@ +-docdir = $(datadir)/doc/$(distdir) + doc_DATA = \ + conf/smbnetfs.conf \ + doc/ENGLISH.FAQ \ +--- a/Makefile.in ++++ b/Makefile.in +@@ -296,7 +296,7 @@ build_alias = @build_alias@ + builddir = @builddir@ + datadir = @datadir@ + datarootdir = @datarootdir@ +-docdir = $(datadir)/doc/$(distdir) ++docdir = @docdir@ + dvidir = @dvidir@ + exec_prefix = @exec_prefix@ + host_alias = @host_alias@ diff --git a/net-fs/smbnetfs/metadata.xml b/net-fs/smbnetfs/metadata.xml new file mode 100644 index 000000000000..4758f1c23d0e --- /dev/null +++ b/net-fs/smbnetfs/metadata.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <!-- maintainer-needed --> + <longdescription> + SMBNetFS is a Linux/FreeBSD FUSE filesystem that allow you to use samba/microsoft network. + + Features: + - Linux-2.6 and FreeBSD >= 6.0 are supported (Linux-2.4 is not tested) + - you can use Samba/Microsoft network as a regular unix filesystem + - workgroup/computer/share entries are dynamically created + - windows domain supported + - user defined workgroup/link/hosts are supported + - national character supported + - in config files you can specify different user/password to access different network shares + - command "cd mountpoint/username:password@computer_or_ip" allows you to access "computer_or_ip" as user "username" with password "password" (this is insecure, but useful) + - the program is multithreaded, so simultaneous access to a file/share is possible + </longdescription> + <upstream> + <remote-id type="sourceforge">smbnetfs</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-fs/smbnetfs/smbnetfs-0.6.3.ebuild b/net-fs/smbnetfs/smbnetfs-0.6.3.ebuild new file mode 100644 index 000000000000..c1cd612f59c6 --- /dev/null +++ b/net-fs/smbnetfs/smbnetfs-0.6.3.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit readme.gentoo-r1 + +DESCRIPTION="FUSE filesystem for SMB shares" +HOMEPAGE="https://sourceforge.net/projects/smbnetfs" +SRC_URI="https://downloads.sourceforge.net/project/${PN}/${PN}/SMBNetFS-${PV}/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="keyring" + +RDEPEND=">=sys-fs/fuse-2.3:0= + >=net-fs/samba-4.2 + >=dev-libs/glib-2.30 + keyring? ( app-crypt/libsecret )" + +DEPEND="${RDEPEND} + virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}"/${PN}-0.6.1-docdir.patch +) + +DISABLE_AUTOFORMATTING=yes +DOC_CONTENTS=" +For quick usage, exec: +'modprobe fuse' +'smbnetfs -oallow_other /mnt/samba' +" + +src_configure() { + econf $(use_with keyring libsecret) +} + +src_install() { + default + + readme.gentoo_create_doc + dodoc AUTHORS ChangeLog +} diff --git a/net-fs/sshfs/Manifest b/net-fs/sshfs/Manifest new file mode 100644 index 000000000000..a84740a740c3 --- /dev/null +++ b/net-fs/sshfs/Manifest @@ -0,0 +1,2 @@ +DIST sshfs-3.7.3.tar.xz 53596 BLAKE2B 9a229d0f11e7247e319af13245aeaf71082664409b0ca3fe1522bcdb679d402c574438be1931d5d73a16b9eda43daf20de6c1a016442ae53afa27a697e58c212 SHA512 ba0928f85819984a3eb83d2debab658b2cd4e958ed1c3ba9787e361f452687d42b82d478b7d95e7a7c5580bae5c1cdebe4cf3c9b6cb5eb6a570311f276903d99 +DIST sshfs-3.7.5.tar.xz 51604 BLAKE2B e3cd137dfd6d3212fff241ef0ecb4d06a6cc76cc2a7c259df52d1dd5d181de725d6d003bd8b2afa6bc7a45c0ff07060389fd3200b5e3aaec0d70c8f7e16397a6 SHA512 c76d8d725c4f8ef8b95c699ae25407fd6789cd5ce94b36d241a6754e4e6d8cae9729bbe9b1e21e421f6148bf822c9441cf6626206ec7540e7b26d298e2616929 diff --git a/net-fs/sshfs/metadata.xml b/net-fs/sshfs/metadata.xml new file mode 100644 index 000000000000..30c175062a7c --- /dev/null +++ b/net-fs/sshfs/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>dlan@gentoo.org</email> + <name>Yixun Lan</name> + </maintainer> + <upstream> + <remote-id type="github">libfuse/sshfs</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-fs/sshfs/sshfs-3.7.3-r2.ebuild b/net-fs/sshfs/sshfs-3.7.3-r2.ebuild new file mode 100644 index 000000000000..2ecde5840b8e --- /dev/null +++ b/net-fs/sshfs/sshfs-3.7.3-r2.ebuild @@ -0,0 +1,26 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit meson + +DESCRIPTION="Fuse-filesystem utilizing the sftp service" +HOMEPAGE="https://github.com/libfuse/sshfs" +SRC_URI="https://github.com/libfuse/${PN}/releases/download/${P}/${P}.tar.xz" + +LICENSE="GPL-2" +KEYWORDS="amd64 arm arm64 ~hppa ~loong ppc ppc64 ~riscv ~sparc x86" +SLOT="0" + +DEPEND=">=sys-fs/fuse-3.1.0:3= + >=dev-libs/glib-2.4.2" +RDEPEND="${DEPEND} + virtual/openssh" +BDEPEND="dev-python/docutils + virtual/pkgconfig" + +# requires root privs and specific localhost sshd setup +RESTRICT="test" + +DOCS=( AUTHORS ChangeLog.rst README.rst ) diff --git a/net-fs/sshfs/sshfs-3.7.5.ebuild b/net-fs/sshfs/sshfs-3.7.5.ebuild new file mode 100644 index 000000000000..ab5c79b61312 --- /dev/null +++ b/net-fs/sshfs/sshfs-3.7.5.ebuild @@ -0,0 +1,26 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit meson + +DESCRIPTION="Fuse-filesystem utilizing the sftp service" +HOMEPAGE="https://github.com/libfuse/sshfs" +SRC_URI="https://github.com/libfuse/${PN}/releases/download/${P}/${P}.tar.xz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 arm arm64 ~hppa ~loong ppc ppc64 ~riscv ~sparc x86" + +DEPEND=">=sys-fs/fuse-3.1.0:3= + >=dev-libs/glib-2.4.2" +RDEPEND="${DEPEND} + virtual/openssh" +BDEPEND="dev-python/docutils + virtual/pkgconfig" + +# requires root privs and specific localhost sshd setup +RESTRICT="test" + +DOCS=( AUTHORS ChangeLog.rst README.md ) diff --git a/net-fs/wdfs/Manifest b/net-fs/wdfs/Manifest new file mode 100644 index 000000000000..cb2c24ba5a16 --- /dev/null +++ b/net-fs/wdfs/Manifest @@ -0,0 +1 @@ +DIST wdfs-1.4.2.tar.gz 109315 BLAKE2B 7bfe32d0c957afc347b4280e909b8964e2cb736686833580072149f107aec908e9ce220fa18ccd998ae9bea5d34e0aa2349c6a832ed40dbfae3bf6cb353f9e4e SHA512 da7e16ed86cbe4746fabe5fce44c83b1d0cd0fbc19994eefe0ce2a75f3d8c77c3c341a76409150a3509be08f8c0d28b8a9650037edcbbf2aa60f4c8ea5407004 diff --git a/net-fs/wdfs/files/wdfs-1.4.2-fix-Waddress.patch b/net-fs/wdfs/files/wdfs-1.4.2-fix-Waddress.patch new file mode 100644 index 000000000000..0f35776bdebc --- /dev/null +++ b/net-fs/wdfs/files/wdfs-1.4.2-fix-Waddress.patch @@ -0,0 +1,40 @@ +diff --git a/src/wdfs-main.c b/src/wdfs-main.c +index 9bd5244..a9917b7 100644 +--- a/src/wdfs-main.c ++++ b/src/wdfs-main.c +@@ -697,7 +697,7 @@ static int wdfs_open(const char *localpath, struct fuse_file_info *fi) + ">> %s() by PID %d\n", __func__, fuse_get_context()->pid); + } + +- assert(localpath && &fi); ++ assert(localpath && fi); + + struct open_file *file = g_new0(struct open_file, 1); + file->modified = false; +@@ -763,7 +763,7 @@ static int wdfs_read( + if (wdfs.debug == true) + print_debug_infos(__func__, localpath); + +- assert(localpath && buf && &fi); ++ assert(localpath && buf && fi); + + struct open_file *file = (struct open_file*)(uintptr_t)fi->fh; + +@@ -785,7 +785,7 @@ static int wdfs_write( + if (wdfs.debug == true) + print_debug_infos(__func__, localpath); + +- assert(localpath && buf && &fi); ++ assert(localpath && buf && fi); + + /* data below svn_basedir is read-only */ + if (wdfs.svn_mode == true && g_str_has_prefix(localpath, svn_basedir)) +@@ -961,7 +961,7 @@ static int wdfs_ftruncate( + if (wdfs.debug == true) + print_debug_infos(__func__, localpath); + +- assert(localpath && &fi); ++ assert(localpath && fi); + + /* data below svn_basedir is read-only */ + if (wdfs.svn_mode == true && g_str_has_prefix(localpath, svn_basedir)) diff --git a/net-fs/wdfs/files/wdfs-1.4.2-gcc15.patch b/net-fs/wdfs/files/wdfs-1.4.2-gcc15.patch new file mode 100644 index 000000000000..54ff51fb0f67 --- /dev/null +++ b/net-fs/wdfs/files/wdfs-1.4.2-gcc15.patch @@ -0,0 +1,40 @@ +https://bugs.gentoo.org/943933 + +--- a/src/wdfs-main.c ++++ b/src/wdfs-main.c +@@ -1227,7 +1227,7 @@ static int wdfs_statfs(const char *localpath, struct statvfs *buf) + + /* author jens, 04.08.2005 17:41:12, location: goettingen + * this method is called, when the filesystems is unmounted. time to clean up! */ +-static void wdfs_destroy() ++static void wdfs_destroy(void* a) + { + if (wdfs.debug == true) + fprintf(stderr, ">> freeing globaly used memory\n"); +--- a/src/wdfs-main.h ++++ b/src/wdfs-main.h +@@ -29,10 +29,8 @@ + esac + */ + +-typedef enum { +- true = 1, +- false = 0 +-} bool_t; ++#include <stdbool.h> ++typedef bool bool_t; + + /* used as mode for unify_path() */ + enum { +--- a/src/webdav.h ++++ b/src/webdav.h +@@ -3,7 +3,8 @@ + + extern ne_session *session; + +-int setup_webdav_session(); ++int setup_webdav_session( ++ const char *uri_string, const char *username, const char *password); + + int lockfile(const char *remotepath, const int timeout); + int unlockfile(const char *remotepath); diff --git a/net-fs/wdfs/metadata.xml b/net-fs/wdfs/metadata.xml new file mode 100644 index 000000000000..6782d951f503 --- /dev/null +++ b/net-fs/wdfs/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <!-- maintainer-needed --> + <longdescription> + wdfs is a webdav filesystem that makes it possible to mount a webdav + share under linux, freebsd and apple mac os x. wdfs has some special + features for accessing subversion repositories via webdav. it's based on + fuse and neon. + </longdescription> +</pkgmetadata> diff --git a/net-fs/wdfs/wdfs-1.4.2-r4.ebuild b/net-fs/wdfs/wdfs-1.4.2-r4.ebuild new file mode 100644 index 000000000000..2ca774bd522b --- /dev/null +++ b/net-fs/wdfs/wdfs-1.4.2-r4.ebuild @@ -0,0 +1,24 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="WebDAV filesystem with special features for accessing subversion repositories" +HOMEPAGE="http://noedler.de/projekte/wdfs/" +SRC_URI="http://noedler.de/projekte/${PN}/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ~arm64 x86" + +RDEPEND=" + dev-libs/glib:2 + >=net-libs/neon-0.24.7:= + >=sys-fs/fuse-2.5:0 +" +DEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}/${P}-fix-Waddress.patch" + "${FILESDIR}/${P}-gcc15.patch" +) diff --git a/net-fs/webdav-server-rs/Manifest b/net-fs/webdav-server-rs/Manifest new file mode 100644 index 000000000000..d23c45491420 --- /dev/null +++ b/net-fs/webdav-server-rs/Manifest @@ -0,0 +1,2 @@ +DIST webdav-server-rs-0.4.0_pre20231124-deps.tar.xz 19519152 BLAKE2B d1bbecf31efe7aba08c76d07a62454454db274673a5ecbdecd6c0d7cce19d9b8b666c21d91a334d8166a9902e809537f3f29ddebd2be3da32877745c13a9256b SHA512 2e7dcaf6bf7f22982c676c6289e7902ca79f3bc17e4f5707d135fc963b27582a8c9ec51e5afe7da1b5be7134f150987adad179a7f3c0fc89ab32e96094f6c460 +DIST webdav-server-rs-0.4.0_pre20231124.tar.gz 54013 BLAKE2B aac46e62845f81529ff1865ceb22d979d1e124e47161bef69de7f1dc65bbeff0b01160a197de3617fd86077a406f6975b3c0c72f414cab867c52055865941089 SHA512 fa7d560e3b08933d55ea5b71e5f027577c8f04c78ffdaa148465c7c3ca1719f6929c72c9d2cea17c6c94fe88e60c07e505571cf594422c840823e95f94f5f9a5 diff --git a/net-fs/webdav-server-rs/files/webdav-server-rs-0.4.0_pre20231124-use-the-version-0.2.0-of-webdav-handler.patch b/net-fs/webdav-server-rs/files/webdav-server-rs-0.4.0_pre20231124-use-the-version-0.2.0-of-webdav-handler.patch new file mode 100644 index 000000000000..eae50169ece2 --- /dev/null +++ b/net-fs/webdav-server-rs/files/webdav-server-rs-0.4.0_pre20231124-use-the-version-0.2.0-of-webdav-handler.patch @@ -0,0 +1,16 @@ +From: Pavel Sobolev <contact@paveloom.dev> +Subject: [PATCH] Use the version `0.2.0` of `webdav-handler`. + +Signed-off-by: Pavel Sobolev <contact@paveloom.dev> + +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -71,6 +71,5 @@ tokio = { version = "1.5.0", features = ["full"] } + tokio-rustls = "0.23.4" + toml = "0.5.8" + url = "2.2.2" +-webdav-handler = { path = "../webdav-handler-rs", version = "=0.2.0" } +-#webdav-handler = "0.2.0" ++webdav-handler = "0.2.0" + pwhash = "1.0.0" + diff --git a/net-fs/webdav-server-rs/files/webdav-server-rs.service b/net-fs/webdav-server-rs/files/webdav-server-rs.service new file mode 100644 index 000000000000..2d54210cbcc1 --- /dev/null +++ b/net-fs/webdav-server-rs/files/webdav-server-rs.service @@ -0,0 +1,11 @@ +[Unit] +Description=WebDAV Server +After=network.target + +[Service] +Type=simple +ExecStart=/usr/bin/webdav-server -c /etc/webdav-server-rs/config.toml +PrivateTmp=true + +[Install] +WantedBy=multi-user.target diff --git a/net-fs/webdav-server-rs/metadata.xml b/net-fs/webdav-server-rs/metadata.xml new file mode 100644 index 000000000000..a2774361fea7 --- /dev/null +++ b/net-fs/webdav-server-rs/metadata.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>contact@paveloom.dev</email> + <name>Pavel Sobolev</name> + </maintainer> + <upstream> + <bugs-to>https://github.com/miquels/webdav-server-rs/issues</bugs-to> + <remote-id type="github">miquels/webdav-server-rs</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-fs/webdav-server-rs/webdav-server-rs-0.4.0_pre20231124.ebuild b/net-fs/webdav-server-rs/webdav-server-rs-0.4.0_pre20231124.ebuild new file mode 100644 index 000000000000..4251671ea456 --- /dev/null +++ b/net-fs/webdav-server-rs/webdav-server-rs-0.4.0_pre20231124.ebuild @@ -0,0 +1,52 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cargo systemd + +EGIT_COMMIT="50318a66f2f2350e99f89e46a1c130d2c01397af" + +DESCRIPTION="WebDAV server in Rust" +HOMEPAGE="https://github.com/miquels/webdav-server-rs" +SRC_URI=" + https://github.com/miquels/webdav-server-rs/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz + https://gitlab.com/api/v4/projects/69517529/packages/generic/${PN}/${PV}/${P}-deps.tar.xz +" + +S="${WORKDIR}/${PN}-${EGIT_COMMIT}" + +LICENSE="Apache-2.0 BSD ISC MIT Unicode-DFS-2016" +SLOT="0" +KEYWORDS="~amd64" + +PATCHES=( + "${FILESDIR}"/${P}-use-the-version-0.2.0-of-webdav-handler.patch +) + +RDEPEND=" + acct-group/webdav + acct-user/webdav + net-libs/libtirpc:= + sys-libs/pam +" +DEPEND="${RDEPEND}" +BDEPEND=" + net-libs/rpcsvc-proto +" + +src_prepare() { + default + + sed -i "s/uid = 33/uid = $(id -u webdav)/" webdav-server.toml + sed -i "s/gid = 33/gid = $(id -g webdav)/" webdav-server.toml +} + +src_install() { + cargo_src_install + + insinto "/etc/${PN}" + newins webdav-server.toml config.toml.example + + systemd_dounit "${FILESDIR}/${PN}.service" +} |
