summaryrefslogtreecommitdiff
blob: 6f46f892780ae25bd337fcd3ec5d945fe5e903b8 (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils toolchain-funcs wxwidgets flag-o-matic

MY_P="MUTE_fileSharing-${PV}_UnixSource"

DESCRIPTION="peer-to-peer network that provides easy search-and-download
functionality while also protecting your privacy"
HOMEPAGE="http://mute-net.sourceforge.net/"
SRC_URI="mirror://sourceforge/mute-net/${MY_P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE="wxwindows"

DEPEND="dev-libs/crypto++
	wxwindows? ( >=x11-libs/wxGTK-2.6 )"
RDEPEND="${DEPEND}"

S=${WORKDIR}/${MY_P}

pkg_setup() {
	if use wxwindows ; then
		WX_GTK_VER=2.6
		need-wxwidgets gtk2
	fi

	if [ $(gcc-major-version) -ge 4 ]; then
		einfo "${P} doesn't compile with gcc version >= 4"
		die "${P} needs gcc version < 4"
	fi
}

src_unpack() {
	unpack ${A}
	cd "${S}"
	epatch "${FILESDIR}/${P}-configure.patch"
	epatch "${FILESDIR}/${P}-makefile.patch"

	cd "${S}"/MUTE/otherApps/fileSharing/userInterface/languages/
	mv Espa?ol.txt Espanol.txt
	rm TranslationHelper.txt
}

src_compile() {
	# not an autotools configure
	cd "${S}/MUTE"
	./configure >/dev/null || die "configure failed"

	# break the crypto at startup
	filter-flags -fomit-frame-pointer

	emake GXX=$(tc-getCXX) CRYPTO_LIB="/usr/lib/libcrypto++.a" || die "emake failed"

	if use wxwindows; then
		cd "${S}/MUTE/otherApps/fileSharing/userInterface/wxWindows"
		emake GXX="$(tc-getCXX)" WX_CONFIG="${WX_CONFIG}" \
			CRYPTO_LIB="/usr/lib/libcrypto++.a" || die "emake failed"
	fi
}

src_install() {
	exeinto /usr/share/mute
	doexe MUTE/otherApps/fileSharing/userInterface/textBased/textFileSharingMUTE
	dobin "${FILESDIR}/MUTE"
	if use wxwindows; then
		doexe MUTE/otherApps/fileSharing/userInterface/wxWindows/fileSharingMUTE
		dohard /usr/bin/MUTE /usr/bin/wxMUTE
	fi

	insinto /etc/mute/languages
	doins MUTE/otherApps/fileSharing/userInterface/languages/*.txt
	insinto /etc/mute/settings
	doins MUTE/otherApps/fileSharing/userInterface/settings/*.ini

	dodoc MUTE/otherApps/fileSharing/doc/*.txt
	dodoc MUTE/otherApps/fileSharing/userInterface/settings/README.txt
	dodoc MUTE/otherApps/fileSharing/doc/fileSharingProtocol.txt
	dodoc minorGems/protocol/p2p/*
}