summaryrefslogtreecommitdiff
blob: 546712c37ea0bb6011fbbdf040532d1b9a7777b2 (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
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: /var/cvsroot/gentoo-x86/app-sci/chemtool/chemtool-1.5.ebuild,v 1.5 2003/04/18 17:12:23 seemant Exp $

[ -n "`use kde`" ] && inherit kde-functions
inherit eutils

DESCRIPTION="program for drawing organic molecules"
HOMEPAGE="http://ruby.chemie.uni-freiburg.de/~martin/chemtool/"
SRC_URI="http://ruby.chemie.uni-freiburg.de/~martin/chemtool/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86"
IUSE="gnome kde nls"

DEPEND=">=media-gfx/transfig-3.2.3d
	>=x11-libs/gtk+-1.2.10
	gnome? ( gnome-base/gnome )
	kde? ( kde-base/kde )
	nls? ( sys-devel/gettext )"

src_unpack() {
	unpack ${A}
	cd ${S}

	epatch ${FILESDIR}/configure.in-${P}-gentoo.diff
	epatch ${FILESDIR}/config.h.in-${P}-gentoo.diff
	epatch ${FILESDIR}/Makefile.in-${P}-gentoo.diff
	epatch ${FILESDIR}/src-cht-Makefile.in-${P}-gentoo.diff
	autoconf || die
}

src_compile() {
	local config_opts

	if [ "`use kde`" ]; then
		need-kde 2
		config_opts="--with-kdedir=${KDEDIR}" ;
	else
		config_opts="--without-kdedir"
	fi

	if [ "`use gnome`" ] ; then
		config_opts="${config_opts} --with-gnomedir=/usr" ;
	else
		config_opts="${config_opts} --without-gnomedir" ;
	fi

	if [ "`use nls`" ] ; then
		config_opts="${config_opts} --enable-locales \
			--with-localdir=/usr/share/locale"
	else
		config_opts="${config_opts} --disable-locales" ;
	fi

	econf ${config_opts} \
		|| die "./configure failed"

	emake || die "make failed"
}

src_install () {
	einstall \
		gnomedir=${D}/usr \
		kdedir=${D}/${KDEDIR} \
		localedir=${D}/usr/share/locale \
		|| die "make install failed"

	dodoc ChangeLog INSTALL README TODO
	insinto /usr/share/${PN}/examples
	doins ${S}/examples/*
}