summaryrefslogtreecommitdiff
blob: fbdc8f3f021aafa540cfcb48b3472adcfd7b15bc (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-admin/sabayon/sabayon-2.12.4.ebuild,v 1.3 2006/09/21 14:36:16 gustavoz Exp $

inherit gnome2 eutils python multilib

DESCRIPTION="Tool to maintain user profiles in a GNOME desktop"
HOMEPAGE="http://www.gnome.org/projects/sabayon/"

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

# Unfortunately the configure.ac is wildly insufficient, so dependencies have
# to be got from the RPM .spec file...
DEPEND="dev-lang/python
	>=x11-libs/gtk+-2.6.0
	>=dev-python/pygtk-2.5.3
	x11-libs/pango
	dev-python/python-ldap
	x11-base/xorg-server"
RDEPEND="${DEPEND}
	virtual/pam
	app-admin/gamin
	dev-libs/libxml2
	>=gnome-base/gconf-2.8.1
	>=dev-python/gnome-python-2.6.0"

pkg_setup() {
	if built_with_use x11-base/xorg-server minimal; then
		eerror "${PN} needs Xnest, which the minimal USE flag disables."
		eerror "Please re-emerge x11-base/xorg-xserver with USE=-minimal"
		die "need x11-base/xorg-xserver built without minimal USE flag"
	fi
	if ! built_with_use dev-libs/libxml2 python; then
		eerror "${PN} needs the python bindings to libxml2."
		eerror "Please re-emerge dev-libs/libxml2 with USE=python"
		die "need dev-libs/libxml2 built with python USE flag"
	fi
	# dang: I don't think this should happen...  Python is a system dep
	if ! python_mod_exists gamin; then
		# app-admin/gamin (0.1.7, at least) lacks "python" USE flag even though
		# it builds python bindings. That's not good, hackers. That's not good.
		eerror "${PN} needs the python bindings to gamin. Please re-emerge"
		eerror "app-admin/gamin, and ensure the python bindings are built."
		die "need python bindings to app-admin/gamin"
	fi

	G2CONF="--with-distro=gentoo \
		--with-prototype-user=${PN}-admin \
		--enable-console-helper=no \
		--with-pam-prefix=/lib/security"

	einfo "Adding user '${PN}-admin' as the prototype user"
	# I think /var/lib/sabayon is the correct directory to use here.
	enewgroup ${PN}-admin
	enewuser ${PN}-admin -1 -1 "/var/lib/sabayon" "${PN}-admin"
	# Should we delete the user/group on unmerge?

	DOCS="AUTHORS ChangeLog ISSUES NEWS README TODO"
	USE_DESTDIR="1"
}

src_unpack() {
	gnome2_src_unpack

	# Fix multilib borkage
	epatch ${FILESDIR}/${P}-multilib.patch
}

pkg_postinst() {
	# unfortunately /etc/gconf is CONFIG_PROTECT_MASK'd
	einfo "To apply Sabayon defaults and mandatory settings to all users, put"
	einfo '    include "$(HOME)/.gconf.path.mandatory"'
	einfo "in /etc/gconf/2/local-mandatory.path and put"
	einfo '    include "$(HOME)/.gconf.path.defaults"'
	einfo "in /etc/gconf/2/local-defaults.path."
	einfo "You can safely create these files if they do not already exist."
}