summaryrefslogtreecommitdiff
blob: 2e7d0e44e6e8b7a50bf373de319578836a7591f7 (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/x11-wm/wmii/wmii-2.ebuild,v 1.7 2009/08/03 10:40:41 ssuominen Exp $

inherit eutils toolchain-funcs

DESCRIPTION="window manager improved 2 -- the next generation of the WMI project."
HOMEPAGE="http://www.wmii.net"
SRC_URI="http://wmi.modprobe.de/download/${P}.tar.bz2"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~hppa ~ppc ~x86"
IUSE="python"

DEPEND="x11-libs/libX11
	python? ( dev-python/pyrex )"
RDEPEND="${DEPEND}
	x11-apps/xdpyinfo
	x11-apps/xmessage
	x11-apps/xsetroot"

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

	epatch "${FILESDIR}/${P}_050802.patch"

	sed -i \
		-e "/^PREFIX/s/=.*/= \/usr/" \
		-e "/^CONFPREFIX/s/=.*/= \/etc/" \
		-e "/^CC/s/=.*/= $(tc-getCC)/" \
		-e "/^AR/s/=.*/= $(tc-getAR) cr/" \
		-e "/^RANLIB/s/=.*/= $(tc-getRANLIB)/" \
		-e "/^CFLAGS/s/-O0/${CFLAGS}/" \
		-e "/^LDFLAGS/s/-g /-g ${LDFLAGS} /" \
		"${S}/config.mk" || die "sed failed."
}

src_compile() {
	emake || die "emake failed"

	if use python ; then
		cd "${S}"/libixp/python
		python setup.py build || die "python build failed."
	fi
}

src_install() {
	make DESTDIR="${D}" install || die "make install failed."

	dodoc ANNOUNCE || die "ANNOUNCE failed." # only in releases
	dodoc CHANGES README doc/welcome.txt || die "dodoc failed."

	if use python ; then
		cd "${S}"/libixp/python
		python setup.py install --root="${D}" || die "python install failed."
	fi

	echo -e "#!/bin/sh\n/usr/bin/wmii" > "${T}/${PN}"
	exeinto /etc/X11/Sessions
	doexe "${T}/${PN}" || die "/etc/X11/Sessions failed."

	insinto /usr/share/xsessions
	doins "${FILESDIR}/${PN}.desktop" || die "${PN}.desktop failed."
}