From 26dac887b69177f86e6df32dacc7671ed6822749 Mon Sep 17 00:00:00 2001
From: Chris Grzybowski <chrisg@gblabs.co.uk>
Date: Tue, 2 Apr 2024 12:02:42 +0200
Subject: [PATCH 1/5] bump up the version for xfsprogs

it's marked as unstable, so the idea is, that it will not be pulled through the generic update process
---
 .../files/xfsprogs-4.15.0-docdir.patch        | 11 +++
 .../files/xfsprogs-5.3.0-libdir.patch         | 28 ++++++
 sys-fs/xfsprogs/xfsprogs-5.10.0-r1.ebuild     | 94 +++++++++++++++++++
 3 files changed, 133 insertions(+)
 create mode 100755 sys-fs/xfsprogs/files/xfsprogs-4.15.0-docdir.patch
 create mode 100755 sys-fs/xfsprogs/files/xfsprogs-5.3.0-libdir.patch
 create mode 100755 sys-fs/xfsprogs/xfsprogs-5.10.0-r1.ebuild

diff --git a/sys-fs/xfsprogs/files/xfsprogs-4.15.0-docdir.patch b/sys-fs/xfsprogs/files/xfsprogs-4.15.0-docdir.patch
new file mode 100755
index 0000000..53ba3ec
--- /dev/null
+++ b/sys-fs/xfsprogs/files/xfsprogs-4.15.0-docdir.patch
@@ -0,0 +1,11 @@
+--- xfsprogs-4.15.0/scrub/Makefile
++++ xfsprogs-4.15.0/scrub/Makefile
+@@ -25,7 +25,7 @@
+ CRONTABS = xfs_scrub_all.cron
+ OPTIONAL_TARGETS += $(CRONTABS)
+ # Don't enable the crontab by default for now
+-CROND_DIR = $(PKG_LIB_DIR)/$(PKG_NAME)
++CROND_DIR = $(PKG_DOC_DIR)
+ endif
+ 
+ endif	# scrub_prereqs
diff --git a/sys-fs/xfsprogs/files/xfsprogs-5.3.0-libdir.patch b/sys-fs/xfsprogs/files/xfsprogs-5.3.0-libdir.patch
new file mode 100755
index 0000000..f943817
--- /dev/null
+++ b/sys-fs/xfsprogs/files/xfsprogs-5.3.0-libdir.patch
@@ -0,0 +1,28 @@
+In Gentoo we install libs to /usr/lib* and let gen_usr_ldscript
+handle /lib*.
+
+--- a/include/buildmacros
++++ b/include/buildmacros
+@@ -57,9 +57,10 @@ endif
+ ifeq ($(ENABLE_SHARED),yes)
+ INSTALL_LTLIB = \
+ 	cd $(TOPDIR)/$(LIBNAME)/.libs; \
+-	../$(INSTALL) -m 755 -d $(PKG_ROOT_LIB_DIR); \
+-	../$(INSTALL) -m 755 -T so_dot_version $(LIBNAME).lai $(PKG_ROOT_LIB_DIR); \
+-	../$(INSTALL) -T so_dot_current $(LIBNAME).lai $(PKG_ROOT_LIB_DIR)
++	../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
++	../$(INSTALL) -m 755 -T so_dot_version $(LIBNAME).lai $(PKG_LIB_DIR); \
++	../$(INSTALL) -T so_dot_current $(LIBNAME).lai $(PKG_LIB_DIR); \
++	../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_LIB_DIR)
+ endif
+ 
+ # Libtool thinks the static and shared libs should be in the same dir, so
+@@ -68,7 +69,7 @@ endif
+ # Other things want the shared libs to appear in /usr/lib, else they'll
+ # link with the static libs there.  So, another symlink to get the .so into
+ # /usr/lib.
+-ifeq ($(ENABLE_SHARED),yes)
++ifeq ($(ENABLE_SHARED_HANDLED_BY_gen_usr_ldscript),yes)
+ INSTALL_LTLIB_DEV = \
+ 	cd $(TOPDIR)/$(LIBNAME)/.libs; \
+ 	../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
diff --git a/sys-fs/xfsprogs/xfsprogs-5.10.0-r1.ebuild b/sys-fs/xfsprogs/xfsprogs-5.10.0-r1.ebuild
new file mode 100755
index 0000000..79920f9
--- /dev/null
+++ b/sys-fs/xfsprogs/xfsprogs-5.10.0-r1.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs multilib systemd
+
+DESCRIPTION="xfs filesystem utilities"
+HOMEPAGE="https://xfs.wiki.kernel.org/"
+SRC_URI="https://www.kernel.org/pub/linux/utils/fs/xfs/${PN}/${P}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 arm arm64 ~hppa ~ia64 ppc ppc64 s390 sparc ~x86"
+IUSE="icu libedit nls"
+
+RDEPEND=">=sys-apps/util-linux-2.17.2
+	dev-libs/inih
+	icu? ( dev-libs/icu:= )
+	libedit? ( dev-libs/libedit )
+	!<sys-fs/xfsdump-3"
+DEPEND="${RDEPEND}"
+BDEPEND="
+	nls? ( sys-devel/gettext )
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-4.15.0-docdir.patch
+	"${FILESDIR}"/${PN}-5.3.0-libdir.patch
+)
+
+src_prepare() {
+	default
+
+	# Fix doc dir
+	sed -i \
+		-e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
+		include/builddefs.in || die
+
+	# Don't install compressed docs
+	sed 's@\(CHANGES\)\.gz[[:space:]]@\1 @' -i doc/Makefile || die
+}
+
+src_configure() {
+	# include/builddefs.in will add FCFLAGS to CFLAGS which will
+	# unnecessarily clutter CFLAGS (and fortran isn't used)
+	unset FCFLAGS
+
+	export DEBUG=-DNDEBUG
+
+	# Package is honoring CFLAGS; No need to use OPTIMIZER anymore.
+	# However, we have to provide an empty value to avoid default
+	# flags.
+	export OPTIMIZER=" "
+
+	unset PLATFORM # if set in user env, this breaks configure
+
+	# Avoid automagic on libdevmapper, #709694
+	export ac_cv_search_dm_task_create=no
+
+	# Build fails with -O3 (bug #712698)
+	replace-flags -O3 -O2
+
+	# Upstream does NOT support --disable-static anymore,
+	# https://www.spinics.net/lists/linux-xfs/msg30185.html
+	# https://www.spinics.net/lists/linux-xfs/msg30272.html
+	local myconf=(
+		--enable-blkid
+		--with-crond-dir="${EPREFIX}/etc/cron.d"
+		--with-systemd-unit-dir="$(systemd_get_systemunitdir)"
+		$(use_enable icu libicu)
+		$(use_enable nls gettext)
+		$(use_enable libedit editline)
+	)
+
+	if is-flagq -flto ; then
+		myconf+=( --enable-lto )
+	else
+		myconf+=( --disable-lto )
+	fi
+
+	econf "${myconf[@]}"
+}
+
+src_compile() {
+	emake V=1
+}
+
+src_install() {
+	emake DIST_ROOT="${ED}" HAVE_ZIPPED_MANPAGES=false install
+	emake DIST_ROOT="${ED}" HAVE_ZIPPED_MANPAGES=false install-dev
+
+	gen_usr_ldscript -a handle
+}
-- 
GitLab


From 32b524da5a02f7121b2ae459008f572bee890863 Mon Sep 17 00:00:00 2001
From: Chris Grzybowski <chrisg@gblabs.co.uk>
Date: Tue, 9 Apr 2024 17:52:19 +0200
Subject: [PATCH 2/5] adding rclone 1.66

---
 .../rclone-bin/rclone-bin-1.66.0-r1.ebuild    | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 net-misc/rclone-bin/rclone-bin-1.66.0-r1.ebuild

diff --git a/net-misc/rclone-bin/rclone-bin-1.66.0-r1.ebuild b/net-misc/rclone-bin/rclone-bin-1.66.0-r1.ebuild
new file mode 100644
index 0000000..6004f56
--- /dev/null
+++ b/net-misc/rclone-bin/rclone-bin-1.66.0-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit  bash-completion-r1
+KEYWORDS="amd64 ~arm x86"
+SRC_URI="https://downloads.rclone.org/v${PV}/${PN/-*}-v${PV}-linux-amd64.zip -> ${P}.zip"
+
+DESCRIPTION="A program to sync files to and from various cloud storage providers"
+HOMEPAGE="https://rclone.org/"
+RESTRICT="strip"
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="bash-completion zsh-completion"
+
+DEPEND="!net-misc/rclone"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PN/-*}-v${PV}-linux-amd64"
+
+src_install() {
+        dobin ${PN/-*}
+        dodoc README.txt
+        doman ${PN/-*}.1
+
+}
+
+pkg_postinst(){
+    dodir ${ROOT}root/.config/rclone/
+    if use bash-completion; then
+        rclone completion bash ${PN/-*}.bash ||die "Failed to generate bash completion"
+        insinto /usr/share/bash-completion/completions/
+        insopts -m0644
+        newins ${PN/-*}.bash ${PN/-*}
+    fi
+    if use zsh-completion; then
+        rclone completion zsh ${PN/-*}.zsh || die "Failed to generate zsh completion"
+        insinto /usr/share/zsh/site-functions/
+        insopts -m0644
+        newins ${PN/-*}.zsh ${PN/-*}
+    fi
+}
+
+pkg_postrm() {
+    if [[ ! ${REPLACED_BY_VERSION} ]]; then
+        [[ -f ${ROOT}/usr/share/zsh/site-functions/_${PN/-*} ]] && rm ${ROOT}/usr/share/zsh/site-functions/_${PN/-*}
+        [[ -f ${ROOT}/usr/share/bash-completion/completions/${PN/-*} ]] && rm ${ROOT}/usr/share/bash-completion/completions/${PN/-*}
+    fi
+}
-- 
GitLab


From 95d4350e5ae5e9762330b52ab0df1a704d3bd8b3 Mon Sep 17 00:00:00 2001
From: Chris Grzybowski <chrisg@gblabs.co.uk>
Date: Wed, 10 Apr 2024 16:49:35 +0200
Subject: [PATCH 3/5] drop old rclone-bin

---
 .../rclone-bin/rclone-bin-1.47.0-r1.ebuild    | 52 -------------------
 .../rclone-bin/rclone-bin-1.52.2-r1.ebuild    | 52 -------------------
 .../rclone-bin/rclone-bin-1.54.1-r1.ebuild    | 52 -------------------
 .../rclone-bin/rclone-bin-1.56.2-r1.ebuild    | 52 -------------------
 4 files changed, 208 deletions(-)
 delete mode 100644 net-misc/rclone-bin/rclone-bin-1.47.0-r1.ebuild
 delete mode 100644 net-misc/rclone-bin/rclone-bin-1.52.2-r1.ebuild
 delete mode 100644 net-misc/rclone-bin/rclone-bin-1.54.1-r1.ebuild
 delete mode 100644 net-misc/rclone-bin/rclone-bin-1.56.2-r1.ebuild

diff --git a/net-misc/rclone-bin/rclone-bin-1.47.0-r1.ebuild b/net-misc/rclone-bin/rclone-bin-1.47.0-r1.ebuild
deleted file mode 100644
index c7d6e90..0000000
--- a/net-misc/rclone-bin/rclone-bin-1.47.0-r1.ebuild
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit  bash-completion-r1
-KEYWORDS="amd64 ~arm x86"
-EGIT_COMMIT="v${PV}"
-SRC_URI="https://downloads.rclone.org/v${PV}/${PN/-*}-v${PV}-linux-amd64.zip -> ${P}.zip"
-
-DESCRIPTION="A program to sync files to and from various cloud storage providers"
-HOMEPAGE="https://rclone.org/"
-RESTRICT="strip"
-
-LICENSE="MIT"
-SLOT="0"
-IUSE="bash-completion zsh-completion"
-
-DEPEND="!net-misc/rclone"
-RDEPEND="${DEPEND}"
-        
-S="${WORKDIR}/${PN/-*}-v${PV}-linux-amd64"
-
-src_install() {
-        dobin ${PN/-*}
-        dodoc README.txt
-        doman ${PN/-*}.1
-
-}
-
-pkg_postinst(){
-    dodir ${ROOT}root/.config/rclone/
-    if use bash-completion; then
-        rclone genautocomplete bash ${PN/-*}.bash || die
-        insinto /usr/share/bash-completion/completions/
-        insopts -m0644
-        newins ${PN/-*}.bash ${PN/-*}
-    fi
-    if use zsh-completion; then
-        rclone genautocomplete zsh ${PN/-*}.zsh || die
-        insinto /usr/share/zsh/site-functions/
-        insopts -m0644
-        newins ${PN/-*}.bash ${PN/-*}
-    fi
-}
-
-pkg_postrm() {
-    if [[ ! ${REPLACED_BY_VERSION} ]]; then
-        [[ -f ${ROOT}/usr/share/zsh/site-functions/_${PN/-*} ]] && rm ${ROOT}/usr/share/zsh/site-functions/_${PN/-*}
-        [[ -f ${ROOT}/usr/share/bash-completion/completions/${PN/-*} ]] && rm ${ROOT}/usr/share/bash-completion/completions/${PN/-*}
-    fi
-}
diff --git a/net-misc/rclone-bin/rclone-bin-1.52.2-r1.ebuild b/net-misc/rclone-bin/rclone-bin-1.52.2-r1.ebuild
deleted file mode 100644
index 51dd5f8..0000000
--- a/net-misc/rclone-bin/rclone-bin-1.52.2-r1.ebuild
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit  bash-completion-r1
-KEYWORDS="amd64 ~arm x86"
-EGIT_COMMIT="v${PV}"
-SRC_URI="https://downloads.rclone.org/v${PV}/${PN/-*}-v${PV}-linux-amd64.zip -> ${P}.zip"
-
-DESCRIPTION="A program to sync files to and from various cloud storage providers"
-HOMEPAGE="https://rclone.org/"
-RESTRICT="strip"
-
-LICENSE="MIT"
-SLOT="0"
-IUSE="bash-completion zsh-completion"
-
-DEPEND="!net-misc/rclone"
-RDEPEND="${DEPEND}"
-
-S="${WORKDIR}/${PN/-*}-v${PV}-linux-amd64"
-
-src_install() {
-        dobin ${PN/-*}
-        dodoc README.txt
-        doman ${PN/-*}.1
-
-}
-
-pkg_postinst(){
-    dodir ${ROOT}root/.config/rclone/
-    if use bash-completion; then
-        rclone genautocomplete bash ${PN/-*}.bash || die
-        insinto /usr/share/bash-completion/completions/
-        insopts -m0644
-        newins ${PN/-*}.bash ${PN/-*}
-    fi
-    if use zsh-completion; then
-        rclone genautocomplete zsh ${PN/-*}.zsh || die
-        insinto /usr/share/zsh/site-functions/
-        insopts -m0644
-        newins ${PN/-*}.bash ${PN/-*}
-    fi
-}
-
-pkg_postrm() {
-    if [[ ! ${REPLACED_BY_VERSION} ]]; then
-        [[ -f ${ROOT}/usr/share/zsh/site-functions/_${PN/-*} ]] && rm ${ROOT}/usr/share/zsh/site-functions/_${PN/-*}
-        [[ -f ${ROOT}/usr/share/bash-completion/completions/${PN/-*} ]] && rm ${ROOT}/usr/share/bash-completion/completions/${PN/-*}
-    fi
-}
diff --git a/net-misc/rclone-bin/rclone-bin-1.54.1-r1.ebuild b/net-misc/rclone-bin/rclone-bin-1.54.1-r1.ebuild
deleted file mode 100644
index 51dd5f8..0000000
--- a/net-misc/rclone-bin/rclone-bin-1.54.1-r1.ebuild
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit  bash-completion-r1
-KEYWORDS="amd64 ~arm x86"
-EGIT_COMMIT="v${PV}"
-SRC_URI="https://downloads.rclone.org/v${PV}/${PN/-*}-v${PV}-linux-amd64.zip -> ${P}.zip"
-
-DESCRIPTION="A program to sync files to and from various cloud storage providers"
-HOMEPAGE="https://rclone.org/"
-RESTRICT="strip"
-
-LICENSE="MIT"
-SLOT="0"
-IUSE="bash-completion zsh-completion"
-
-DEPEND="!net-misc/rclone"
-RDEPEND="${DEPEND}"
-
-S="${WORKDIR}/${PN/-*}-v${PV}-linux-amd64"
-
-src_install() {
-        dobin ${PN/-*}
-        dodoc README.txt
-        doman ${PN/-*}.1
-
-}
-
-pkg_postinst(){
-    dodir ${ROOT}root/.config/rclone/
-    if use bash-completion; then
-        rclone genautocomplete bash ${PN/-*}.bash || die
-        insinto /usr/share/bash-completion/completions/
-        insopts -m0644
-        newins ${PN/-*}.bash ${PN/-*}
-    fi
-    if use zsh-completion; then
-        rclone genautocomplete zsh ${PN/-*}.zsh || die
-        insinto /usr/share/zsh/site-functions/
-        insopts -m0644
-        newins ${PN/-*}.bash ${PN/-*}
-    fi
-}
-
-pkg_postrm() {
-    if [[ ! ${REPLACED_BY_VERSION} ]]; then
-        [[ -f ${ROOT}/usr/share/zsh/site-functions/_${PN/-*} ]] && rm ${ROOT}/usr/share/zsh/site-functions/_${PN/-*}
-        [[ -f ${ROOT}/usr/share/bash-completion/completions/${PN/-*} ]] && rm ${ROOT}/usr/share/bash-completion/completions/${PN/-*}
-    fi
-}
diff --git a/net-misc/rclone-bin/rclone-bin-1.56.2-r1.ebuild b/net-misc/rclone-bin/rclone-bin-1.56.2-r1.ebuild
deleted file mode 100644
index 51dd5f8..0000000
--- a/net-misc/rclone-bin/rclone-bin-1.56.2-r1.ebuild
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit  bash-completion-r1
-KEYWORDS="amd64 ~arm x86"
-EGIT_COMMIT="v${PV}"
-SRC_URI="https://downloads.rclone.org/v${PV}/${PN/-*}-v${PV}-linux-amd64.zip -> ${P}.zip"
-
-DESCRIPTION="A program to sync files to and from various cloud storage providers"
-HOMEPAGE="https://rclone.org/"
-RESTRICT="strip"
-
-LICENSE="MIT"
-SLOT="0"
-IUSE="bash-completion zsh-completion"
-
-DEPEND="!net-misc/rclone"
-RDEPEND="${DEPEND}"
-
-S="${WORKDIR}/${PN/-*}-v${PV}-linux-amd64"
-
-src_install() {
-        dobin ${PN/-*}
-        dodoc README.txt
-        doman ${PN/-*}.1
-
-}
-
-pkg_postinst(){
-    dodir ${ROOT}root/.config/rclone/
-    if use bash-completion; then
-        rclone genautocomplete bash ${PN/-*}.bash || die
-        insinto /usr/share/bash-completion/completions/
-        insopts -m0644
-        newins ${PN/-*}.bash ${PN/-*}
-    fi
-    if use zsh-completion; then
-        rclone genautocomplete zsh ${PN/-*}.zsh || die
-        insinto /usr/share/zsh/site-functions/
-        insopts -m0644
-        newins ${PN/-*}.bash ${PN/-*}
-    fi
-}
-
-pkg_postrm() {
-    if [[ ! ${REPLACED_BY_VERSION} ]]; then
-        [[ -f ${ROOT}/usr/share/zsh/site-functions/_${PN/-*} ]] && rm ${ROOT}/usr/share/zsh/site-functions/_${PN/-*}
-        [[ -f ${ROOT}/usr/share/bash-completion/completions/${PN/-*} ]] && rm ${ROOT}/usr/share/bash-completion/completions/${PN/-*}
-    fi
-}
-- 
GitLab


From c6403cccb8f7a600293e5970579e3f0c9baa0d51 Mon Sep 17 00:00:00 2001
From: Chris Grzybowski <chrisg@gblabs.co.uk>
Date: Thu, 11 Apr 2024 10:40:59 +0200
Subject: [PATCH 4/5] disable PAM

---
 profiles/targets/server/package.use | 1 +
 1 file changed, 1 insertion(+)

diff --git a/profiles/targets/server/package.use b/profiles/targets/server/package.use
index e33d624..b7908b0 100644
--- a/profiles/targets/server/package.use
+++ b/profiles/targets/server/package.use
@@ -16,5 +16,6 @@ dev-python/django postgres
 net-dns/dnsmasq dhcp-tools
 net-fs/nfs-utils libmount nfsidmap nfsv4 uuid
 net-misc/ntp -zeroconf
+net-misc/openssh -pam
 sys-block/fio aio gnuplot
 sys-kernel/buildkernel-debug -hardened
-- 
GitLab


From f680ee1a473f638936e6f74f990dca9ddbc64c1d Mon Sep 17 00:00:00 2001
From: Chris Grzybowski <chrisg@gblabs.co.uk>
Date: Tue, 21 May 2024 16:46:04 +0200
Subject: [PATCH 5/5] Revert "disable PAM "

This reverts commit c6403cccb8f7a600293e5970579e3f0c9baa0d51.
---
 profiles/targets/server/package.use | 1 -
 1 file changed, 1 deletion(-)

diff --git a/profiles/targets/server/package.use b/profiles/targets/server/package.use
index b7908b0..e33d624 100644
--- a/profiles/targets/server/package.use
+++ b/profiles/targets/server/package.use
@@ -16,6 +16,5 @@ dev-python/django postgres
 net-dns/dnsmasq dhcp-tools
 net-fs/nfs-utils libmount nfsidmap nfsv4 uuid
 net-misc/ntp -zeroconf
-net-misc/openssh -pam
 sys-block/fio aio gnuplot
 sys-kernel/buildkernel-debug -hardened
-- 
GitLab