/
gcc-switcher-1.1.ebuild
52 lines (43 loc) · 1.4 KB
/
gcc-switcher-1.1.ebuild
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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=4
inherit eutils
DESCRIPTION="Switch gcc's version per package"
HOMEPAGE="https://github.com/megabaks/gcc-switcher"
SRC_URI="https://github.com/downloads/megabaks/${PN}/${P}.tar.gz"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
DEPEND="app-shells/bash
sys-apps/portage"
RDEPEND="${DEPEND}"
S="${WORKDIR}"
src_install(){
insinto /etc/portage
doins gcc-switcher
if [ -f "${ROOT}/etc/portage/package.compilers" ];then
cp "${ROOT}/etc/portage/package.compilers" "${D}/etc/portage/package.compilers"
elif [ -d "${ROOT}/etc/portage/package.compilers" ];then
insinto /etc/portage/package.compilers
doins "${FILESDIR}/package.compilers"
else
insinto /etc/portage
doins "${FILESDIR}/package.compilers"
fi
if [ -f "${ROOT}/etc/portage/package.compilers-full" ];then
cp "${ROOT}/etc/portage/package.compilers-full" "${D}/etc/portage/package.compilers-full"
elif [ -d "${ROOT}/etc/portage/package.compilers-full" ];then
insinto /etc/portage/package.compilers-full
doins "${FILESDIR}/package.compilers-full"
else
insinto /etc/portage
doins "${FILESDIR}/package.compilers-full"
fi
}
pkg_postinst() {
if grep -q gcc-switcher "${ROOT}/etc/portage/bashrc";then
elog "Now you need run:\necho 'source /etc/portage/gcc-switcher' >> /etc/portage/bashrc"
fi
}