Lines 2-32
Link Here
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/www-apps/nut/nut-2.0.1_pre4.ebuild,v 1.3 2005/02/21 02:43:58 dragonheart Exp $ |
3 |
# $Header: /var/cvsroot/gentoo-x86/www-apps/nut/nut-2.0.1_pre4.ebuild,v 1.3 2005/02/21 02:43:58 dragonheart Exp $ |
4 |
|
4 |
|
5 |
inherit fixheadtails |
5 |
inherit fixheadtails webapp |
6 |
|
|
|
7 |
MY_P="${P/_/-}" |
8 |
|
6 |
|
9 |
DESCRIPTION="Network-UPS Tools" |
7 |
DESCRIPTION="Network-UPS Tools" |
10 |
HOMEPAGE="http://www.networkupstools.org/" |
8 |
HOMEPAGE="http://www.networkupstools.org/" |
11 |
SRC_URI="mirror://nut/source/2.0/testing/${MY_P}.tar.gz" |
9 |
SRC_URI="mirror://nut/source/2.0/${P}.tar.gz" |
12 |
|
|
|
13 |
S=${WORKDIR}/${MY_P/-pre4//} |
14 |
|
10 |
|
15 |
LICENSE="GPL-2" |
11 |
LICENSE="GPL-2" |
16 |
SLOT="0" |
12 |
#SLOT="0" |
17 |
KEYWORDS="~x86 ~sparc ~ppc ~alpha ~amd64" |
13 |
KEYWORDS="~x86 ~sparc ~ppc ~alpha ~amd64" |
18 |
IUSE="cgi snmp usb" |
14 |
IUSE="cgi snmp usb ssl" |
19 |
|
15 |
|
20 |
RDEPEND="cgi? ( media-libs/gd ) |
16 |
RDEPEND="cgi? ( >= media-libs/gd-2 ) |
21 |
snmp? ( net-analyzer/net-snmp )" |
17 |
snmp? ( virtual/snmp ) |
|
|
18 |
usb? ( dev-libs/libusb ) |
19 |
ssl? ( >=dev-libs/openssl-0.9.6e )" |
22 |
DEPEND="$RDEPEND |
20 |
DEPEND="$RDEPEND |
23 |
>=sys-apps/sed-4 |
21 |
>=sys-apps/sed-4 |
24 |
>=sys-devel/autoconf-2.58" |
22 |
>=sys-devel/autoconf-2.58" |
25 |
|
23 |
|
26 |
src_unpack() { |
24 |
src_unpack() { |
27 |
unpack ${A} |
25 |
unpack ${A} && cd "${S}" |
28 |
|
|
|
29 |
cd "${S}" |
30 |
|
26 |
|
31 |
sed -e "s/install: install-dirs/install: install-dirs install-conf/" \ |
27 |
sed -e "s/install: install-dirs/install: install-dirs install-conf/" \ |
32 |
-i Makefile.in || die "sed failed" |
28 |
-i Makefile.in || die "sed failed" |
Lines 37-49
Link Here
|
37 |
-i configure.in || die "sed failed" |
33 |
-i configure.in || die "sed failed" |
38 |
|
34 |
|
39 |
ebegin "Recreating configure" |
35 |
ebegin "Recreating configure" |
|
|
36 |
aclocal |
40 |
WANT_AUTOCONF=2.5 autoconf || die "autoconf failed" |
37 |
WANT_AUTOCONF=2.5 autoconf || die "autoconf failed" |
41 |
eend $? |
38 |
eend $? |
42 |
} |
39 |
} |
43 |
|
40 |
|
44 |
src_compile() { |
41 |
src_compile() { |
45 |
local myconf |
42 |
local myconf |
46 |
myconf="${myconf} `use_with cgi` `use_with cgi cgipath /usr/share/nut`" |
43 |
myconf="${myconf} `use_with cgi` `use_with ssl`" |
47 |
|
44 |
|
48 |
if [ -n "${NUT_DRIVERS}" ]; then |
45 |
if [ -n "${NUT_DRIVERS}" ]; then |
49 |
myconf="${myconf} --with-drivers=${NUT_DRIVERS// /,}" |
46 |
myconf="${myconf} --with-drivers=${NUT_DRIVERS// /,}" |
Lines 65-71
Link Here
|
65 |
fi |
62 |
fi |
66 |
|
63 |
|
67 |
if use usb; then |
64 |
if use usb; then |
68 |
emake usb || die "snmp compile problem" |
65 |
emake usb || die "usb compile problem" |
69 |
fi |
66 |
fi |
70 |
|
67 |
|
71 |
if use cgi; then |
68 |
if use cgi; then |
Lines 76-87
Link Here
|
76 |
src_install() { |
73 |
src_install() { |
77 |
make DESTDIR="${D}" install install-lib || die "make install failed" |
74 |
make DESTDIR="${D}" install install-lib || die "make install failed" |
78 |
|
75 |
|
79 |
dodir /usr/sbin |
76 |
dodir /sbin |
80 |
dosym /usr/lib/nut/upsdrvctl /usr/sbin/upsdrvctl |
77 |
dosym /usr/lib/nut/upsdrvctl /sbin/upsdrvctl |
81 |
|
|
|
82 |
for i in "${D}"/etc/nut/*.sample ; do |
83 |
mv "${i}" "${i/.sample/}" |
84 |
done |
85 |
|
78 |
|
86 |
if use snmp; then |
79 |
if use snmp; then |
87 |
make DESTDIR="${D}" install-snmp || die "make install-snmp failed" |
80 |
make DESTDIR="${D}" install-snmp || die "make install-snmp failed" |
Lines 92-101
Link Here
|
92 |
fi |
85 |
fi |
93 |
|
86 |
|
94 |
if use cgi; then |
87 |
if use cgi; then |
95 |
make DESTDIR="${D}" install-cgi || die "make install-cgi failed" |
88 |
make DESTDIR="${D}" install-cgi-conf || die "make install-cgi-conf failed" |
96 |
einfo "CGI monitoring scripts are installed in /usr/share/nut," |
89 |
|
97 |
einfo "copy them to your web server's ScriptPath to activate." |
90 |
webapp_src_preinst |
98 |
fi |
91 |
|
|
|
92 |
cp clients/*.cgi ${D}/${MY_CGIBINDIR} |
93 |
|
94 |
webapp_src_install |
95 |
fi |
96 |
|
97 |
for i in "${D}"/etc/nut/*.sample ; do |
98 |
mv "${i}" "${i/.sample/}" |
99 |
done |
99 |
|
100 |
|
100 |
dodoc CHANGES COPYING CREDITS INSTALL MAINTAINERS NEWS README UPGRADING \ |
101 |
dodoc CHANGES COPYING CREDITS INSTALL MAINTAINERS NEWS README UPGRADING \ |
101 |
docs/{FAQ,*.txt} |
102 |
docs/{FAQ,*.txt} |
Lines 105-122
Link Here
|
105 |
docinto cables |
106 |
docinto cables |
106 |
dodoc docs/cables/* |
107 |
dodoc docs/cables/* |
107 |
|
108 |
|
108 |
|
|
|
109 |
exeinto /etc/init.d |
109 |
exeinto /etc/init.d |
110 |
newexe "${FILESDIR}/upsd.rc6" upsd |
110 |
newexe "${FILESDIR}/upsd.rc6" upsd |
111 |
newexe "${FILESDIR}/upsdrv.rc6-r1" upsdrv |
111 |
newexe "${FILESDIR}/upsdrv.rc6" upsdrv |
112 |
newexe "${FILESDIR}/upsmon.rc6" upsmon |
112 |
newexe "${FILESDIR}/upsmon.rc6" upsmon |
113 |
|
113 |
|
114 |
keepdir /var/lib/nut |
114 |
keepdir /var/lib/nut |
115 |
|
115 |
|
116 |
fperms 0700 /var/lib/nut |
116 |
fperms 0700 /var/lib/nut |
117 |
fperms 0640 /etc/nut/{upsd.conf,upsd.users,upsmon.conf} |
117 |
fperms 0640 /etc/nut/* |
118 |
fowners nut:nut /var/lib/nut |
118 |
fowners nut:nut /var/lib/nut |
119 |
fowners root:nut /etc/nut/{upsd.conf,upsd.users,upsmon.conf} |
119 |
fowners root:nut /etc/nut/* |
120 |
} |
120 |
} |
121 |
|
121 |
|
122 |
pkg_postinst() { |
122 |
pkg_postinst() { |
Lines 126-129
Link Here
|
126 |
chmod 0700 ${ROOT}/var/lib/nut 2>/dev/null |
126 |
chmod 0700 ${ROOT}/var/lib/nut 2>/dev/null |
127 |
chown root:nut ${ROOT}/etc/nut/{upsd.conf,upsd.users,upsmon.conf} 2>/dev/null |
127 |
chown root:nut ${ROOT}/etc/nut/{upsd.conf,upsd.users,upsmon.conf} 2>/dev/null |
128 |
chmod 0640 ${ROOT}/etc/nut/{upsd.conf,upsd.users,upsmon.conf} 2>/dev/null |
128 |
chmod 0640 ${ROOT}/etc/nut/{upsd.conf,upsd.users,upsmon.conf} 2>/dev/null |
|
|
129 |
|
130 |
ewarn "use the command" |
131 |
ewarn " webapp-config" |
132 |
ewarn "to install nut for each virtual host. See proper man page." |
129 |
} |
133 |
} |