summaryrefslogtreecommitdiff
blob: 955cb9ab22cd3386f970560e0d0a344dd214b465 (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
# Copyright 1999-2007 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="http://www.electron.me.uk/files/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86"
IUSE=""
S="${WORKDIR}/${PN}"

DEPEND=""
RDEPEND="${DEPEND}"

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

	exeinto "${PORTCFG}/bin"
	doexe post_sync

	exeinto "${PSBIN}"
	doexe bin/*

	dodir "${PSETC}"

	dodoc README ChangeLog doc/*
}

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
}