/[gentoo-x86]/sys-power/nut/nut-2.0.0.ebuild
Gentoo

Contents of /sys-power/nut/nut-2.0.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Tue Oct 9 00:45:35 2007 UTC (12 years, 3 months ago) by robbat2
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Clean up old ebuilds and fix quoting in present latest version.
(Portage version: 2.1.3.12)

1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-power/nut/nut-2.0.0.ebuild,v 1.4 2007/07/15 07:08:11 mr_bones_ Exp $
4
5 inherit eutils fixheadtails
6
7 DESCRIPTION="Network-UPS Tools"
8 HOMEPAGE="http://www.networkupstools.org/"
9 SRC_URI="mirror://nut/source/${PV%.*}/${P}.tar.gz"
10
11 LICENSE="GPL-2"
12 SLOT="0"
13 KEYWORDS="~amd64 ppc sparc x86"
14 IUSE="cgi snmp usb"
15
16 RDEPEND="cgi? ( media-libs/gd )
17 snmp? ( net-analyzer/net-snmp )"
18 DEPEND="${RDEPEND}
19 >=sys-apps/sed-4
20 >=sys-devel/autoconf-2.58"
21
22 pkg_setup() {
23 enewgroup nut 84
24 enewuser nut 84 -1 /var/state/nut nut
25 }
26
27 src_unpack() {
28 unpack ${A} && cd "${S}"
29
30 sed -e "s/install: install-dirs/install: install-dirs install-conf/" \
31 -i Makefile.in || die "sed failed"
32
33 ht_fix_file configure.in
34
35 sed -e "s:GD_LIBS.*=.*-L/usr/X11R6/lib \(.*\) -lXpm -lX11:GD_LIBS=\"\1:" \
36 -i configure.in || die "sed failed"
37
38 ebegin "Recreating configure"
39 WANT_AUTOCONF=2.5 autoconf || die "autoconf failed"
40 eend $?
41 }
42
43 src_compile() {
44 local myconf
45 myconf="${myconf} `use_with cgi` `use_with cgi cgipath /usr/share/nut`"
46
47 if [ -n "${NUT_DRIVERS}" ]; then
48 myconf="${myconf} --with-drivers=${NUT_DRIVERS// /,}"
49 fi
50
51 econf \
52 --with-user=nut \
53 --with-group=nut \
54 --with-drvpath=/lib/nut \
55 --sysconfdir=/etc/nut \
56 --with-logfacility=LOG_DAEMON \
57 --with-statepath=/var/lib/nut \
58 ${myconf} || die "econf failed"
59
60 emake || die "compile problem"
61
62 if use snmp; then
63 emake snmp || die "snmp compile problem"
64 fi
65
66 if use usb; then
67 emake usb || die "snmp compile problem"
68 fi
69
70 if use cgi; then
71 emake cgi || die "compile cgi problem"
72 fi
73 }
74
75 src_install() {
76 make DESTDIR="${D}" install install-lib || die "make install failed"
77
78 dodir /sbin
79 dosym /lib/nut/upsdrvctl /sbin/upsdrvctl
80
81 for i in "${D}"/etc/nut/*.sample ; do
82 mv "${i}" "${i/.sample/}"
83 done
84
85 if use snmp; then
86 make DESTDIR="${D}" install-snmp || die "make install-snmp failed"
87 fi
88
89 if use usb; then
90 make DESTDIR="${D}" install-usb || die "make install-usb failed"
91 fi
92
93 if use cgi; then
94 make DESTDIR="${D}" install-cgi || die "make install-cgi failed"
95 einfo "CGI monitoring scripts are installed in /usr/share/nut,"
96 einfo "copy them to your web server's ScriptPath to activate."
97 fi
98
99 dodoc CHANGES COPYING CREDITS INSTALL MAINTAINERS NEWS README UPGRADING \
100 docs/{FAQ,*.txt}
101
102 newdoc lib/README README.lib
103
104 docinto cables
105 dodoc docs/cables/*
106
107 newinitd "${FILESDIR}/upsd.rc6" upsd
108 newinitd "${FILESDIR}/upsdrv.rc6" upsdrv
109 newinitd "${FILESDIR}/upsmon.rc6" upsmon
110
111 keepdir /var/lib/nut
112
113 fperms 0700 /var/lib/nut
114 fperms 0640 /etc/nut/{upsd.conf,upsd.users,upsmon.conf}
115 fowners nut:nut /var/lib/nut
116 fowners root:nut /etc/nut/{upsd.conf,upsd.users,upsmon.conf}
117 }
118
119 pkg_postinst() {
120 # this is to ensure that everybody that installed old versions still has correct
121 # permissions
122 chown nut:nut ${ROOT}/var/lib/nut 2>/dev/null
123 chmod 0700 ${ROOT}/var/lib/nut 2>/dev/null
124 chown root:nut ${ROOT}/etc/nut/{upsd.conf,upsd.users,upsmon.conf} 2>/dev/null
125 chmod 0640 ${ROOT}/etc/nut/{upsd.conf,upsd.users,upsmon.conf} 2>/dev/null
126 }

  ViewVC Help
Powered by ViewVC 1.1.20