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.2.0.ebuild
Date: Tue, 09 Oct 2007 00:58:22
Message-Id: E1If3HA-000703-92@stork.gentoo.org
1 robbat2 07/10/09 00:48:44
2
3 Modified: ChangeLog
4 Added: nut-2.2.0.ebuild
5 Log:
6 Bug #184595, version bump to new major version. Read the UPGRADING file provided by upstream, there is a strong chance you need to change your config files. ~ppc64 was dropped due to the hald dependancy.
7 (Portage version: 2.1.3.12)
8
9 Revision Changes Path
10 1.48 sys-power/nut/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-power/nut/ChangeLog?rev=1.48&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-power/nut/ChangeLog?rev=1.48&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-power/nut/ChangeLog?r1=1.47&r2=1.48
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/sys-power/nut/ChangeLog,v
19 retrieving revision 1.47
20 retrieving revision 1.48
21 diff -u -r1.47 -r1.48
22 --- ChangeLog 9 Oct 2007 00:45:34 -0000 1.47
23 +++ ChangeLog 9 Oct 2007 00:48:43 -0000 1.48
24 @@ -1,6 +1,14 @@
25 # ChangeLog for sys-power/nut
26 # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/ChangeLog,v 1.47 2007/10/09 00:45:34 robbat2 Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/sys-power/nut/ChangeLog,v 1.48 2007/10/09 00:48:43 robbat2 Exp $
29 +
30 +*nut-2.2.0 (09 Oct 2007)
31 +
32 + 09 Oct 2007; Robin H. Johnson <robbat2@g.o>
33 + +files/lighttpd_nut.conf-2.2.0, +nut-2.2.0.ebuild:
34 + Bug #184595, version bump to new major version. Read the UPGRADING file
35 + provided by upstream, there is a strong chance you need to change your
36 + config files.
37
38 09 Oct 2007; Robin H. Johnson <robbat2@g.o> -nut-2.0.0.ebuild,
39 -nut-2.0.0-r1.ebuild, -nut-2.0.1_pre4.ebuild, -nut-2.0.3.ebuild,
40
41
42
43 1.1 sys-power/nut/nut-2.2.0.ebuild
44
45 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-power/nut/nut-2.2.0.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-power/nut/nut-2.2.0.ebuild?rev=1.1&content-type=text/plain
47
48 Index: nut-2.2.0.ebuild
49 ===================================================================
50 # Copyright 1999-2007 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.2.0.ebuild,v 1.1 2007/10/09 00:48:43 robbat2 Exp $
53
54 inherit eutils fixheadtails
55
56 MY_P="${P/_/-}"
57
58 DESCRIPTION="Network-UPS Tools"
59 HOMEPAGE="http://www.networkupstools.org/"
60 # Nut mirrors are presently broken
61 SRC_URI="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"
69
70 RDEPEND="cgi? ( >=media-libs/gd-2 )
71 snmp? ( net-analyzer/net-snmp )
72 usb? ( >=dev-libs/libusb-0.1.12 )
73 hal? ( >=sys-apps/hal-0.5.9.1 )
74 ssl? ( dev-libs/openssl )
75 >=sys-fs/udev-114"
76 DEPEND="$RDEPEND
77 >=sys-apps/sed-4
78 >=sys-devel/autoconf-2.58"
79
80 # public files should be 644 root:root
81 NUT_PUBLIC_FILES="/etc/nut/{{hosts,upsset,ups,upssched}.conf,upsstats{,-single}.html}"
82 # private files should be 640 root:nut - readable by nut, writeable by root,
83 NUT_PRIVATE_FILES="/etc/nut/{upsd.conf,upsd.users,upsmon.conf}"
84
85 pkg_setup() {
86 enewgroup nut 84
87 enewuser nut 84 -1 /var/lib/nut nut,uucp
88 # As of udev-104, NUT must be in uucp and NOT in tty.
89 gpasswd -d nut tty 2>/dev/null
90 gpasswd -a nut uucp 2>/dev/null
91 use hal && gpasswd -a haldaemon nut 2>/dev/null
92 # in some cases on old systems it wasn't in the nut group either!
93 gpasswd -a nut nut 2>/dev/null
94 warningmsg ewarn
95 }
96
97 src_unpack() {
98 unpack ${A}
99
100 cd "${S}"
101
102 sed -e "s/install: install-dirs/install: install-dirs install-conf/" \
103 -i Makefile.in || die "sed failed"
104
105 ht_fix_file configure.in
106
107 sed -e "s:GD_LIBS.*=.*-L/usr/X11R6/lib \(.*\) -lXpm -lX11:GD_LIBS=\"\1:" \
108 -i configure.in || die "sed failed"
109
110 ebegin "Recreating configure"
111 WANT_AUTOCONF=2.5 autoconf || die "autoconf failed"
112 eend $?
113
114 sed -e "s:52_nut-usbups.rules:70-nut-usbups.rules:" \
115 -i scripts/udev/Makefile.in || die "sed failed"
116 }
117
118 src_compile() {
119 local myconf
120
121 if [ -n "${NUT_DRIVERS}" ]; then
122 myconf="${myconf} --with-drivers=${NUT_DRIVERS// /,}"
123 fi
124
125 econf \
126 --with-user=nut \
127 --with-group=nut \
128 --with-drvpath=/lib/nut \
129 --sysconfdir=/etc/nut \
130 --with-logfacility=LOG_DAEMON \
131 --with-statepath=/var/lib/nut \
132 --with-htmlpath=/usr/share/nut/html \
133 --datarootdir=/usr/share/nut \
134 --datadir=/usr/share/nut \
135 --with-lib \
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 emake || die "compile problem"
145
146 }
147
148 src_install() {
149
150 make DESTDIR="${D}" install || die "make install failed"
151
152 dodir /sbin
153 dosym /lib/nut/upsdrvctl /sbin/upsdrvctl
154 # This needs to exist for the scripts
155 dosym /lib/nut/upsdrvctl /usr/sbin/upsdrvctl
156
157 if use cgi; then
158 elog "CGI monitoring scripts are installed in /usr/share/nut/cgi."
159 elog "copy them to your web server's ScriptPath to activate (this is a"
160 elog "change from the old location)."
161 elog "If you use lighttpd, see lighttpd_nut.conf in the documentation."
162 fi
163
164 # this must be done after all of the install phases
165 for i in "${D}"/etc/nut/*.sample ; do
166 mv "${i}" "${i/.sample/}"
167 done
168
169
170 dodoc ChangeLog INSTALL MAINTAINERS NEWS README UPGRADING \
171 docs/{FAQ,*.txt}
172
173 newdoc lib/README README.lib
174
175 newdoc "${FILESDIR}"/lighttpd_nut.conf-2.2.0 lighttpd_nut.conf
176
177 docinto cables
178 dodoc docs/cables/*
179
180
181 newinitd "${FILESDIR}"/upsd.rc6 upsd
182 newinitd "${FILESDIR}"/upsdrv.rc6-r1 upsdrv
183 newinitd "${FILESDIR}"/upsmon.rc6 upsmon
184
185 # This sets up permissions for nut to access a UPS
186 insinto /etc/udev/rules.d/
187 newins scripts/udev/nut-usbups.rules 70-nut-usbups.rules
188
189 keepdir /var/lib/nut
190
191 fperms 0700 /var/lib/nut
192 fowners nut:nut /var/lib/nut
193
194 eval fperms 0640 ${NUT_PRIVATE_FILES}
195 eval fowners root:nut ${NUT_PRIVATE_FILES}
196
197 eval fperms 0644 ${NUT_PUBLIC_FILES}
198 eval fowners root:root ${NUT_PUBLIC_FILES}
199
200 # this is installed for 2.4 and fbsd guys
201 if ! has_version sys-fs/udev; then
202 insinto /etc/hotplug/usb
203 insopts -m 755
204 doins scripts/hotplug/nut-usbups.hotplug
205 fi
206
207 if use hal; then
208 insinto /usr/share/hal/fdi/information/20thirdparty/
209 doins scripts/hal/20-ups-nut-device.fdi
210 insinto /usr/libexec
211 insopts -m 755
212 doins drivers/hald-addon-*
213 rm "${D}"/lib/nut/hald-addon-*
214 fi
215 }
216
217 pkg_postinst() {
218 # this is to ensure that everybody that installed old versions still has
219 # correct permissions
220
221 chown nut:nut "${ROOT}"/var/lib/nut 2>/dev/null
222 chmod 0700 "${ROOT}"/var/lib/nut 2>/dev/null
223
224 eval chown root:nut "${ROOT}"${NUT_PRIVATE_FILES} 2>/dev/null
225 eval chmod 0640 "${ROOT}"${NUT_PRIVATE_FILES} 2>/dev/null
226
227 eval chown root:root "${ROOT}"${NUT_PUBLIC_FILES} 2>/dev/null
228 eval chmod 0644 "${ROOT}"${NUT_PUBLIC_FILES} 2>/dev/null
229
230 warningmsg elog
231 }
232
233 warningmsg() {
234 msgfunc="$1"
235 [ -z "$msgfunc" ] && die "msgfunc not specified in call to warningmsg!"
236 ${msgfunc} "Please note that NUT now runs under the 'nut' user."
237 ${msgfunc} "NUT is in the uucp group for access to RS-232 UPS."
238 ${msgfunc} "However if you use a USB UPS you may need to look at the udev or"
239 ${msgfunc} "hotplug rules that are installed, and alter them suitably."
240 echo
241 ${msgfunc} "If you use hald, you may be able to skip the normal init scripts."
242 echo
243 ${msgfunc} "You are strongly advised to read the UPGRADING file provided by upstream."
244 }
245
246
247
248 --
249 gentoo-commits@g.o mailing list