| 1 |
# Copyright 1999-2013 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/dev-util/plan9port/plan9port-20121219.ebuild,v 1.2 2013/01/04 04:06:41 blueness Exp $ |
| 4 |
|
| 5 |
EAPI="4" |
| 6 |
|
| 7 |
inherit eutils |
| 8 |
|
| 9 |
DESCRIPTION="Port of many Plan 9 programs and libraries" |
| 10 |
HOMEPAGE="http://swtch.com/plan9port/" |
| 11 |
SRC_URI="http://${PN}.googlecode.com/files/${P}.tgz" |
| 12 |
|
| 13 |
LICENSE="9base BSD-4 MIT LGPL-2.1 BigelowHolmes" |
| 14 |
SLOT="0" |
| 15 |
KEYWORDS="~amd64 ~x86" |
| 16 |
IUSE="" |
| 17 |
|
| 18 |
DEPEND="x11-apps/xauth" |
| 19 |
RDEPEND="${DEPEND}" |
| 20 |
|
| 21 |
S="${WORKDIR}/${PN}" |
| 22 |
|
| 23 |
PLAN9=/usr/lib/plan9 |
| 24 |
|
| 25 |
src_prepare() |
| 26 |
{ |
| 27 |
epatch "${FILESDIR}/${PN}-"{9660srv-errno,noexecstack}".patch" |
| 28 |
|
| 29 |
# Fix paths, done in place of ./INSTALL -c |
| 30 |
einfo "Fixing hard-coded /usr/local/plan9 paths" |
| 31 |
grep --null -l -r '/usr/local/plan9' | |
| 32 |
xargs --null sed -i "s!/usr/local/plan9!${PLAN9}!g" |
| 33 |
} |
| 34 |
|
| 35 |
src_compile() { |
| 36 |
# Convert -j5 to NPROC=5 for mk |
| 37 |
export NPROC="$(echo "$MAKEOPTS" | sed -r -n 's/.*(^| )-j([0-9]*).*/\2/p')" |
| 38 |
|
| 39 |
# The INSTALL script builds mk then [re]builds everything using that |
| 40 |
einfo "Compiling Plan 9 from User Space can take a very long time" |
| 41 |
einfo "depending on the speed of your computer. Please be patient!" |
| 42 |
./INSTALL -b |
| 43 |
} |
| 44 |
|
| 45 |
src_install() { |
| 46 |
dodir "${PLAN9}" |
| 47 |
|
| 48 |
# P9P's man does not handle compression |
| 49 |
docompress -x $PLAN9/man |
| 50 |
|
| 51 |
# do* plays with the executable bit, and we should not modify them |
| 52 |
cp -a * "${D}/${PLAN9}" |
| 53 |
|
| 54 |
# build the environment variables and install them in env.d |
| 55 |
cat > "${T}/30plan9" <<-EOF |
| 56 |
PLAN9="${PLAN9}" |
| 57 |
PATH="${PLAN9}/bin" |
| 58 |
ROOTPATH="${PLAN9}/bin" |
| 59 |
MANPATH="${PLAN9}/man" |
| 60 |
EOF |
| 61 |
doenvd "${T}/30plan9" |
| 62 |
} |
| 63 |
|
| 64 |
pkg_postinst() { |
| 65 |
elog "Plan 9 from User Space has been successfully installed into" |
| 66 |
elog "${PLAN9}. Your PLAN9 and PATH environment variables have" |
| 67 |
elog "also been appropriately set, please use env-update and" |
| 68 |
elog "source /etc/profile to bring that into immediate effect." |
| 69 |
elog |
| 70 |
elog "Please note that ${PLAN9}/bin has been appended to the" |
| 71 |
elog "*end* or your PATH to prevent conflicts. To use the Plan9" |
| 72 |
elog "versions of common UNIX tools, use the absolute path:" |
| 73 |
elog "${PLAN9}/bin or the 9 command (eg: 9 troff)" |
| 74 |
elog |
| 75 |
elog "Please report any bugs to bugs.gentoo.org, NOT Plan9Port." |
| 76 |
} |