summaryrefslogtreecommitdiff
blob: 456a8c56c60abd20e773c79bcab7ef6b535e2836 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/rrdtool/rrdtool-1.0.35-r3.ebuild,v 1.2 2002/07/18 23:22:51 seemant Exp $

inherit perl-module

S=${WORKDIR}/${P}
DESCRIPTION="A system to store and display time-series data"
SRC_URI="http://ee-staff.ethz.ch/~oetiker/webtools/rrdtool/pub/${P}.tar.gz"
HOMEPAGE="http://ee-staff.ethz.ca/~oetiker/webtools/rrdtool/"

DEPEND="perl? ( sys-devel/perl )
	sys-apps/gawk
	>=media-libs/libgd-1.8.3"

RDEPEND="tcltk? ( dev-lang/tcl )"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="x86"

TCLVER=""

pkg_setup() {
	use tcltk && \
		TCLVER=`awk -F\' '/TCL_VERSION/ {print $2}' /usr/lib/tclConfig.sh`

	use perl && ( \
		perl_pkg_setup
	)
}

src_compile() {

	local myconf
	use tcltk \
		&& myconf="${myconf} --with-tcllib=/usr/lib" \
		|| myconf="${myconf} --without-tcllib"
	
	./configure \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--datadir=/usr/share \
		--enable-shared \
		--with-perl-options='INSTALLMAN1DIR=/usr/share/man/man1 INSTALLMAN3DIR=/usr/share/man/man3' \
		${myconf} || die


	make || die
}

src_install () {

	einstall || die

	# this package completely ignores mandir settings
	
	doman doc/*.1
	dohtml doc/*.html
	dodoc doc/*.pod
	dodoc doc/*.txt
	
	rm -rf ${D}/usr/doc
	rm -rf ${D}/usr/html
	rm -rf ${D}/usr/man
	a
	rm -rf ${D}/usr/contrib
	rm -rf ${D}/usr/examples
	
	insinto /usr/share/doc/${PF}/examples
	doins examples/*
	insinto /usr/share/doc/${PF}/contrib
	doins contrib/*

	use perl && ( \
		perl_perlinfo
		mytargets="site-perl-install"
		base_src_install || die
	)

	use tcltk && ( \
		mv ${S}/tcl/tclrrd.so ${S}/tcl/tclrrd${PV}.so
		insinto /usr/lib/tcl${TCL_VER}/tclrrd${PV}
		doins ${S}/tcl/tclrrd${PV}.so
		echo "package ifneeded Rrd ${PV} [list load [file join \$$dir .. tclrrd${PV}.so]]" \
			>> ${D}/usr/lib/tcl${TCL_VER}/tclrrd${PV}/pkgIndex.tcl
	)

	dodoc CHANGES COPY* CONTR* README TODO

}


pkg_preinst() {

	use perl && perl_pkg_preinst
}

pkg_postinst() {
	
	use perl && perl_pkg_postinst
}


pkg_prerm() {
	
	use perl && perl_pkg_prerm
}


pkg_postrm() {

	use perl && perl_pkg_postrm
}