]> Pileus Git - ~andy/sunrise/blob - app-portage/postsync/postsync-0.2_alpha.ebuild
955cb9ab22cd3386f970560e0d0a344dd214b465
[~andy/sunrise] / app-portage / postsync / postsync-0.2_alpha.ebuild
1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit multilib
6
7 DESCRIPTION="Package for controlling post emerge --sync operations"
8 HOMEPAGE="http://www.electron.me.uk/postsync.html"
9 SRC_URI="http://www.electron.me.uk/files/${P}.tar.bz2"
10
11 LICENSE="GPL-2"
12 SLOT="0"
13 KEYWORDS="~x86"
14 IUSE=""
15 S="${WORKDIR}/${PN}"
16
17 DEPEND=""
18 RDEPEND="${DEPEND}"
19
20 src_install() {
21         PORTCFG=$(python -c 'import portage; print portage.USER_CONFIG_PATH,') \
22                 || die "Cannot get config path"
23         PSDIR="/usr/$(get_libdir)/postsync.d"
24         PSBIN="${PSDIR}/bin"
25         PSETC="${PSDIR}/etc"
26
27         exeinto /usr/sbin
28         doexe postsync
29
30         exeinto "${PORTCFG}/bin"
31         doexe post_sync
32
33         exeinto "${PSBIN}"
34         doexe bin/*
35
36         dodir "${PSETC}"
37
38         dodoc README ChangeLog doc/*
39 }
40
41 pkg_postinst() {
42         ebegin "Moving any existing config files ..."
43         PORTCFG=$(python -c 'import portage; print portage.USER_CONFIG_PATH,')
44         if [ -f ${PORTCFG}/package.warnme ]
45         then
46                 mv "${PORTCFG}/package.warnme" /usr/$(get_libdir)/postsync.d/etc
47         fi
48         eend
49
50         einfo
51         einfo "Use postsync -l to see what programs are available then"
52         einfo "postsync -e -a <prog> [prog ...] to activate the ones you want."
53         einfo
54 }
55
56 pkg_prerm() {
57         /usr/sbin/postsync -d
58 }