summaryrefslogtreecommitdiff
blob: f553f37a8ca89961fc854bf71f1d9ddd5ab06b7f (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
115
116
117
118
119
120
121
122
123
124
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/x11-wm/afterstep/afterstep-2.00.02.ebuild,v 1.3 2005/03/30 17:35:06 ka0ttic Exp $

inherit flag-o-matic

DESCRIPTION="AfterStep is a feature rich NeXTish window manager"
HOMEPAGE="http://www.afterstep.org"
SRC_URI="ftp://ftp.afterstep.org/stable/AfterStep-${PV}.tar.bz2"

LICENSE="AFTERSTEP"
SLOT="0"
KEYWORDS="x86 ~ppc ~sparc"
IUSE="debug gif jpeg mmx nls png tiff truetype xinerama"

DEPEND="virtual/libc
	virtual/x11
	png? ( >=media-libs/libpng-1.2.5 )
	jpeg? ( >=media-libs/jpeg-6b )
	gif?  ( >=media-libs/giflib-4.1.0 )
	tiff? ( >=media-libs/tiff-3.5.7 )"

S="${WORKDIR}/AfterStep-${PV}"

src_compile() {
	local myconf

	use nls && myconf="--enable-i18n" \
		|| myconf="--enable-i18n=no"

	use png && myconf="${myconf} --with-png" \
		|| myconf="${myconf} --with-png=no"

	use jpeg && myconf="${myconf} --with-jpeg" \
		|| myconf="${myconf} --with-jpeg=no"

	use gif && myconf="${myconf} --with-gif" \
		|| myconf="${myconf} --with-gif=no"

	use tiff && myconf="${myconf} --with-tiff" \
		|| myconf="${myconf} --with-tiff=no"

	use truetype && myconf="${myconf} --with-ttf --enable-reuse-font=no" \
		|| myconf="${myconf} --with-ttf=no"

	use xinerama && myconf="${myconf} --enable-xinerama" \
		|| myconf="${myconf} --enable-xinerama=no"

	use mmx && myconf="${myconf} --enable-mmx-optimization" \
		|| myconf="${myconf} --enable-mmx-optimization=no"

	use debug && myconf="${myconf} --enable-gdb --enable-warn --enable-gprof --enable-audit --enable-trace --enable-trace-x"

	use !ppc && use debug && myconf="${myconf} --with-libefence"


	#implied intent of debug means you need the frame pointers.
	use debug && filter-flags -fomit-frame-pointer


	# Explanation of configure options
	# ================================
	# --with-helpcommand="xterm -e man" -  Avoid installing xiterm
	# --with-xpm - Contained in xfree
	# --with-ungif=no - Use giflib instead of libungif
	# --disable-availability - So we can use complete paths for menuitems
	# --enable-ascp - The AfterStep ControlPanel is abandoned
	#

	econf \
		--with-helpcommand="xterm -e man" \
		--with-ungif=no \
		--disable-availability \
		--disable-staticlibs \
		--enable-ascp=no \
		${myconf} || die "configure failed"

	emake || die "emake failed"
}

src_install() {
	# see bug #31541
	dodir /usr/share/gnome/wm-properties

	make DESTDIR=${D} install || die "make install failed"

	# This fixes a bug with shared libraries
	rm ${D}/usr/lib/{libAfterImage.a,libAfterBase.a}
	cp -a ${S}/libAfterImage/libAfterImage.so* ${D}/usr/lib
	cp -a ${S}/libAfterBase/libAfterBase.so* ${D}/usr/lib
	cp -a ${S}/libAfterConf/libAfterConf.so* ${D}/usr/lib
	cp -a ${S}/libAfterStep/libAfterStep.so* ${D}/usr/lib

	# Create a symlink from MonitorWharf to Wharf
	rm ${D}/usr/bin/MonitorWharf
	dosym /usr/bin/Wharf /usr/bin/MonitorWharf

	# Handle the documentation
	dodoc COPYRIGHT ChangeLog INSTALL NEW* README* TEAM UPGRADE
	cp -a ${S}/TODO ${D}/usr/share/doc/${PF}/
	dodir /usr/share/doc/${PF}/html
	cp -a ${S}/doc/* ${D}/usr/share/doc/${PF}/html
	rm ${D}/usr/share/doc/${PF}/html/{Makefile*,afterstepdoc.in}

	dodir /usr/share/xsessions
	insinto /usr/share/xsessions
	newins ${S}/AfterStep.desktop.final AfterStep.desktop

	# For desktop managers like GDM or KDE
	exeinto /etc/X11/Sessions
	doexe ${FILESDIR}/afterstep
}

pkg_postinst() {
	echo
	einfo "To use AfterStep issue the following commands:"
	einfo "mv ~/.xinitrc ~/xinitrc.old"
	einfo "echo afterstep > ~/.xinitrc"
	echo
	einfo "If you like AfterStep please vote for it at"
	einfo "http://www.PLiG.org/xwinman/vote.html !"
	echo
}