summaryrefslogtreecommitdiff
blob: fdac3c21302f41c6c9553a86971b12a561f4bf62 (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
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/d4x/d4x-2.4.1-r1.ebuild,v 1.6 2004/04/04 20:23:47 weeve Exp $

IUSE="nls esd gnome oss kde"

inherit eutils

S="${WORKDIR}/${P/_}"
DESCRIPTION="GTK based download manager for X."
SRC_URI="http://www.krasu.ru/soft/chuchelo/files/${P/_}.tar.gz"
HOMEPAGE="http://www.krasu.ru/soft/chuchelo/"

KEYWORDS="x86 sparc"
SLOT="0"
LICENSE="Artistic"

DEPEND=">=x11-libs/gtk+-2.0.6
	>=dev-libs/glib-2.0.6
	>=sys-devel/gettext-0.11.2
	esd? ( >=media-sound/esound-0.2.7 )"

src_unpack() {

	unpack ${A}

	# Use our own $CXXFLAGS
	cd ${S}
	cp configure configure.orig
	sed -e "s:CXXFLAGS=\"-O2\":CXXFLAGS=\"${CXXFLAGS}\":g;s:OPTFLAGS=\"-O2\":OPTFLAGS=\"\":g" \
		configure.orig >configure

	# Fix a miscompile with gcc-3.2.2 and CFLAGS="-O2"
	# <azarah@gentoo.org> (30 Mar 2003)
	epatch ${FILESDIR}/${P}-fix-statusbar-crash.patch

	# Fix bad #elif directives in sndserv.cc for big endian machines
	# <weeve@gentoo.org> (28 Mar 2004)
	[ `use sparc` ] && epatch ${FILESDIR}/${PN}-sndserv-bigendian.patch
}

src_compile() {

	econf --enable-release \
		$(use_enable oss) \
		$(use_enable esd) \
		$(use_enable nls)

	# workaround unsupported gtk_ calls for >=x11-libs/gtk+-2.2.4
	sed -e 's:.*GTK_DISABLE_DEPRECATED.*::' -i ${S}/config.h

	emake || die
}

src_install () {

	dodir /usr/bin
	dodir /usr/share/d4x

	einstall || die

	insinto /usr/share/pixmaps
	doins share/*.png share/*.xpm

	if [ -n "`use kde`" ]
	then
		insinto /usr/share/applnk/Internet
		newins share/nt.desktop d4x.desktop
	fi

	if [ -n "`use gnome`" ]
	then
		echo "Categories=Application;Network;" >> ${S}/share/nt.desktop
		insinto /usr/share/applications
		newins share/nt.desktop d4x.desktop
	fi

	rm -rf ${D}/usr/share/d4x/{FAQ*,INSTALL*,README*,LICENSE,NAMES,TROUBLES}
	dodoc AUTHORS COPYING ChangeLog* NEWS PLANS TODO \
		DOC/{FAQ*,LICENSE,NAMES,README*,TROUBLES,THANKS}
}