Gentoo Archives: gentoo-commits

From: "Samuli Suominen (ssuominen)" <ssuominen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-power/nut: ChangeLog nut-2.6.0-r1.ebuild nut-2.6.0.ebuild
Date: Sat, 02 Apr 2011 15:07:31
Message-Id: 20110402150700.5F57120054@flycatcher.gentoo.org
1 ssuominen 11/04/02 15:07:00
2
3 Modified: ChangeLog
4 Added: nut-2.6.0-r1.ebuild
5 Removed: nut-2.6.0.ebuild
6 Log:
7 Rename @LIBSSL_LDFLAGS@ to @LIBSSL_LIBS@ in libupsclient.pc.in wrt #361685 by Bruno.
8
9 (Portage version: 2.2.0_alpha29/cvs/Linux x86_64, RepoMan options: --force)
10
11 Revision Changes Path
12 1.90 sys-power/nut/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/nut/ChangeLog?rev=1.90&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/nut/ChangeLog?rev=1.90&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/nut/ChangeLog?r1=1.89&r2=1.90
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/sys-power/nut/ChangeLog,v
21 retrieving revision 1.89
22 retrieving revision 1.90
23 diff -u -r1.89 -r1.90
24 --- ChangeLog 27 Mar 2011 19:28:52 -0000 1.89
25 +++ ChangeLog 2 Apr 2011 15:07:00 -0000 1.90
26 @@ -1,6 +1,12 @@
27 # ChangeLog for sys-power/nut
28 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/ChangeLog,v 1.89 2011/03/27 19:28:52 angelos Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/ChangeLog,v 1.90 2011/04/02 15:07:00 ssuominen Exp $
31 +
32 +*nut-2.6.0-r1 (02 Apr 2011)
33 +
34 + 02 Apr 2011; Samuli Suominen <ssuominen@g.o> +nut-2.6.0-r1.ebuild:
35 + Rename @LIBSSL_LDFLAGS@ to @LIBSSL_LIBS@ in libupsclient.pc.in wrt #361685 by
36 + Bruno.
37
38 27 Mar 2011; Christoph Mende <angelos@g.o> nut-2.6.0.ebuild:
39 Stable on amd64 wrt bug #360739
40
41
42
43 1.1 sys-power/nut/nut-2.6.0-r1.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/nut/nut-2.6.0-r1.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/nut/nut-2.6.0-r1.ebuild?rev=1.1&content-type=text/plain
47
48 Index: nut-2.6.0-r1.ebuild
49 ===================================================================
50 # Copyright 1999-2011 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.6.0-r1.ebuild,v 1.1 2011/04/02 15:07:00 ssuominen Exp $
53
54 EAPI=2
55 inherit autotools bash-completion eutils fixheadtails multilib
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="alpha amd64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
68 IUSE="cgi snmp usb ssl tcpd xml"
69
70 RDEPEND="cgi? ( >=media-libs/gd-2[png] )
71 snmp? ( net-analyzer/net-snmp )
72 usb? ( virtual/libusb:0 )
73 ssl? ( >=dev-libs/openssl-1 )
74 tcpd? ( sys-apps/tcp-wrappers )
75 xml? ( >=net-libs/neon-0.25.0 )
76 >=sys-fs/udev-114"
77 DEPEND="$RDEPEND
78 >=sys-apps/sed-4
79 dev-util/pkgconfig"
80
81 S=${WORKDIR}/${MY_P}
82
83 # public files should be 644 root:root
84 NUT_PUBLIC_FILES="/etc/nut/{ups,upssched}.conf"
85 # private files should be 640 root:nut - readable by nut, writeable by root,
86 NUT_PRIVATE_FILES="/etc/nut/{upsd.conf,upsd.users,upsmon.conf}"
87 # public files should be 644 root:root, only installed if USE=cgi
88 NUT_CGI_FILES="/etc/nut/{{hosts,upsset}.conf,upsstats{,-single}.html}"
89
90 pkg_setup() {
91 enewgroup nut 84
92 enewuser nut 84 -1 /var/lib/nut nut,uucp
93 # As of udev-104, NUT must be in uucp and NOT in tty.
94 gpasswd -d nut tty 2>/dev/null
95 gpasswd -a nut uucp 2>/dev/null
96 # in some cases on old systems it wasn't in the nut group either!
97 gpasswd -a nut nut 2>/dev/null
98 warningmsg ewarn
99 }
100
101 src_prepare() {
102 ht_fix_file configure.in
103
104 epatch "${FILESDIR}"/${PN}-2.4.1-no-libdummy.patch
105 epatch "${FILESDIR}"/${PN}-2.4.3-lowspeed-buffer-size.patch
106
107 sed -e "s:GD_LIBS.*=.*-L/usr/X11R6/lib \(.*\) -lXpm -lX11:GD_LIBS=\"\1:" \
108 -i configure.in || die
109
110 sed -e "s:52.nut-usbups.rules:70-nut-usbups.rules:" \
111 -i scripts/udev/Makefile.am || die
112
113 rm -f ltmain.sh m4/lt* m4/libtool.m4
114
115 sed -i \
116 -e 's:@LIBSSL_LDFLAGS@:@LIBSSL_LIBS@:' \
117 lib/libupsclient{.pc,-config}.in || die #361685
118
119 eautoreconf
120 }
121
122 src_configure() {
123 local myconf
124
125 if [ -n "${NUT_DRIVERS}" ]; then
126 myconf="${myconf} --with-drivers=${NUT_DRIVERS// /,}"
127 fi
128
129 use cgi && myconf="${myconf} --with-cgipath=/usr/share/nut/cgi"
130
131 # TODO: USE flag for sys-power/powerman
132 econf \
133 --sysconfdir=/etc/nut \
134 --datarootdir=/usr/share/nut \
135 --datadir=/usr/share/nut \
136 --disable-static \
137 --with-dev \
138 $(use_with usb) \
139 --without-hal \
140 $(use_with snmp) \
141 $(use_with xml neon) \
142 --without-powerman \
143 $(use_with ssl) \
144 $(use_with tcpd wrap) \
145 $(use_with cgi) \
146 --with-statepath=/var/lib/nut \
147 --with-drvpath=/$(get_libdir)/nut \
148 --with-htmlpath=/usr/share/nut/html \
149 --with-user=nut \
150 --with-group=nut \
151 --with-logfacility=LOG_DAEMON \
152 ${myconf}
153 }
154
155 src_install() {
156 emake DESTDIR="${D}" install || die
157
158 find "${D}" -name '*.la' -exec rm -f {} +
159
160 dodir /sbin
161 dosym /$(get_libdir)/nut/upsdrvctl /sbin/upsdrvctl
162 # This needs to exist for the scripts
163 dosym /$(get_libdir)/nut/upsdrvctl /usr/sbin/upsdrvctl
164
165 if use cgi; then
166 elog "CGI monitoring scripts are installed in /usr/share/nut/cgi."
167 elog "copy them to your web server's ScriptPath to activate (this is a"
168 elog "change from the old location)."
169 elog "If you use lighttpd, see lighttpd_nut.conf in the documentation."
170 fi
171
172 # this must be done after all of the install phases
173 for i in "${D}"/etc/nut/*.sample ; do
174 mv "${i}" "${i/.sample/}"
175 done
176
177 dodoc AUTHORS ChangeLog docs/*.txt MAINTAINERS NEWS README TODO UPGRADING || die
178
179 newdoc lib/README README.lib || die
180 newdoc "${FILESDIR}"/lighttpd_nut.conf-2.2.0 lighttpd_nut.conf || die
181
182 docinto cables
183 dodoc docs/cables/* || die
184
185 newinitd "${FILESDIR}"/nut-2.2.2-init.d-upsd upsd || die
186 newinitd "${FILESDIR}"/nut-2.2.2-init.d-upsdrv upsdrv || die
187 newinitd "${FILESDIR}"/nut-2.2.2-init.d-upsmon upsmon || die
188 newinitd "${FILESDIR}"/nut.powerfail.initd nut.powerfail || die
189
190 keepdir /var/lib/nut
191
192 einfo "Setting up permissions on files and directories"
193 fperms 0700 /var/lib/nut
194 fowners nut:nut /var/lib/nut
195
196 # Do not remove eval here, because the variables contain shell expansions.
197 eval fperms 0640 ${NUT_PRIVATE_FILES}
198 eval fowners root:nut ${NUT_PRIVATE_FILES}
199
200 # Do not remove eval here, because the variables contain shell expansions.
201 eval fperms 0644 ${NUT_PUBLIC_FILES}
202 eval fowners root:root ${NUT_PUBLIC_FILES}
203
204 # Do not remove eval here, because the variables contain shell expansions.
205 if use cgi; then
206 eval fperms 0644 ${NUT_CGI_FILES}
207 eval fowners root:root ${NUT_CGI_FILES}
208 fi
209
210 # this is installed for 2.4 and fbsd guys
211 if ! has_version sys-fs/udev; then
212 einfo "Installing non-udev hotplug support"
213 insinto /etc/hotplug/usb
214 insopts -m 755
215 doins scripts/hotplug/nut-usbups.hotplug
216 fi
217
218 dobashcompletion "${S}"/scripts/misc/nut.bash_completion
219 }
220
221 pkg_postinst() {
222 # this is to ensure that everybody that installed old versions still has
223 # correct permissions
224
225 chown nut:nut "${ROOT}"/var/lib/nut 2>/dev/null
226 chmod 0700 "${ROOT}"/var/lib/nut 2>/dev/null
227
228 # Do not remove eval here, because the variables contain shell expansions.
229 eval chown root:nut "${ROOT}"${NUT_PRIVATE_FILES} 2>/dev/null
230 eval chmod 0640 "${ROOT}"${NUT_PRIVATE_FILES} 2>/dev/null
231
232 # Do not remove eval here, because the variables contain shell expansions.
233 eval chown root:root "${ROOT}"${NUT_PUBLIC_FILES} 2>/dev/null
234 eval chmod 0644 "${ROOT}"${NUT_PUBLIC_FILES} 2>/dev/null
235
236 # Do not remove eval here, because the variables contain shell expansions.
237 if use cgi; then
238 eval chown root:root "${ROOT}"${NUT_CGI_FILES} 2>/dev/null
239 eval chmod 0644 "${ROOT}"${NUT_CGI_FILES} 2>/dev/null
240 fi
241
242 warningmsg elog
243 }
244
245 warningmsg() {
246 msgfunc="$1"
247 [ -z "$msgfunc" ] && die "msgfunc not specified in call to warningmsg!"
248 ${msgfunc} "Please note that NUT now runs under the 'nut' user."
249 ${msgfunc} "NUT is in the uucp group for access to RS-232 UPS."
250 ${msgfunc} "However if you use a USB UPS you may need to look at the udev or"
251 ${msgfunc} "hotplug rules that are installed, and alter them suitably."
252 ${msgfunc} ''
253 ${msgfunc} "You are strongly advised to read the UPGRADING file provided by upstream."
254 ${msgfunc} ''
255 ${msgfunc} "Please note that upsdrv is NOT automatically started by upsd anymore."
256 ${msgfunc} "If you have multiple UPS units, you can use their NUT names to"
257 ${msgfunc} "have a service per UPS:"
258 ${msgfunc} "ln -s /etc/init.d/upsdrv /etc/init.d/upsdrv.\$UPSNAME"
259 ${msgfunc} ''
260 ${msgfunc} 'If you want apcupsd to power off your UPS when it'
261 ${msgfunc} 'shuts down your system in a power failure, you must'
262 ${msgfunc} 'add nut.powerfail to your shutdown runlevel:'
263 ${msgfunc} ''
264 ${msgfunc} 'rc-update add nut.powerfail shutdown'
265 ${msgfunc} ''
266
267 }