Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-power/apcupsd/, sys-power/apcupsd/files/
Date: Thu, 13 May 2021 22:11:09
Message-Id: 1620943836.6aa3d5ec033c67cf9f644e8b50c10b9179a0af80.soap@gentoo
1 commit: 6aa3d5ec033c67cf9f644e8b50c10b9179a0af80
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 13 22:10:36 2021 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Thu May 13 22:10:36 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6aa3d5ec
7
8 sys-power/apcupsd: Remove old 3.14.14-r2
9
10 Package-Manager: Portage-3.0.18, Repoman-3.0.3
11 Signed-off-by: David Seifert <soap <AT> gentoo.org>
12
13 sys-power/apcupsd/apcupsd-3.14.14-r2.ebuild | 137 ----------------------------
14 sys-power/apcupsd/files/apcupsd.init.4 | 48 ----------
15 2 files changed, 185 deletions(-)
16
17 diff --git a/sys-power/apcupsd/apcupsd-3.14.14-r2.ebuild b/sys-power/apcupsd/apcupsd-3.14.14-r2.ebuild
18 deleted file mode 100644
19 index 85882863d8e..00000000000
20 --- a/sys-power/apcupsd/apcupsd-3.14.14-r2.ebuild
21 +++ /dev/null
22 @@ -1,137 +0,0 @@
23 -# Copyright 1999-2021 Gentoo Authors
24 -# Distributed under the terms of the GNU General Public License v2
25 -
26 -EAPI=6
27 -
28 -inherit linux-info flag-o-matic systemd udev tmpfiles
29 -
30 -DESCRIPTION="APC UPS daemon with integrated tcp/ip remote shutdown"
31 -HOMEPAGE="http://www.apcupsd.org/"
32 -SRC_URI="mirror://sourceforge/apcupsd/${P}.tar.gz"
33 -
34 -LICENSE="GPL-2"
35 -SLOT="0"
36 -KEYWORDS="amd64 ~arm ppc x86"
37 -IUSE="snmp +usb +modbus cgi gnome kernel_linux"
38 -
39 -DEPEND="
40 - >=sys-apps/util-linux-2.23[tty-helpers(-)]
41 - modbus? ( usb? ( virtual/libusb:0 ) )
42 - cgi? ( >=media-libs/gd-1.8.4 )
43 - snmp? ( >=net-analyzer/net-snmp-5.7.2 )
44 - gnome? ( >=x11-libs/gtk+-2.4.0:2
45 - dev-libs/glib:2
46 - >=gnome-base/gconf-2.0 )"
47 -RDEPEND="${DEPEND}
48 - virtual/mailx"
49 -
50 -CONFIG_CHECK="~USB_HIDDEV ~HIDRAW"
51 -ERROR_USB_HIDDEV="CONFIG_USB_HIDDEV: needed to access USB-attached UPSes"
52 -ERROR_HIDRAW="CONFIG_HIDRAW: needed to access USB-attached UPSes"
53 -
54 -DOCS=( ChangeLog ReleaseNotes )
55 -HTML_DOCS=( doc/manual )
56 -PATCHES=( "${FILESDIR}/${PN}-3.14.9-aliasing.patch" )
57 -
58 -pkg_setup() {
59 - if use kernel_linux && use usb && linux_config_exists; then
60 - check_extra_config
61 - fi
62 -}
63 -
64 -src_configure() {
65 - local myconf
66 - use cgi && myconf="${myconf} --enable-cgi --with-cgi-bin=/usr/libexec/${PN}/cgi-bin"
67 - if use usb; then
68 - myconf="${myconf} --with-upstype=usb --with-upscable=usb --enable-usb --with-dev= "
69 - use modbus && myconf="${myconf} --enable-modbus-usb"
70 - else
71 - myconf="${myconf} --with-upstype=apcsmart --with-upscable=smart --disable-usb"
72 - use modbus || myconf="${myconf} --disable-modbus"
73 - fi
74 -
75 - # We force the DISTNAME to gentoo so it will use gentoo's layout also
76 - # when installed on non-linux systems.
77 - econf \
78 - --sbindir=/sbin \
79 - --sysconfdir=/etc/apcupsd \
80 - --with-pwrfail-dir=/etc/apcupsd \
81 - --with-lock-dir=/run/apcupsd \
82 - --with-pid-dir=/run/apcupsd \
83 - --with-log-dir=/var/log \
84 - --with-nis-port=3551 \
85 - --enable-net --enable-pcnet \
86 - --with-distname=gentoo \
87 - $(use_enable snmp) \
88 - $(use_enable gnome gapcmon) \
89 - ${myconf} \
90 - APCUPSD_MAIL=$(type -p mail)
91 -}
92 -
93 -src_compile() {
94 - # Workaround for bug #280674; upstream should really just provide
95 - # the text files in the distribution, but I wouldn't count on them
96 - # doing that anytime soon.
97 - MANPAGER=$(type -p cat) \
98 - emake
99 -}
100 -
101 -src_install() {
102 - emake DESTDIR="${D}" install
103 - rm -f "${D}"/etc/init.d/halt || die
104 -
105 - insinto /etc/apcupsd
106 - newins examples/safe.apccontrol safe.apccontrol
107 - doins "${FILESDIR}"/apcupsd.conf
108 -
109 - doman doc/*.8 doc/*.5
110 -
111 - einstalldocs
112 -
113 - rm "${D}"/etc/init.d/apcupsd || die
114 - newinitd "${FILESDIR}/${PN}.init.4" "${PN}"
115 - newinitd "${FILESDIR}/${PN}.powerfail.init" "${PN}".powerfail
116 -
117 - systemd_dounit "${FILESDIR}"/${PN}.service
118 - dotmpfiles "${FILESDIR}"/${PN}-tmpfiles.conf
119 -
120 - # remove hal settings, we don't really want to have it around still.
121 - rm -r "${D}"/usr/share/hal || die
122 -
123 - # replace it with our udev rules if we're in Linux
124 - if use kernel_linux; then
125 - udev_newrules "${FILESDIR}"/apcupsd-udev.rules 60-${PN}.rules
126 - fi
127 -
128 -}
129 -
130 -pkg_postinst() {
131 - tmpfiles_process ${PN}-tmpfiles.conf
132 -
133 - if use cgi; then
134 - elog "The cgi-bin directory for ${PN} is /usr/libexec/${PN}/cgi-bin."
135 - elog "Set up your ScriptAlias or symbolic links accordingly."
136 - fi
137 -
138 - elog ""
139 - elog "Since version 3.14.0 you can use multiple apcupsd instances to"
140 - elog "control more than one UPS in a single box with openRC."
141 - elog "To do this, create a link between /etc/init.d/apcupsd to a new"
142 - elog "/etc/init.d/apcupsd.something, and it will then load the"
143 - elog "configuration file at /etc/apcupsd/something.conf."
144 - elog ""
145 -
146 - elog 'If you want apcupsd to power off your UPS when it'
147 - elog 'shuts down your system in a power failure, you must'
148 - elog 'add apcupsd.powerfail to your shutdown runlevel:'
149 - elog ''
150 - elog ' \e[01m rc-update add apcupsd.powerfail shutdown \e[0m'
151 - elog ''
152 -
153 - if use kernel_linux; then
154 - elog "Starting from version 3.14.9-r1, ${PN} installs udev rules"
155 - elog "for persistent device naming. If you have multiple UPS"
156 - elog "connected to the machine, you can point them to the devices"
157 - elog "in /dev/apcups/by-id directory."
158 - fi
159 -}
160
161 diff --git a/sys-power/apcupsd/files/apcupsd.init.4 b/sys-power/apcupsd/files/apcupsd.init.4
162 deleted file mode 100644
163 index ebd6b9755d4..00000000000
164 --- a/sys-power/apcupsd/files/apcupsd.init.4
165 +++ /dev/null
166 @@ -1,48 +0,0 @@
167 -#!/sbin/openrc-run
168 -# Copyright 1999-2013 Gentoo Foundation
169 -# Distributed under the terms of the GNU General Public License v2
170 -
171 -INSTANCE="${SVCNAME#*.}"
172 -if [ -z "${INSTANCE}" ] || [ "${SVCNAME}" = "apcupsd" ]; then
173 - INSTANCE="apcupsd"
174 -fi
175 -
176 -dir="/run/apcupsd"
177 -
178 -depend() {
179 - use net
180 -}
181 -
182 -start_pre() {
183 - checkpath -d -m 0775 -o root:uucp ${dir}
184 -}
185 -
186 -start() {
187 - rm -f /etc/apcupsd/powerfail
188 -
189 - export SERVICE="${SVCNAME}"
190 -
191 - if [ ! -d "${dir}" ]; then
192 - einfo " Creating ${dir}"
193 - /bin/mkdir -p "${dir}"
194 - /bin/chown root:uucp "${dir}"
195 - fi
196 -
197 - ebegin "Starting APC UPS daemon"
198 - start-stop-daemon \
199 - --start --pidfile "${dir}/${SVCNAME}.pid" \
200 - --exec /sbin/apcupsd -- \
201 - -f "/etc/apcupsd/${INSTANCE}.conf" \
202 - -P "${dir}/${SVCNAME}.pid"
203 - eend $?
204 -}
205 -
206 -stop() {
207 - ebegin "Stopping APC UPS daemon"
208 - start-stop-daemon \
209 - --stop --pidfile "${dir}/${SVCNAME}.pid" \
210 - --retry TERM/5/TERM/5 \
211 - --exec /sbin/apcupsd
212 - eend $?
213 -}
214 -