summaryrefslogtreecommitdiff
blob: ced5f192e4aaa45086552f67f15f6caead50aa71 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-rescue/freebsd-rescue-10.1.ebuild,v 1.1 2015/03/08 14:01:57 mgorny Exp $

EAPI=5

inherit bsdmk freebsd toolchain-funcs

DESCRIPTION="FreeBSD's rescue binaries"
SLOT="0"
LICENSE="BSD zfs? ( CDDL )"

IUSE="atm netware nis zfs"

if [[ ${PV} != *9999* ]]; then
	KEYWORDS="~amd64-fbsd ~x86-fbsd"
	SRC_URI="http://dev.gentoo.org/~mgorny/dist/freebsd/${RV}/${UBIN}.tar.xz
			http://dev.gentoo.org/~mgorny/dist/freebsd/${RV}/${CONTRIB}.tar.xz
			http://dev.gentoo.org/~mgorny/dist/freebsd/${RV}/${LIB}.tar.xz
			http://dev.gentoo.org/~mgorny/dist/freebsd/${RV}/${BIN}.tar.xz
			http://dev.gentoo.org/~mgorny/dist/freebsd/${RV}/${SBIN}.tar.xz
			http://dev.gentoo.org/~mgorny/dist/freebsd/${RV}/${USBIN}.tar.xz
			http://dev.gentoo.org/~mgorny/dist/freebsd/${RV}/${GNU}.tar.xz
			http://dev.gentoo.org/~mgorny/dist/freebsd/${RV}/${SYS}.tar.xz
			http://dev.gentoo.org/~mgorny/dist/freebsd/${RV}/${LIBEXEC}.tar.xz
			http://dev.gentoo.org/~mgorny/dist/freebsd/${RV}/${RESCUE}.tar.xz
			zfs? ( http://dev.gentoo.org/~mgorny/dist/freebsd/${RV}/${CDDL}.tar.xz )"
fi

RDEPEND=""
DEPEND="sys-devel/flex
	app-arch/xz-utils[static-libs]
	sys-libs/ncurses[static-libs]
	dev-libs/expat[static-libs]
	app-arch/bzip2[static-libs]
	dev-libs/libedit[static-libs]
	dev-libs/libxml2:2[static-libs]
	dev-libs/openssl[static-libs]
	sys-libs/zlib[static-libs]
	sys-libs/readline[static-libs]
	=sys-freebsd/freebsd-lib-${RV}*[atm?,netware?]
	=sys-freebsd/freebsd-sources-${RV}*
	=sys-freebsd/freebsd-mk-defs-${RV}*
	zfs? ( =sys-freebsd/freebsd-cddl-${RV}* )"

S="${WORKDIR}/rescue"

pkg_setup() {
	use atm || mymakeopts="${mymakeopts} WITHOUT_ATM= "
	use netware || mymakeopts="${mymakeopts} WITHOUT_IPX= "
	use nis || mymakeopts="${mymakeopts} WITHOUT_NIS= "
	use zfs || mymakeopts="${mymakeopts} WITHOUT_CDDL= "
	mymakeopts="${mymakeopts} NO_PIC= "
}

src_prepare() {
	# As they are patches from ${WORKDIR} apply them by hand
	cd "${WORKDIR}"
	epatch "${FILESDIR}/${PN}"-10.0-zlib.patch
	epatch "${FILESDIR}/freebsd-sbin-bsdxml2expat.patch"
}

src_compile() {
	tc-export CC
	# crunchgen is now checks env MAKE.
	# Use to force BSD's make
	export MAKE=/usr/bin/make

	cd "${WORKDIR}/lib/libarchive"
	echo "#include <expat.h>" > bsdxml.h
	freebsd_src_compile
	export CC="${CC} -L${WORKDIR}/lib/libarchive"

	cd "${S}"
	freebsd_src_compile
}