Gentoo Archives: gentoo-commits

From: "Robin H. Johnson (robbat2)" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-power/nut: ChangeLog nut-2.4.3.ebuild
Date: Sun, 02 May 2010 22:50:56
Message-Id: 20100502225052.0F1CF2C28D@corvid.gentoo.org
1 robbat2 10/05/02 22:50:51
2
3 Modified: ChangeLog
4 Added: nut-2.4.3.ebuild
5 Log:
6 Bug #313883: version bump.
7 (Portage version: 2.2_rc67/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.72 sys-power/nut/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-power/nut/ChangeLog?rev=1.72&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-power/nut/ChangeLog?rev=1.72&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-power/nut/ChangeLog?r1=1.71&r2=1.72
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/sys-power/nut/ChangeLog,v
19 retrieving revision 1.71
20 retrieving revision 1.72
21 diff -p -w -b -B -u -u -r1.71 -r1.72
22 --- ChangeLog 10 Jan 2010 14:22:08 -0000 1.71
23 +++ ChangeLog 2 May 2010 22:50:51 -0000 1.72
24 @@ -1,6 +1,11 @@
25 # ChangeLog for sys-power/nut
26 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/ChangeLog,v 1.71 2010/01/10 14:22:08 flameeyes Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/ChangeLog,v 1.72 2010/05/02 22:50:51 robbat2 Exp $
29 +
30 +*nut-2.4.3 (02 May 2010)
31 +
32 + 02 May 2010; Robin H. Johnson <robbat2@g.o> +nut-2.4.3.ebuild:
33 + Bug #313883: version bump.
34
35 10 Jan 2010; Diego E. Pettenò <flameeyes@g.o> nut-2.4.1-r2.ebuild:
36 Fix obvious typo.
37
38
39
40 1.1 sys-power/nut/nut-2.4.3.ebuild
41
42 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-power/nut/nut-2.4.3.ebuild?rev=1.1&view=markup
43 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-power/nut/nut-2.4.3.ebuild?rev=1.1&content-type=text/plain
44
45 Index: nut-2.4.3.ebuild
46 ===================================================================
47 # Copyright 1999-2010 Gentoo Foundation
48 # Distributed under the terms of the GNU General Public License v2
49 # $Header: /var/cvsroot/gentoo-x86/sys-power/nut/nut-2.4.3.ebuild,v 1.1 2010/05/02 22:50:51 robbat2 Exp $
50
51 EAPI="2"
52
53 inherit eutils fixheadtails autotools bash-completion
54
55 MY_P="${P/_/-}"
56
57 DESCRIPTION="Network-UPS Tools"
58 HOMEPAGE="http://www.networkupstools.org/"
59 # Nut mirrors are presently broken
60 SRC_URI="http://random.networkupstools.org/source/${PV%.*}/${MY_P}.tar.gz
61 http://www.networkupstools.org/source/${PV%.*}/${MY_P}.tar.gz"
62
63 S="${WORKDIR}/${MY_P}"
64
65 LICENSE="GPL-2"
66 SLOT="0"
67 KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86 ~x86-fbsd"
68 IUSE="cgi snmp usb ssl hal xml"
69
70 RDEPEND="cgi? ( >=media-libs/gd-2[png] )
71 snmp? ( net-analyzer/net-snmp )
72 usb? ( =virtual/libusb-0* )
73 hal? ( >=sys-apps/hal-0.5.11 )
74 ssl? ( dev-libs/openssl )
75 xml? ( >=net-misc/neon-0.25.0 )
76 >=sys-fs/udev-114"
77 DEPEND="$RDEPEND
78 >=sys-apps/sed-4
79 >=sys-devel/autoconf-2.58
80 dev-util/pkgconfig"
81
82 # public files should be 644 root:root
83 NUT_PUBLIC_FILES="/etc/nut/{ups,upssched}.conf"
84 # private files should be 640 root:nut - readable by nut, writeable by root,
85 NUT_PRIVATE_FILES="/etc/nut/{upsd.conf,upsd.users,upsmon.conf}"
86 # public files should be 644 root:root, only installed if USE=cgi
87 NUT_CGI_FILES="/etc/nut/{{hosts,upsset}.conf,upsstats{,-single}.html}"
88
89 pkg_setup() {
90 enewgroup nut 84
91 enewuser nut 84 -1 /var/lib/nut nut,uucp
92 # As of udev-104, NUT must be in uucp and NOT in tty.
93 gpasswd -d nut tty 2>/dev/null
94 gpasswd -a nut uucp 2>/dev/null
95 use hal && gpasswd -a haldaemon nut 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
106 sed -e "s:GD_LIBS.*=.*-L/usr/X11R6/lib \(.*\) -lXpm -lX11:GD_LIBS=\"\1:" \
107 -i configure.in || die "sed failed"
108
109 sed -e "s:52.nut-usbups.rules:70-nut-usbups.rules:" \
110 -i scripts/udev/Makefile.am || die "sed failed"
111
112 rm -f ltmain.sh m4/lt* m4/libtool.m4
113
114 WANT_AUTOCONF=2.5 eautoreconf || die "autoconf failed"
115 }
116
117 src_configure() {
118 local myconf
119
120 if [ -n "${NUT_DRIVERS}" ]; then
121 myconf="${myconf} --with-drivers=${NUT_DRIVERS// /,}"
122 fi
123
124 econf \
125 --with-user=nut \
126 --with-group=nut \
127 --with-drvpath=/lib/nut \
128 --sysconfdir=/etc/nut \
129 --with-logfacility=LOG_DAEMON \
130 --with-statepath=/var/lib/nut \
131 --with-htmlpath=/usr/share/nut/html \
132 --datarootdir=/usr/share/nut \
133 --datadir=/usr/share/nut \
134 --with-dev \
135 $(use_with xml neon) \
136 $(use_with hal) \
137 $(use_with ssl) \
138 $(use_with usb) \
139 $(use_with snmp) \
140 $(use_with cgi) \
141 $(use_with cgi cgipath /usr/share/nut/cgi) \
142 ${myconf} || die "econf failed"
143
144 }
145
146 src_install() {
147
148 emake DESTDIR="${D}" install || die "make install failed"
149
150 dodir /sbin
151 dosym /lib/nut/upsdrvctl /sbin/upsdrvctl
152 # This needs to exist for the scripts
153 dosym /lib/nut/upsdrvctl /usr/sbin/upsdrvctl
154
155 if use cgi; then
156 elog "CGI monitoring scripts are installed in /usr/share/nut/cgi."
157 elog "copy them to your web server's ScriptPath to activate (this is a"
158 elog "change from the old location)."
159 elog "If you use lighttpd, see lighttpd_nut.conf in the documentation."
160 fi
161
162 # this must be done after all of the install phases
163 for i in "${D}"/etc/nut/*.sample ; do
164 mv "${i}" "${i/.sample/}"
165 done
166
167 dodoc ChangeLog INSTALL MAINTAINERS NEWS README UPGRADING \
168 docs/{FAQ,*.txt} || die
169
170 newdoc lib/README README.lib || die
171
172 newdoc "${FILESDIR}"/lighttpd_nut.conf-2.2.0 lighttpd_nut.conf || die
173
174 docinto cables
175 dodoc docs/cables/* || die
176
177 newinitd "${FILESDIR}"/nut-2.2.2-init.d-upsd upsd \
178 || die "newinitd failed"
179 newinitd "${FILESDIR}"/nut-2.2.2-init.d-upsdrv upsdrv \
180 || die "newinitd failed"
181 newinitd "${FILESDIR}"/nut-2.2.2-init.d-upsmon upsmon \
182 || die "newinitd failed"
183 newinitd "${FILESDIR}"/nut.powerfail.initd nut.powerfail \
184 || die "newinitd failed"
185
186 # This sets up permissions for nut to access a UPS
187 insinto /etc/udev/rules.d/
188 newins scripts/udev/nut-usbups.rules 70-nut-usbups.rules
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 if use hal; then
219 einfo "Installing HAL support"
220 insinto /usr/share/hal/fdi/information/20thirdparty/
221 doins scripts/hal/20-ups-nut-device.fdi
222 insinto /usr/libexec
223 insopts -m 755
224 doins drivers/hald-addon-*
225 rm "${D}"/lib/nut/hald-addon-*
226 fi
227
228 dobashcompletion "${S}"/scripts/misc/nut.bash_completion
229 }
230
231 pkg_postinst() {
232 # this is to ensure that everybody that installed old versions still has
233 # correct permissions
234
235 chown nut:nut "${ROOT}"/var/lib/nut 2>/dev/null
236 chmod 0700 "${ROOT}"/var/lib/nut 2>/dev/null
237
238 # Do not remove eval here, because the variables contain shell expansions.
239 eval chown root:nut "${ROOT}"${NUT_PRIVATE_FILES} 2>/dev/null
240 eval chmod 0640 "${ROOT}"${NUT_PRIVATE_FILES} 2>/dev/null
241
242 # Do not remove eval here, because the variables contain shell expansions.
243 eval chown root:root "${ROOT}"${NUT_PUBLIC_FILES} 2>/dev/null
244 eval chmod 0644 "${ROOT}"${NUT_PUBLIC_FILES} 2>/dev/null
245
246 # Do not remove eval here, because the variables contain shell expansions.
247 if use cgi; then
248 eval chown root:root "${ROOT}"${NUT_CGI_FILES} 2>/dev/null
249 eval chmod 0644 "${ROOT}"${NUT_CGI_FILES} 2>/dev/null
250 fi
251
252 warningmsg elog
253 }
254
255 warningmsg() {
256 msgfunc="$1"
257 [ -z "$msgfunc" ] && die "msgfunc not specified in call to warningmsg!"
258 ${msgfunc} "Please note that NUT now runs under the 'nut' user."
259 ${msgfunc} "NUT is in the uucp group for access to RS-232 UPS."
260 ${msgfunc} "However if you use a USB UPS you may need to look at the udev or"
261 ${msgfunc} "hotplug rules that are installed, and alter them suitably."
262 ${msgfunc} ''
263 ${msgfunc} "If you use hald, you may be able to skip the normal init scripts."
264 ${msgfunc} ''
265 ${msgfunc} "You are strongly advised to read the UPGRADING file provided by upstream."
266 ${msgfunc} ''
267 ${msgfunc} "Please note that upsdrv is NOT automatically started by upsd anymore."
268 ${msgfunc} "If you have multiple UPS units, you can use their NUT names to"
269 ${msgfunc} "have a service per UPS:"
270 ${msgfunc} "ln -s /etc/init.d/upsdrv /etc/init.d/upsdrv.\$UPSNAME"
271 ${msgfunc} ''
272 ${msgfunc} 'If you want apcupsd to power off your UPS when it'
273 ${msgfunc} 'shuts down your system in a power failure, you must'
274 ${msgfunc} 'add nut.powerfail to your shutdown runlevel:'
275 ${msgfunc} ''
276 ${msgfunc} 'rc-update add nut.powerfail shutdown'
277 ${msgfunc} ''
278
279 }