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