summaryrefslogtreecommitdiff
blob: 059883b949c9b68fc46b9e2e9e948f41c081b6ad (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
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-apps/suspend2-userui/suspend2-userui-0.6.4-r1.ebuild,v 1.3 2007/01/09 00:22:39 ticho Exp $

inherit toolchain-funcs eutils

DESCRIPTION="User Interface for Software Suspend 2"
HOMEPAGE="http://www.suspend2.net"
SRC_URI="http://www.suspend2.net/downloads/all/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 x86"

IUSE="fbsplash static"
DEPEND="virtual/libc
		fbsplash? (	sys-libs/zlib
					media-libs/freetype
					media-libs/jpeg
					media-libs/lcms
					>=media-libs/libmng-1.0.5
					media-libs/libpng )"

src_unpack() {
	unpack ${A}

	cd "${S}"
	epatch "${FILESDIR}/${P}-remove-debug.patch"
	epatch "${FILESDIR}/${P}-glibc.patch"
}

src_compile() {
	# allow for static linking for use in initramfs/initrd
	use static && LDFLAGS="${LDFLAGS} -static"

	emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
		suspend2ui_text || die "emake suspend2ui_text failed"

	if use fbsplash; then
		emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
			fbsplash || die "emake fbsplash failed"
		emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
			suspend2ui_fbsplash || die "emake suspend2ui_fbsplash failed"
	fi
}

src_install() {
	into /
	dosbin suspend2ui_text
	use fbsplash && dosbin suspend2ui_fbsplash

	dodoc AUTHORS ChangeLog KERNEL_API README TODO USERUI_API
}

pkg_postinst() {
	if use fbsplash; then
		einfo
		einfo "You must create a symlink from /etc/splash/suspend2"
		einfo "to the theme you want suspend2ui_fbsplash to use, e.g.:"
		einfo
		einfo "  # ln -sfn /etc/splash/emergence /etc/splash/suspend2"
	fi

	einfo
	einfo "Please see /usr/share/doc/${PF}/README.gz for further"
	einfo "instructions."
	einfo
}