| 1 |
# Copyright 1999-2004 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header$
|
| 4 |
#
|
| 5 |
# Diego Pettenò <flameeyes@gentoo.org>
|
| 6 |
|
| 7 |
inherit versionator eutils flag-o-matic bsdmk
|
| 8 |
|
| 9 |
ECLASS=freebsd
|
| 10 |
INHERITED="$INHERITED $ECLASS"
|
| 11 |
|
| 12 |
KEYWORDS="~x86-fbsd ~amd64-fbsd"
|
| 13 |
LICENSE="BSD"
|
| 14 |
HOMEPAGE="http://www.freebsd.org/"
|
| 15 |
|
| 16 |
# Define global package names
|
| 17 |
LIB="freebsd-lib-${PV}"
|
| 18 |
BIN="freebsd-bin-${PV}"
|
| 19 |
CONTRIB="freebsd-contrib-${PV}"
|
| 20 |
SHARE="freebsd-share-${PV}"
|
| 21 |
UBIN="freebsd-ubin-${PV}"
|
| 22 |
USBIN="freebsd-usbin-${PV}"
|
| 23 |
HEADERS="freebsd-headers-${PV}"
|
| 24 |
CRYPTO="freebsd-crypto-${PV}"
|
| 25 |
LIBEXEC="freebsd-libexec-${PV}"
|
| 26 |
SBIN="freebsd-sbin-${PV}"
|
| 27 |
GNU="freebsd-gnu-${PV}"
|
| 28 |
ETC="freebsd-etc-${PV}"
|
| 29 |
SYS="freebsd-sys-${PV}"
|
| 30 |
INCLUDE="freebsd-include-${PV}"
|
| 31 |
RESCUE="freebsd-rescue-${PV}"
|
| 32 |
|
| 33 |
# Release version (5.3, 5.4, 6.0, etc)
|
| 34 |
RV="$(get_version_component_range 1-2)"
|
| 35 |
|
| 36 |
IUSE="profile"
|
| 37 |
|
| 38 |
#unalias -a
|
| 39 |
alias install-info='/usr/bin/bsdinstall-info'
|
| 40 |
|
| 41 |
EXPORT_FUNCTIONS src_compile src_install src_unpack
|
| 42 |
|
| 43 |
# doperiodic <kind> <file> ...
|
| 44 |
doperiodic() {
|
| 45 |
local kind=$1
|
| 46 |
shift
|
| 47 |
|
| 48 |
INSDESTTREE="/etc/periodic/${kind}"
|
| 49 |
INSOPTIONS="-m 0755" \
|
| 50 |
doins "$@"
|
| 51 |
}
|
| 52 |
|
| 53 |
freebsd_get_bmake() {
|
| 54 |
local bmake
|
| 55 |
bmake=$(get_bmake)
|
| 56 |
[[ ${CHOST} == *-freebsd* ]] || bmake="${bmake} -I /usr/share/mk/freebsd"
|
| 57 |
|
| 58 |
echo ${bmake}
|
| 59 |
}
|
| 60 |
|
| 61 |
freebsd_src_unpack() {
|
| 62 |
unpack ${A}
|
| 63 |
cd ${S}
|
| 64 |
|
| 65 |
for patch in ${PATCHES}; do
|
| 66 |
epatch ${patch}
|
| 67 |
done
|
| 68 |
|
| 69 |
dummy_mk ${REMOVE_SUBDIRS}
|
| 70 |
|
| 71 |
ebegin "Renaming libraries"
|
| 72 |
# We don't use libtermcap, we use libncurses
|
| 73 |
find ${S} -name Makefile -print0 | xargs -0 \
|
| 74 |
sed -i -e 's:-ltermcap:-lncurses:g; s:{LIBTERMCAP}:{LIBNCURSES}:g'
|
| 75 |
# flex provides libfl, not libl
|
| 76 |
find ${S} -name Makefile -print0 | xargs -0 \
|
| 77 |
sed -i -e 's:-ll:-lfl:g; s:{LIBL}:{LIBFL}:g'
|
| 78 |
|
| 79 |
eend $?
|
| 80 |
}
|
| 81 |
|
| 82 |
freebsd_src_compile() {
|
| 83 |
use profile && filter-flags "-fomit-frame-pointer"
|
| 84 |
use profile || mymakeopts="${mymakeopts} NOPROFILE= "
|
| 85 |
|
| 86 |
# Make sure to use FreeBSD definitions while crosscompiling
|
| 87 |
[[ -z ${BMAKE} ]] && BMAKE="$(freebsd_get_bmake)"
|
| 88 |
|
| 89 |
# Dirt hack to test a thing
|
| 90 |
export LD="ld"
|
| 91 |
bsdmk_src_compile
|
| 92 |
}
|
| 93 |
|
| 94 |
freebsd_src_install() {
|
| 95 |
use profile || mymakeopts="${mymakeopts} NOPROFILE= "
|
| 96 |
|
| 97 |
[[ -z ${BMAKE} ]] && BMAKE="$(freebsd_get_bmake)"
|
| 98 |
|
| 99 |
bsdmk_src_install
|
| 100 |
}
|