Gentoo Archives: gentoo-commits

From: "Pacho Ramos (pacho)" <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-power/apcupsd: apcupsd-3.14.10-r2.ebuild ChangeLog
Date: Sat, 31 Aug 2013 12:46:24
Message-Id: 20130831124620.AFBAA2004C@flycatcher.gentoo.org
1 pacho 13/08/31 12:46:20
2
3 Modified: ChangeLog
4 Added: apcupsd-3.14.10-r2.ebuild
5 Log:
6 Add unit file (#480298 by Billy DeVincentis)
7
8 (Portage version: 2.2.1/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)
9
10 Revision Changes Path
11 1.83 sys-power/apcupsd/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/apcupsd/ChangeLog?rev=1.83&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/apcupsd/ChangeLog?rev=1.83&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/apcupsd/ChangeLog?r1=1.82&r2=1.83
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sys-power/apcupsd/ChangeLog,v
20 retrieving revision 1.82
21 retrieving revision 1.83
22 diff -u -r1.82 -r1.83
23 --- ChangeLog 26 Mar 2013 14:54:47 -0000 1.82
24 +++ ChangeLog 31 Aug 2013 12:46:20 -0000 1.83
25 @@ -1,6 +1,12 @@
26 # ChangeLog for sys-power/apcupsd
27 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/ChangeLog,v 1.82 2013/03/26 14:54:47 floppym Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/ChangeLog,v 1.83 2013/08/31 12:46:20 pacho Exp $
30 +
31 +*apcupsd-3.14.10-r2 (31 Aug 2013)
32 +
33 + 31 Aug 2013; Pacho Ramos <pacho@g.o> +apcupsd-3.14.10-r2.ebuild,
34 + +files/apcupsd-tmpfiles.conf, +files/apcupsd.service:
35 + Add unit file (#480298 by Billy DeVincentis)
36
37 26 Mar 2013; Mike Gilbert <floppym@g.o> apcupsd-3.14.10-r1.ebuild:
38 Use udev.eclass for udev rules installation.
39
40
41
42 1.1 sys-power/apcupsd/apcupsd-3.14.10-r2.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/apcupsd/apcupsd-3.14.10-r2.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/apcupsd/apcupsd-3.14.10-r2.ebuild?rev=1.1&content-type=text/plain
46
47 Index: apcupsd-3.14.10-r2.ebuild
48 ===================================================================
49 # Copyright 1999-2013 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/sys-power/apcupsd/apcupsd-3.14.10-r2.ebuild,v 1.1 2013/08/31 12:46:20 pacho Exp $
52
53 EAPI=4
54
55 inherit eutils linux-info flag-o-matic systemd udev
56
57 DESCRIPTION="APC UPS daemon with integrated tcp/ip remote shutdown"
58 HOMEPAGE="http://www.apcupsd.org/"
59 SRC_URI="mirror://sourceforge/apcupsd/${P}.tar.gz"
60
61 LICENSE="GPL-2"
62 SLOT="0"
63 KEYWORDS="~amd64 ~arm ~ppc ~x86 ~x86-fbsd"
64 IUSE="snmp +usb cgi nls gnome kernel_linux"
65
66 DEPEND="
67 cgi? ( >=media-libs/gd-1.8.4 )
68 nls? ( sys-devel/gettext )
69 snmp? ( net-analyzer/net-snmp )
70 gnome? ( >=x11-libs/gtk+-2.4.0:2
71 dev-libs/glib:2
72 >=gnome-base/gconf-2.0 )"
73 RDEPEND="${DEPEND}
74 sys-apps/openrc
75 virtual/mailx"
76
77 CONFIG_CHECK="~USB_HIDDEV ~HIDRAW"
78 ERROR_USB_HIDDEV="CONFIG_USB_HIDDEV: needed to access USB-attached UPSes"
79 ERROR_HIDRAW="CONFIG_HIDRAW: needed to access USB-attached UPSes"
80
81 pkg_setup() {
82 if use kernel_linux && use usb && linux_config_exists; then
83 check_extra_config
84 fi
85 }
86
87 src_prepare() {
88 epatch "${FILESDIR}/${PN}-3.14.9-aliasing.patch"
89 }
90
91 src_configure() {
92 local myconf
93 use cgi && myconf="${myconf} --enable-cgi --with-cgi-bin=/usr/libexec/${PN}/cgi-bin"
94 if use usb; then
95 myconf="${myconf} --with-upstype=usb --with-upscable=usb --enable-usb --with-dev= "
96 else
97 myconf="${myconf} --with-upstype=apcsmart --with-upscable=smart --disable-usb"
98 fi
99
100 # We force the DISTNAME to gentoo so it will use gentoo's layout also
101 # when installed on non-linux systems.
102 econf \
103 --sbindir=/sbin \
104 --sysconfdir=/etc/apcupsd \
105 --with-pwrfail-dir=/etc/apcupsd \
106 --with-lock-dir=/var/lock \
107 --with-pid-dir=/var/run \
108 --with-log-dir=/var/log \
109 --with-nis-port=3551 \
110 --enable-net --enable-pcnet \
111 --with-distname=gentoo \
112 $(use_enable snmp net-snmp) \
113 $(use_enable gnome gapcmon) \
114 ${myconf} \
115 APCUPSD_MAIL=/bin/mail
116 }
117
118 src_compile() {
119 # Workaround for bug #280674; upstream should really just provide
120 # the text files in the distribution, but I wouldn't count on them
121 # doing that anytime soon.
122 MANPAGER=$(type -p cat) \
123 emake || die "emake failed"
124 }
125
126 src_install() {
127 emake DESTDIR="${D}" install || die "installed failed"
128 rm -f "${D}"/etc/init.d/halt
129
130 insinto /etc/apcupsd
131 newins examples/safe.apccontrol safe.apccontrol
132
133 dodoc ChangeLog* ReleaseNotes
134 doman doc/*.8 doc/*.5
135
136 dohtml -r doc/manual/*
137
138 rm "${D}"/etc/init.d/apcupsd
139 newinitd "${FILESDIR}/${PN}.init.3" "${PN}"
140 newinitd "${FILESDIR}/${PN}.powerfail.init" "${PN}".powerfail
141 systemd_dounit "${FILESDIR}"/${PN}.service
142 systemd_dotmpfilesd "${FILESDIR}"/${PN}-tmpfiles.conf
143
144 # remove hal settings, we don't really want to have it around still.
145 rm -r "${D}"/usr/share/hal
146
147 # replace it with our udev rules if we're in Linux
148 if use kernel_linux; then
149 udev_newrules "${FILESDIR}"/apcupsd-udev.rules 60-${PN}.rules
150 fi
151
152 # Without this it'll crash at startup. When merging in ROOT= this
153 # won't be created by default, so we want to make sure we got it!
154 keepdir /var/lock
155 fowners root:uucp /var/lock
156 fperms 0775 /var/lock
157 }
158
159 pkg_postinst() {
160 if use cgi; then
161 elog "The cgi-bin directory for ${PN} is /usr/libexec/${PN}/cgi-bin."
162 elog "Set up your ScriptAlias or symbolic links accordingly."
163 fi
164
165 elog ""
166 elog "Since version 3.14.0 you can use multiple apcupsd instances to"
167 elog "control more than one UPS in a single box with openRC."
168 elog "To do this, create a link between /etc/init.d/apcupsd to a new"
169 elog "/etc/init.d/apcupsd.something, and it will then load the"
170 elog "configuration file at /etc/apcupsd/something.conf."
171 elog ""
172
173 elog 'If you want apcupsd to power off your UPS when it'
174 elog 'shuts down your system in a power failure, you must'
175 elog 'add apcupsd.powerfail to your shutdown runlevel:'
176 elog ''
177 elog ' \e[01m rc-update add apcupsd.powerfail shutdown \e[0m'
178 elog ''
179
180 if use kernel_linux; then
181 elog "Starting from version 3.14.9-r1, ${PN} installs udev rules"
182 elog "for persistent device naming. If you have multiple UPS"
183 elog "connected to the machine, you can point them to the devices"
184 elog "in /dev/apcups/by-id directory."
185 fi
186 }