summaryrefslogtreecommitdiff
blob: 4aca1732950902eae1bf8b708f5f53219e53f2c8 (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
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5
MODULE_VERSION=0.02.10
inherit perl-module eutils prefix

DESCRIPTION="Portage abstraction layer for perl"
HOMEPAGE="http://download.mpsna.de/opensource/PortageXS/"
SRC_URI="http://download.mpsna.de/opensource/PortageXS/${PN}-${MODULE_VERSION}.tar.gz"

SLOT="0"
LICENSE="GPL-2"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
IUSE="minimal"
SRC_TEST="do"

DEPEND="
	virtual/perl-Term-ANSIColor
	dev-perl/Shell-EnvImporter
	!minimal? (
		dev-perl/IO-Socket-SSL
		virtual/perl-Sys-Syslog
	)
"
RDEPEND="${DEPEND}"

src_prepare() {
	epatch "${FILESDIR}"/${PN}-0.02.10-portage_path_fix.patch
	epatch "${FILESDIR}"/${PN}-0.02.10-prefix.patch

	eprefixify \
		lib/PortageXS/Core.pm \
		lib/PortageXS.pm \
		usr/bin/portagexs_client \
		usr/sbin/portagexsd

	if use minimal ; then
		rm -r "${S}"/usr || die
		rm -r "${S}"/etc/init.d || die
		rm -r "${S}"/etc/pxs/certs || die
		rm "${S}"/etc/pxs/portagexsd.conf || die
		rm -r "${S}"/lib/PortageXS/examples || die
	fi
}

src_install() {
	perl-module_src_install
	if use !minimal ; then
		cp -r "${S}"/usr "${D}${EPREFIX}" || die
	fi
	cp -r "${S}"/etc "${D}${EPREFIX}" || die
}

pkg_postinst() {
	if [ -d "${EPREFIX}"/etc/portagexs ]; then
		elog "${EPREFIX}/etc/portagexs has been moved to ${EPREFIX}/etc/pxs for convenience.  It is safe"
		elog "to delete old ${EPREFIX}/etc/portagexs directories."
	fi
}