summaryrefslogtreecommitdiff
blob: e879dabd0e8836517b6220276d9aea6d60fd2049 (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
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit multilib

DESCRIPTION="Package for controlling post emerge --sync operations"
HOMEPAGE="http://www.electron.me.uk/postsync.html"
SRC_URI="ftp://ftp.electron.me.uk/${P}.tar.bz2"

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

S="${WORKDIR}/${PN}"

src_install() {
	PORTCFG=$(python -c 'import portage; print portage.USER_CONFIG_PATH,') \
		|| die "Cannot get config path"
	PSDIR="/usr/$(get_libdir)/postsync.d"
	PSBIN="${PSDIR}/bin"
	PSETC="${PSDIR}/etc"

	exeinto /usr/sbin
	doexe postsync || die

	exeinto "${PORTCFG}/bin"
	doexe post_sync || die

	exeinto "${PSBIN}"
	doexe bin/* || die

	dodir "${PSETC}" || die

	dodoc README ChangeLog doc/* || die
}

pkg_postinst() {
	ebegin "Moving any existing config files ..."
	PORTCFG=$(python -c 'import portage; print portage.USER_CONFIG_PATH,')
	if [ -f ${PORTCFG}/package.warnme ]
	then
		mv "${PORTCFG}/package.warnme" /usr/$(get_libdir)/postsync.d/etc
	fi
	eend

	einfo
	einfo "Use postsync -l to see what programs are available then"
	einfo "postsync -e -a <prog> [prog ...] to activate the ones you want."
	einfo
}

pkg_prerm() {
	/usr/sbin/postsync -d
}