Gentoo Archives: gentoo-commits

From: "Matt Thode (prometheanfire)" <prometheanfire@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-power/nut: nut-2.7.2-r1.ebuild ChangeLog nut-2.7.2.ebuild
Date: Wed, 30 Jul 2014 05:35:25
Message-Id: 20140730053518.D55AB2004E@flycatcher.gentoo.org
1 prometheanfire 14/07/30 05:35:17
2
3 Modified: ChangeLog
4 Added: nut-2.7.2-r1.ebuild
5 Removed: nut-2.7.2.ebuild
6 Log:
7 fixing bug 517954
8
9 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key 0x2471eb3e40ac5ac3)
10
11 Revision Changes Path
12 1.116 sys-power/nut/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/nut/ChangeLog?rev=1.116&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/nut/ChangeLog?rev=1.116&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/nut/ChangeLog?r1=1.115&r2=1.116
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/sys-power/nut/ChangeLog,v
21 retrieving revision 1.115
22 retrieving revision 1.116
23 diff -u -r1.115 -r1.116
24 --- ChangeLog 24 Jul 2014 04:42:46 -0000 1.115
25 +++ ChangeLog 30 Jul 2014 05:35:17 -0000 1.116
26 @@ -1,6 +1,12 @@
27 # ChangeLog for sys-power/nut
28 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/ChangeLog,v 1.115 2014/07/24 04:42:46 prometheanfire Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/ChangeLog,v 1.116 2014/07/30 05:35:17 prometheanfire Exp $
31 +
32 +*nut-2.7.2-r1 (30 Jul 2014)
33 +
34 + 30 Jul 2014; Matthew Thode <prometheanfire@g.o> +nut-2.7.2-r1.ebuild,
35 + -nut-2.7.2.ebuild:
36 + fixing bug 517954
37
38 *nut-2.7.2 (24 Jul 2014)
39
40
41
42
43 1.1 sys-power/nut/nut-2.7.2-r1.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/nut/nut-2.7.2-r1.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/nut/nut-2.7.2-r1.ebuild?rev=1.1&content-type=text/plain
47
48 Index: nut-2.7.2-r1.ebuild
49 ===================================================================
50 # Copyright 1999-2014 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/sys-power/nut/nut-2.7.2-r1.ebuild,v 1.1 2014/07/30 05:35:17 prometheanfire Exp $
53
54 EAPI=5
55 inherit autotools bash-completion-r1 eutils fixheadtails multilib user systemd flag-o-matic toolchain-funcs
56
57 MY_P=${P/_/-}
58
59 DESCRIPTION="Network-UPS Tools"
60 HOMEPAGE="http://www.networkupstools.org/"
61 # Nut mirrors are presently broken
62 SRC_URI="http://random.networkupstools.org/source/${PV%.*}/${MY_P}.tar.gz
63 http://www.networkupstools.org/source/${PV%.*}/${MY_P}.tar.gz"
64
65 LICENSE="GPL-2"
66 SLOT="0"
67 KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~x86-fbsd"
68
69 IUSE="avahi cgi ipmi snmp +usb selinux ssl tcpd xml"
70 RDEPEND="avahi? ( net-dns/avahi )
71 cgi? ( >=media-libs/gd-2[png] )
72 snmp? ( net-analyzer/net-snmp )
73 usb? ( virtual/libusb:0 )
74 selinux? ( sec-policy/selinux-nut )
75 ssl? ( >=dev-libs/openssl-1 )
76 tcpd? ( sys-apps/tcp-wrappers )
77 xml? ( >=net-libs/neon-0.25.0 )
78 ipmi? ( sys-libs/freeipmi )
79 virtual/udev"
80 DEPEND="$RDEPEND
81 >=sys-apps/sed-4
82 virtual/pkgconfig"
83
84 S=${WORKDIR}/${MY_P}
85
86 # Bug #480664 requested UPS_DRIVERS_IUSE for more flexibility in building this package
87 SERIAL_DRIVERLIST="al175 bcmxcp belkin belkinunv bestfcom bestfortress bestuferrups bestups dummy-ups etapro everups gamatronic genericups isbmex liebert liebert-esp2 masterguard metasys oldmge-shut mge-utalk microdowell mge-shut oneac optiups powercom rhino safenet solis tripplite tripplitesu upscode2 victronups powerpanel blazer_ser clone clone-outlet ivtscd apcsmart apcsmart-old apcupsd-ups riello_ser nutdrv_qx"
88 SNMP_DRIVERLIST="snmp-ups"
89 USB_LIBUSB_DRIVERLIST="usbhid-ups bcmxcp_usb tripplite_usb blazer_usb richcomm_usb riello_usb nutdrv_qx"
90 USB_DRIVERLIST=${USB_LIBUSB_DRIVERLIST}
91 #HAL_DRIVERLIST="usbhid-ups bcmxcp_usb tripplite_usb blazer_usb riello_usb nutdrv_qx"
92 NEONXML_DRIVERLIST="netxml-ups"
93 IPMI_DRIVERLIST="nut-ipmipsu"
94 # Now we build from it:
95 for name in ${SERIAL_DRIVERLIST} ; do
96 IUSE_UPS_DRIVERS="${IUSE_UPS_DRIVERS} +ups_drivers_${name}"
97 done
98 for name in ${USB_DRIVERLIST} ; do
99 IUSE_UPS_DRIVERS="${IUSE_UPS_DRIVERS} +ups_drivers_${name}"
100 REQUIRED_USE="${REQUIRED_USE} ups_drivers_${name}? ( usb )"
101 done
102 for name in ${NEONXML_DRIVERLIST}; do
103 IUSE_UPS_DRIVERS="${IUSE_UPS_DRIVERS} ups_drivers_${name}"
104 REQUIRED_USE="${REQUIRED_USE} ups_drivers_${name}? ( xml )"
105 done
106 for name in ${SNMP_DRIVERLIST} ; do
107 IUSE_UPS_DRIVERS="${IUSE_UPS_DRIVERS} ups_drivers_${name}"
108 REQUIRED_USE="${REQUIRED_USE} ups_drivers_${name}? ( snmp )"
109 done
110 for name in ${IPMI_DRIVERLIST} ; do
111 IUSE_UPS_DRIVERS="${IUSE_UPS_DRIVERS} ups_drivers_${name}"
112 REQUIRED_USE="${REQUIRED_USE} ups_drivers_${name}? ( ipmi )"
113 done
114 IUSE="${IUSE} ${IUSE_UPS_DRIVERS}"
115
116 # public files should be 644 root:root
117 NUT_PUBLIC_FILES="/etc/nut/{ups,upssched}.conf"
118 # private files should be 640 root:nut - readable by nut, writeable by root,
119 NUT_PRIVATE_FILES="/etc/nut/{upsd.conf,upsd.users,upsmon.conf}"
120 # public files should be 644 root:root, only installed if USE=cgi
121 NUT_CGI_FILES="/etc/nut/{{hosts,upsset}.conf,upsstats{,-single}.html}"
122
123 pkg_setup() {
124 enewgroup nut 84
125 enewuser nut 84 -1 /var/lib/nut nut,uucp
126 # As of udev-104, NUT must be in uucp and NOT in tty.
127 gpasswd -d nut tty 2>/dev/null
128 gpasswd -a nut uucp 2>/dev/null
129 # in some cases on old systems it wasn't in the nut group either!
130 gpasswd -a nut nut 2>/dev/null
131 warningmsg ewarn
132 }
133
134 src_prepare() {
135 #ht_fix_file configure.in
136
137 epatch "${FILESDIR}/nut-2.7.2/nut-2.7.2-no-libdummy.patch"
138 epatch "${FILESDIR}"/${PN}-2.6.2-lowspeed-buffer-size.patch
139 #epatch "${FILESDIR}"/${PN}-2.6.3-CVE-2012-2944.patch
140 #epatch "${FILESDIR}"/${PN}-2.6.5-freeipmi_fru.patch
141 epatch "${FILESDIR}"/${PN}-2.7.1-fix-scanning.patch
142 epatch "${FILESDIR}"/${PN}-2.7.1-snmpusb-order.patch
143
144 #sed -e "s:GD_LIBS.*=.*-L/usr/X11R6/lib \(.*\) -lXpm -lX11:GD_LIBS=\"\1:" \
145 # -e '/systemdsystemunitdir=.*echo.*sed.*libdir/s,^,#,g' \
146 # -i configure.in || die
147
148 sed -e "s:52.nut-usbups.rules:70-nut-usbups.rules:" \
149 -i scripts/udev/Makefile.am || die
150
151 rm -f ltmain.sh m4/lt* m4/libtool.m4
152
153 sed -i \
154 -e 's:@LIBSSL_LDFLAGS@:@LIBSSL_LIBS@:' \
155 lib/libupsclient{.pc,-config}.in || die #361685
156
157 # This file appears twice in the install list, and if both install rules
158 # trigger simultaneously during parallel-make, it fails.
159 sed -i \
160 -e '/nodist_sysconf_DATA/s,upsmon.conf.sample,,g' \
161 conf/Makefile.am || die
162
163 eautoreconf
164 }
165
166 src_configure() {
167 local myconf
168 append-flags -fno-lto
169 tc-export CC
170 tc-export CXX
171 tc-export AR
172
173 local UPS_DRIVERS=""
174 for u in $USE ; do
175 u2=${u#ups_drivers_}
176 [[ "${u}" != "${u2}" ]] && UPS_DRIVERS="${UPS_DRIVERS} ${u2}"
177 done
178 UPS_DRIVERS="${UPS_DRIVERS# }" UPS_DRIVERS="${UPS_DRIVERS% }"
179 myconf="${myconf} --with-drivers=${UPS_DRIVERS// /,}"
180
181 use cgi && myconf="${myconf} --with-cgipath=/usr/share/nut/cgi"
182
183 # TODO: USE flag for sys-power/powerman
184 econf \
185 --sysconfdir=/etc/nut \
186 --datarootdir=/usr/share/nut \
187 --datadir=/usr/share/nut \
188 --disable-static \
189 --with-statepath=/var/lib/nut \
190 --with-drvpath=/$(get_libdir)/nut \
191 --with-htmlpath=/usr/share/nut/html \
192 --with-user=nut \
193 --with-group=nut \
194 --with-logfacility=LOG_DAEMON \
195 --with-dev \
196 --with-serial \
197 --without-powerman \
198 $(use_with avahi) \
199 $(use_with cgi) \
200 $(use_with ipmi) \
201 $(use_with ipmi freeipmi) \
202 $(use_with snmp) \
203 $(use_with ssl) \
204 $(use_with tcpd wrap) \
205 $(use_with usb) \
206 $(use_with xml neon) \
207 $(systemd_with_unitdir) \
208 ${myconf}
209 }
210
211 src_install() {
212 emake DESTDIR="${D}" install || die
213
214 find "${D}" -name '*.la' -exec rm -f {} +
215
216 dodir /sbin
217 dosym /usr/sbin/upsdrvctl /sbin/upsdrvctl
218
219 if use cgi; then
220 elog "CGI monitoring scripts are installed in /usr/share/nut/cgi."
221 elog "copy them to your web server's ScriptPath to activate (this is a"
222 elog "change from the old location)."
223 elog "If you use lighttpd, see lighttpd_nut.conf in the documentation."
224 fi
225
226 # this must be done after all of the install phases
227 for i in "${D}"/etc/nut/*.sample ; do
228 mv "${i}" "${i/.sample/}"
229 done
230
231 dodoc AUTHORS ChangeLog docs/*.txt MAINTAINERS NEWS README TODO UPGRADING || die
232
233 newdoc lib/README README.lib || die
234 newdoc "${FILESDIR}"/lighttpd_nut.conf-2.2.0 lighttpd_nut.conf || die
235
236 docinto cables
237 dodoc docs/cables/* || die
238
239 newinitd "${FILESDIR}"/nut-2.6.5-init.d-upsd upsd || die
240 newinitd "${FILESDIR}"/nut-2.2.2-init.d-upsdrv upsdrv || die
241 newinitd "${FILESDIR}"/nut-2.6.5-init.d-upsmon upsmon || die
242 newinitd "${FILESDIR}"/nut-2.6.5-init.d-upslog upslog || die
243 newinitd "${FILESDIR}"/nut.powerfail.initd nut.powerfail || die
244
245 keepdir /var/lib/nut
246
247 einfo "Setting up permissions on files and directories"
248 fperms 0700 /var/lib/nut
249 fowners nut:nut /var/lib/nut
250
251 # Do not remove eval here, because the variables contain shell expansions.
252 eval fperms 0640 ${NUT_PRIVATE_FILES}
253 eval fowners root:nut ${NUT_PRIVATE_FILES}
254
255 # Do not remove eval here, because the variables contain shell expansions.
256 eval fperms 0644 ${NUT_PUBLIC_FILES}
257 eval fowners root:root ${NUT_PUBLIC_FILES}
258
259 # Do not remove eval here, because the variables contain shell expansions.
260 if use cgi; then
261 eval fperms 0644 ${NUT_CGI_FILES}
262 eval fowners root:root ${NUT_CGI_FILES}
263 fi
264
265 # this is installed for 2.4 and fbsd guys
266 if ! has_version virtual/udev; then
267 einfo "Installing non-udev hotplug support"
268 insinto /etc/hotplug/usb
269 insopts -m 755
270 doins scripts/hotplug/nut-usbups.hotplug
271 fi
272
273 dobashcomp "${S}"/scripts/misc/nut.bash_completion
274 }
275
276 pkg_postinst() {
277 # this is to ensure that everybody that installed old versions still has
278 # correct permissions
279
280 chown nut:nut "${ROOT}"/var/lib/nut 2>/dev/null
281 chmod 0700 "${ROOT}"/var/lib/nut 2>/dev/null
282
283 # Do not remove eval here, because the variables contain shell expansions.
284 eval chown root:nut "${ROOT}"${NUT_PRIVATE_FILES} 2>/dev/null
285 eval chmod 0640 "${ROOT}"${NUT_PRIVATE_FILES} 2>/dev/null
286
287 # Do not remove eval here, because the variables contain shell expansions.
288 eval chown root:root "${ROOT}"${NUT_PUBLIC_FILES} 2>/dev/null
289 eval chmod 0644 "${ROOT}"${NUT_PUBLIC_FILES} 2>/dev/null
290
291 # Do not remove eval here, because the variables contain shell expansions.
292 if use cgi; then
293 eval chown root:root "${ROOT}"${NUT_CGI_FILES} 2>/dev/null
294 eval chmod 0644 "${ROOT}"${NUT_CGI_FILES} 2>/dev/null
295 fi
296
297 warningmsg elog
298 }
299
300 warningmsg() {
301 msgfunc="$1"
302 [ -z "$msgfunc" ] && die "msgfunc not specified in call to warningmsg!"
303 ${msgfunc} "Please note that NUT now runs under the 'nut' user."
304 ${msgfunc} "NUT is in the uucp group for access to RS-232 UPS."
305 ${msgfunc} "However if you use a USB UPS you may need to look at the udev or"
306 ${msgfunc} "hotplug rules that are installed, and alter them suitably."
307 ${msgfunc} ''
308 ${msgfunc} "You are strongly advised to read the UPGRADING file provided by upstream."
309 ${msgfunc} ''
310 ${msgfunc} "Please note that upsdrv is NOT automatically started by upsd anymore."
311 ${msgfunc} "If you have multiple UPS units, you can use their NUT names to"
312 ${msgfunc} "have a service per UPS:"
313 ${msgfunc} "ln -s /etc/init.d/upsdrv /etc/init.d/upsdrv.\$UPSNAME"
314 ${msgfunc} ''
315 ${msgfunc} 'If you want apcupsd to power off your UPS when it'
316 ${msgfunc} 'shuts down your system in a power failure, you must'
317 ${msgfunc} 'add nut.powerfail to your shutdown runlevel:'
318 ${msgfunc} ''
319 ${msgfunc} 'rc-update add nut.powerfail shutdown'
320 ${msgfunc} ''
321
322 }