summaryrefslogtreecommitdiff
blob: 6f076e200696bcf792aaf45a4144e518c88e90e5 (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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="2"

EBZR_REVISION="2384"
EBZR_REPO_URI="http://bazaar.launchpad.net/~ltsp-upstream/ltsp/ltsp-trunk"

inherit bzr

DESCRIPTION="LTSP server"
HOMEPAGE="http://www.ltsp.org/"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 x86"
# Default to nfs until nbd works
IUSE="doc dhcp examples nbd +nfs +pulseaudio +X"
DEPEND=""

# NOTES on the dependencies
# xdm - we currently have to rely on /usr/lib/X11/xdm/Xsession
# iproute2 - ltsp-update-sshkeys requires ip
RDEPEND="net-misc/openssh
	virtual/tftp
	dhcp? ( || ( net-dns/dnsmasq net-misc/dhcp ) )
	nfs? (
		>net-fs/nfs-utils-1.1.5
	)
	nbd? (
		sys-apps/xinetd
		sys-block/nbd
		sys-fs/squashfs-tools
	)
	pulseaudio? (
		media-sound/pulseaudio
	)
	X? (
		x11-apps/xdm
		x11-base/xorg-server
	)
	sys-fs/ltspfs
	sys-apps/lsb-release
	|| ( >sys-apps/quickstart-0.6 >=sys-apps/kicktoo-0.4.3 )
	sys-apps/iproute2
	>=app-portage/layman-1.3
	sys-boot/syslinux
	net-misc/ldminfod"

src_unpack() {
	bzr_src_unpack
}

src_install() {
	ltspshare="/usr/share/ltsp"
	ltspconf="/etc/ltsp"

	# executables
	dobin client/localapps/ltsp-localapps
	dosbin server/ltsp-config
	dosbin server/ltsp-info
	dosbin server/ltsp-build-client
	dosbin server/ltsp-update-kernels
	dosbin server/ltsp-update-sshkeys
	dosbin server/ltsp-chroot

	# plugins and libraries
	insinto ${ltspshare}
	newins common/ltsp-common-functions ltsp-server-common-functions
	doins server/share/ltsp/ltsp-server-functions
	doins server/Gentoo/share/ltsp/*

	insinto ${ltspshare}/plugins/ltsp-build-client/common
	doins -r server/share/ltsp/plugins/ltsp-build-client/common/*

	insinto ${ltspshare}/plugins/ltsp-build-client/Gentoo
	doins -r server/share/ltsp/plugins/ltsp-build-client/Gentoo/*

	# configuration
	insinto ${ltspconf}
	doins server/configs/ltsp-update-image.excludes
	doins server/configs/ltsp-server.conf
	doins server/Gentoo/configs/ltsp-build-client.conf

	insinto ${ltspconf}/profiles
	doins server/Gentoo/configs/profiles/*
	dosym quickstart-5.3.profile ${ltspconf}/profiles/quickstart.profile
	dosym kicktoo-5.3.profile ${ltspconf}/profiles/kicktoo.profile

	# man pages
	doman client/localapps/doc/ltsp-localapps.1
	doman server/doc/ltsp-build-client.8
	doman server/doc/ltsp-info.1
	doman server/doc/ltsp-update-kernels.8
	doman server/doc/ltsp-update-sshkeys.8
	doman server/doc/ltsp-chroot.8
	doman server/doc/ltsp-config.8

    if use nbd; then
		dosbin server/ltsp-update-image
		dosbin server/ltsp-swapfile-delete
		dosbin server/nbdswapd

		insinto /etc/xinetd.d
		doins server/Gentoo/configs/xinetd.d/*

		insinto ${ltspconf}
		doins server/configs/nbdswapd.conf

		doman server/doc/ltsp-update-image.8
		doman server/doc/nbdswapd.8
    fi

    if use doc; then
		dodoc common/doc/CodingStyle
		dodoc server/doc/plugins
	fi

	if use examples; then
		docinto examples
		dodoc client/localapps/doc/examples/*
		dodoc server/doc/examples/ltsp-server-dnsmasq.conf
	fi
}

pkg_postinst(){
	ewarn
	ewarn "You can choose to install a 5.2 or a 5.3+ client by pointing"
	ewarn "to it's appropriate build profile in /etc/ltsp/profiles."
	ewarn "Although not stable, the default is set to a 5.3+ client."
	 
	if use nbd; then
		einfo
		einfo "Only NFS is supported for mounting the client chroot."
		einfo "Mounting swap over NBD is supported."
	fi
	
	if use X; then
		einfo
		einfo "Don't forget to install a window manager,"
		einfo "you can't log in with X onto your server without one."
	fi
	
	ewarn
	ewarn "In line with upstream, the ltsp-update-kernels tool now also"
	ewarn "removes old boot files from the tftpdir. It removes all"
	ewarn "default genkernel generated filenames for which the version"
	ewarn "is different from the chroot kernel. For details, look at"
	ewarn "/usr/share/ltsp/ltsp-update-kernels-functions"
}