public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-power/nut/
Date: Mon,  1 Jan 2024 00:12:30 +0000 (UTC)	[thread overview]
Message-ID: <1704067933.53b5eaaeadda10e7c5591a9ff9452e9dde21af78.sam@gentoo> (raw)

commit:     53b5eaaeadda10e7c5591a9ff9452e9dde21af78
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Sun Dec 31 18:48:50 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jan  1 00:12:13 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53b5eaae

sys-power/nut: fix confusing split-usr handling

Almost a decade ago, upstream moved their binary from libdir to sbindir.
Historically, Gentoo symlinked the binary into sbindir to make up for
this -- and when upstream moved to follow the Gentoo layout, the Gentoo
symlink overwrote the actual binary.

For some reason, at the time, the solution used was to add a
USE=split-usr and install extra symlinks for /sbin -> /usr/sbin even
though this didn't actually do something meaningful. The split-usr USE
flag has issues and using it unnecessarily should be avoided if
possible. Drop the USE flag, and the symlink, and stick with /usr/sbin
as upstream intends.

This should be 100% fine in all cases. The /sbin directory is only
needed for users who both have /usr on a different partition, *and*
don't use an initramfs. In such a case, it is nonsensical to provide a
symlink in /sbin that is a broken symlink to an un-mounted partition.

Bug: https://bugs.gentoo.org/517954
Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../nut/{nut-9999.ebuild => nut-2.8.0-r3.ebuild}   | 65 ++++------------------
 sys-power/nut/nut-9999.ebuild                      |  3 +-
 2 files changed, 12 insertions(+), 56 deletions(-)

diff --git a/sys-power/nut/nut-9999.ebuild b/sys-power/nut/nut-2.8.0-r3.ebuild
similarity index 73%
copy from sys-power/nut/nut-9999.ebuild
copy to sys-power/nut/nut-2.8.0-r3.ebuild
index a56635519b2d..20eea7107c63 100644
--- a/sys-power/nut/nut-9999.ebuild
+++ b/sys-power/nut/nut-2.8.0-r3.ebuild
@@ -3,9 +3,8 @@
 
 EAPI=8
 
-PYTHON_COMPAT=( python3_{10..12} )
-inherit bash-completion-r1 desktop flag-o-matic linux-info optfeature
-inherit python-single-r1 systemd tmpfiles toolchain-funcs udev wrapper xdg
+inherit bash-completion-r1 flag-o-matic linux-info optfeature systemd
+inherit tmpfiles toolchain-funcs udev
 
 MY_P=${P/_/-}
 
@@ -17,37 +16,27 @@ if [[ ${PV} == *9999 ]] ; then
 	inherit git-r3
 else
 	SRC_URI="https://networkupstools.org/source/${PV%.*}/${MY_P}.tar.gz"
-	KEYWORDS="~amd64 ~arm64 ~x86"
+	KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
 fi
 
 S="${WORKDIR}/${MY_P}"
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="gpio cgi doc ipmi serial i2c +man snmp +usb modbus selinux split-usr ssl tcpd test xml zeroconf python monitor systemd"
+IUSE="cgi doc ipmi serial i2c +man snmp +usb modbus selinux ssl tcpd test xml zeroconf"
 RESTRICT="!test? ( test )"
 
-REQUIRED_USE="
-	monitor? ( python )
-	python? ( ${PYTHON_REQUIRED_USE} )
-	snmp? ( python )
-"
-
-# sys-apps/systemd-253 required for Type=notify-reload
 DEPEND="
 	acct-group/nut
 	acct-user/nut
 	dev-libs/libltdl
 	virtual/udev
 	cgi? ( >=media-libs/gd-2[png] )
-	gpio? ( dev-libs/libgpiod )
 	i2c? ( sys-apps/i2c-tools )
 	ipmi? ( sys-libs/freeipmi )
 	modbus? ( dev-libs/libmodbus )
-	python? ( ${PYTHON_DEPS} )
 	snmp? ( net-analyzer/net-snmp:= )
 	ssl? ( >=dev-libs/openssl-1:= )
-	systemd? ( >=sys-apps/systemd-253 )
 	tcpd? ( sys-apps/tcp-wrappers )
 	usb? ( virtual/libusb:1 )
 	xml? ( >=net-libs/neon-0.25.0:= )
@@ -60,16 +49,11 @@ BDEPEND="
 "
 RDEPEND="
 	${DEPEND}
-	monitor? ( $(python_gen_cond_dep '
-			dev-python/PyQt5[gui,widgets,${PYTHON_USEDEP}]
-		')
-	)
 	selinux? ( sec-policy/selinux-nut )
 "
 
 PATCHES=(
 	"${FILESDIR}/${PN}-2.6.2-lowspeed-buffer-size.patch"
-	"${FILESDIR}/systemd_notify.path"
 )
 
 pkg_pretend() {
@@ -82,10 +66,6 @@ pkg_pretend() {
 		ERROR_HIDRAW="HIDRAW is needed to support USB UPSes"
 		ERROR_I2C_CHARDEV="USB_HIDDEV is needed to support USB UPSes"
 	fi
-	if use gpio; then
-		CONFIG_CHECK="~GPIO_CDEV_V1"
-		ERROR_GPIO_CDEV_V1="GPIO_CDEV_V1 is needed to support GPIO UPSes"
-	fi
 	if use serial; then
 		CONFIG_CHECK="~SERIAL_8250"
 		ERROR_SERIAL_8250="SERIAL_8250 is needed to support Serial UPSes"
@@ -95,18 +75,12 @@ pkg_pretend() {
 	check_extra_config
 }
 
-pkg_setup() {
-	use python && python-single-r1_pkg_setup
-}
-
 src_prepare() {
 	default
 
 	if [[ ${PV} == *9999 ]] ; then
 		./autogen.sh || die
 	fi
-
-	xdg_environment_reset
 }
 
 src_configure() {
@@ -130,19 +104,17 @@ src_configure() {
 		--without-powerman
 		--without-python
 		--without-python2
+		--without-python3
 		--with-altpidpath=/run/nut
 		--with-pidpath=/run/nut
+		$(use_enable test cppunit)
 		$(use_with cgi)
-		$(use_with gpio)
 		$(use_with i2c linux_i2c)
 		$(use_with ipmi freeipmi)
 		$(use_with ipmi)
-		$(use_with monitor nut_monitor)
-		$(use_with python pynut)
 		$(use_with serial)
 		$(use_with snmp)
 		$(use_with ssl)
-		$(use_with systemd libsystemd)
 		$(use_with tcpd wrap)
 		$(use_with usb)
 		$(use_with xml neon)
@@ -155,7 +127,6 @@ src_configure() {
 
 	use cgi && myeconfargs+=( --with-cgipath=/usr/share/nut/cgi )
 	use man && myeconfargs+=( --with-doc=man )
-	use python && myeconfargs+=( --with-python3="${PYTHON}" ) || myeconfargs+=( --without-python3 )
 
 	export bashcompdir="$(get_bashcompdir)"
 
@@ -170,7 +141,6 @@ src_install() {
 	find "${ED}" -name '*.la' -delete || die
 
 	dodir /sbin
-	use split-usr && dosym ../usr/sbin/upsdrvctl /sbin/upsdrvctl
 
 	if use cgi; then
 		elog "CGI monitoring scripts are installed in ${EPREFIX}/usr/share/nut/cgi."
@@ -187,11 +157,11 @@ src_install() {
 		mv "${i}" "${i/.sample/}" || die
 	done
 
-	local DOCS=( AUTHORS MAINTAINERS NEWS.adoc README.adoc TODO.adoc UPGRADING.adoc )
+	local DOCS=( AUTHORS MAINTAINERS NEWS README TODO UPGRADING )
 	einstalldocs
 
 	if use doc; then
-		newdoc lib/README.adoc
+		newdoc lib/README README.lib
 		dodoc docs/*.txt
 		docinto cables
 		dodoc docs/cables/*
@@ -211,21 +181,10 @@ src_install() {
 		doins scripts/avahi/nut.service
 	fi
 
-	if use monitor; then
-		make_wrapper NUT-Monitor-py3qt5 /usr/share/nut/nut-monitor/app/NUT-Monitor-py3qt5 /usr/share/nut/nut-monitor/app
-
-		# Install desktop shortcut
-		newmenu scripts/python/app/nut-monitor-py3qt5.desktop nut-monitor.desktop
-
-		# Installing Application icons
-		local res
-		for res in 48 64 256; do
-			doicon -s ${res} scripts/python/app/icons/${res}x${res}/nut-monitor.png
-		done
-		doicon -s scalable scripts/python/app/icons/scalable/nut-monitor.svg
-	fi
+	mv "${ED}"/usr/lib/tmpfiles.d/nut-common.tmpfiles "${ED}"/usr/lib/tmpfiles.d/nut-common-tmpfiles.conf || die
 
-	use python && python_optimize
+	# Fix double directory
+	sed -i -e 's:/nut/nut:/nut:g' "${ED}"/usr/lib/tmpfiles.d/nut-common-tmpfiles.conf || die
 }
 
 pkg_postinst() {
@@ -254,10 +213,8 @@ pkg_postinst() {
 	udev_reload
 
 	tmpfiles_process nut-common-tmpfiles.conf
-	xdg_pkg_postinst
 }
 
 pkg_postrm() {
 	udev_reload
-	xdg_pkg_postrm
 }

diff --git a/sys-power/nut/nut-9999.ebuild b/sys-power/nut/nut-9999.ebuild
index a56635519b2d..22a0e6bc597a 100644
--- a/sys-power/nut/nut-9999.ebuild
+++ b/sys-power/nut/nut-9999.ebuild
@@ -24,7 +24,7 @@ S="${WORKDIR}/${MY_P}"
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="gpio cgi doc ipmi serial i2c +man snmp +usb modbus selinux split-usr ssl tcpd test xml zeroconf python monitor systemd"
+IUSE="gpio cgi doc ipmi serial i2c +man snmp +usb modbus selinux ssl tcpd test xml zeroconf python monitor systemd"
 RESTRICT="!test? ( test )"
 
 REQUIRED_USE="
@@ -170,7 +170,6 @@ src_install() {
 	find "${ED}" -name '*.la' -delete || die
 
 	dodir /sbin
-	use split-usr && dosym ../usr/sbin/upsdrvctl /sbin/upsdrvctl
 
 	if use cgi; then
 		elog "CGI monitoring scripts are installed in ${EPREFIX}/usr/share/nut/cgi."


             reply	other threads:[~2024-01-01  0:12 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-01  0:12 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-02-25  8:49 [gentoo-commits] repo/gentoo:master commit in: sys-power/nut/ Sam James
2025-01-24  8:14 Sam James
2024-10-12 11:22 Michał Górny
2024-10-12 10:08 Michał Górny
2024-10-12  7:52 Michał Górny
2024-05-29 18:27 Robin H. Johnson
2024-05-27 21:08 Robin H. Johnson
2024-05-27 21:08 Robin H. Johnson
2024-02-06  6:54 Sam James
2024-02-06  6:47 Sam James
2024-02-06  6:25 Sam James
2024-02-06  6:25 Sam James
2024-01-17  2:46 Ionen Wolkens
2023-12-18 13:36 Joonas Niilola
2023-12-18  1:09 Sam James
2023-12-18  0:11 Sam James
2023-12-11 13:04 Joonas Niilola
2023-08-09  3:34 Sam James
2023-06-24  1:18 Sam James
2023-06-17 17:11 Arthur Zamarin
2023-06-17 17:11 Arthur Zamarin
2023-06-17 15:48 Arthur Zamarin
2023-06-17 10:33 Yixun Lan
2023-06-17  3:56 Sam James
2023-06-17  3:55 Sam James
2023-06-17  3:19 Sam James
2022-06-21 18:21 Arthur Zamarin
2021-09-21 21:57 Marek Szuba
2021-08-18 14:28 Sam James
2021-08-04 19:37 Sam James
2021-07-09 22:36 Conrad Kostecki
2021-07-09 22:36 Conrad Kostecki
2020-08-30  1:17 Sam James
2020-08-22 15:51 Michał Górny
2020-08-11 18:46 Sam James
2020-08-10 14:33 Agostino Sarubbo
2020-08-07 18:51 Sam James
2020-02-19 18:24 Robin H. Johnson
2020-02-09 16:42 Michał Górny
2020-01-08 22:27 David Seifert
2020-01-08 22:27 David Seifert
2019-08-20 11:47 Louis Sautier
2019-08-13 12:10 Michał Górny
2019-07-29 10:45 Mikle Kolyada
2019-07-02  8:28 Sergei Trofimovich
2019-07-02  8:24 Sergei Trofimovich
2019-06-29 13:03 Agostino Sarubbo
2019-06-28 15:21 Agostino Sarubbo
2018-11-18 15:27 Thomas Deutschmann
2018-11-14 18:23 Robin H. Johnson
2018-10-27 19:02 Andreas Sturmlechner
2018-03-15 16:13 Mikle Kolyada
2018-01-15 19:03 Tobias Klausmann
2018-01-08 22:50 Thomas Deutschmann
2018-01-08 22:24 Sergei Trofimovich
2017-12-08 22:34 Matt Thode
2017-11-26 23:26 David Seifert
2017-03-21 12:57 Michael Weber
2016-12-20 18:21 Thomas Deutschmann
2016-12-20 17:31 Tobias Klausmann
2016-10-02 12:37 Pacho Ramos
2016-03-18 19:11 Michał Górny
2015-09-03  4:53 Matt Thode

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1704067933.53b5eaaeadda10e7c5591a9ff9452e9dde21af78.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox