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

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

  ViewVC Help
Powered by ViewVC 1.1.20