summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2009-05-22 13:27:56 +0000
committerAlexis Ballier <aballier@gentoo.org>2009-05-22 13:27:56 +0000
commit15cda902a32df85eea9a74d5e6de6ef7a05110f1 (patch)
treece8d64ebab3fe160331ad08a207ed4b9a7a36da3 /sys-freebsd
parentUse emake (diff)
downloadhistorical-15cda902a32df85eea9a74d5e6de6ef7a05110f1.tar.gz
historical-15cda902a32df85eea9a74d5e6de6ef7a05110f1.tar.bz2
historical-15cda902a32df85eea9a74d5e6de6ef7a05110f1.zip
bump to 7.2
Package-Manager: portage-2.2_rc33/cvs/Linux x86_64
Diffstat (limited to 'sys-freebsd')
-rw-r--r--sys-freebsd/freebsd-lib/ChangeLog7
-rw-r--r--sys-freebsd/freebsd-lib/Manifest17
-rw-r--r--sys-freebsd/freebsd-lib/freebsd-lib-7.2.ebuild366
3 files changed, 385 insertions, 5 deletions
diff --git a/sys-freebsd/freebsd-lib/ChangeLog b/sys-freebsd/freebsd-lib/ChangeLog
index 0e9ea029a7d8..12f54f1e7b9c 100644
--- a/sys-freebsd/freebsd-lib/ChangeLog
+++ b/sys-freebsd/freebsd-lib/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-freebsd/freebsd-lib
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog,v 1.72 2009/05/21 10:48:51 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/ChangeLog,v 1.73 2009/05/22 13:27:56 aballier Exp $
+
+*freebsd-lib-7.2 (22 May 2009)
+
+ 22 May 2009; Alexis Ballier <aballier@gentoo.org> +freebsd-lib-7.2.ebuild:
+ bump to 7.2
21 May 2009; Diego E. Pettenò <flameeyes@gentoo.org>
freebsd-lib-7.1-r4.ebuild:
diff --git a/sys-freebsd/freebsd-lib/Manifest b/sys-freebsd/freebsd-lib/Manifest
index 7fe18457b236..6141e7cbb30c 100644
--- a/sys-freebsd/freebsd-lib/Manifest
+++ b/sys-freebsd/freebsd-lib/Manifest
@@ -24,29 +24,38 @@ AUX freebsd-lib-new_as.patch 1494 RMD160 36ac871434f9994d5a0d7e1b73765c055d49948
AUX libmap.conf 201 RMD160 ad0ab6c08b5c541e0e45636dcbbaa468bbae2f95 SHA1 df81db07a94d988f1c41b4696b4d3b0058e73f83 SHA256 36a1bd56965f171cbb058f6e1762801e3b92c083fe36f6fe046bd669beed9742
DIST freebsd-contrib-6.2.tar.bz2 36594160 RMD160 8b89f1ac72ba0054efe1aec2d747ecd33789fde3 SHA1 02493b8d90b0e1bb4304ce6466203135bf5709b1 SHA256 dbbd9198597e176242806329242d0e12181820a921e5da42aadefaacda1b6277
DIST freebsd-contrib-7.1.tar.bz2 41014879 RMD160 c604f44a1d41190c984ebca298e9777be56fcaab SHA1 9ee16db2c60f3412b72e214e8bd0b11f92748796 SHA256 ff273f6b2ea3cdd743632e591928563e73221aa1ba77e874009daffbad8c78e5
+DIST freebsd-contrib-7.2.tar.bz2 41156304 RMD160 d32da79d66aa9e5cd113bd7b3a16b7d83849dca2 SHA1 8f3778a1638bfe852f95d746d181a56258446182 SHA256 e6b5b4320552185d64a1d17676ca4376ca43f147eafaee7e2b0885571e4ee1f2
DIST freebsd-crypto-6.2.tar.bz2 4004897 RMD160 dd1f9005ad44bde627b1364906d229f06627f394 SHA1 b2fa348f110aa9dd356e3c3577dcc503ccad2f8f SHA256 3086794bcf87827ab9e6b6a4d794c90dfc90cdaebd7d2e6bee934496d7fcc353
DIST freebsd-crypto-7.1.tar.bz2 4317948 RMD160 a064761c82c477583cc832060c33ef6ca3438b15 SHA1 f74a2df58beffd132900aab835250f92f1334025 SHA256 eefeb9c25b051f1cda3566cde2626be04536191a0f99e9c93641a28f50f5579e
+DIST freebsd-crypto-7.2.tar.bz2 4318008 RMD160 2dfa213a9384c4ab0358ebbf1d432cd58fac0f9c SHA1 d89fd8f2132c88b360f0c7f3861b55092f5118a4 SHA256 479defd73c8b67dff02beaeccd0bf5032cdd3772e0cdcb59bde577ce6179e178
DIST freebsd-etc-6.2.tar.bz2 190297 RMD160 1540601566ece689b3fc2935329a2eca62a24314 SHA1 e8337672d0a0d207a9e9674c9f516d8ed94af0cf SHA256 ff5970db1d7842d2933589203ae0c3907dee427b2ea99de68fce678582bf1804
DIST freebsd-etc-7.1.tar.bz2 197584 RMD160 c9404684b8abeb89d4490cb366232b9ddc02c8fe SHA1 93edd3acb45c8c8fd4b1bd520d5f40ab23a03dc3 SHA256 01943b5d17af8a4f99a15ee5636016d7ec55d85d58e260e95507c5ac3218cd3b
+DIST freebsd-etc-7.2.tar.bz2 199580 RMD160 f8954a1c590c918861b39cb414a079a960af9969 SHA1 a2fee43a6a6fffd864776eceab134002fc9292d2 SHA256 9a6ebd6877191e7ff5d734a77da16090123c5223cfe873177b9fe1ca4f12d653
DIST freebsd-include-6.2.tar.bz2 131651 RMD160 9264ba0661bbdceba85c4bef19a2ebd788ec6957 SHA1 2e36c98dc3b6c1588eb78d5483475bea441a695a SHA256 38928510c34efd735a977896a9f96e71b48c22cf4727677ee954a23aff871d53
DIST freebsd-include-7.1.tar.bz2 135238 RMD160 4570fcb7a8049e32e2793c2a85e641a2db180181 SHA1 61fb8404aa94b92a2500ebdc9d61666f3d27b0cd SHA256 675d13874810445ed43b2630eb3537c1afe10cbc7d7fc0cf36e13d39f6e63124
+DIST freebsd-include-7.2.tar.bz2 135657 RMD160 ee9db50e6fcf218929fdff06aabcf31ad2035965 SHA1 3c2369272005c1f2620b9dcc760047de7cab963a SHA256 8640d655e3cefeea14250dbe5e7fd7f56d1de78d79c4adcc6232f70bba89f5d4
DIST freebsd-lib-6.2.tar.bz2 2670374 RMD160 95bbce7862fc7a406b8629914f281d5e01e5ea71 SHA1 3cd061f83ef6672d98599dd3a294ead6832a1b14 SHA256 8e0c909a79a9ed18841f8a5a6e25fc770f76de1a5dc20cbd6bc591bed52d1033
DIST freebsd-lib-7.1.tar.bz2 2960439 RMD160 9a6ade2a84b6f5d49aff4c64a07ddb9cee916511 SHA1 5b632bc3dbf72dbf76691cdf20e03667affaece2 SHA256 9891c9887aa33a7fa17c4893c50db1ac3ecae5a76c3f31ee0294344a47b62db1
+DIST freebsd-lib-7.2.tar.bz2 2970356 RMD160 d676e9bfd3a32293ac1190ff3c42861fb987394e SHA1 15749e43f5ed16316c5311bfa40f42ed546b69e9 SHA256 80b54a23068b806aede48700884a5ed2aa33f5d813309ef7497a7b951d62aab0
DIST freebsd-libexec-6.2.tar.bz2 277231 RMD160 423490cb7c888bfce7edcf473d77868c65c21fe2 SHA1 86f58d8f6e4eff022720a6ada60f2d9c5549c861 SHA256 546821f50ff3e69cebd59e1415798233050259de33a4b37acfcbd56b8d92782b
DIST freebsd-libexec-7.1.tar.bz2 276019 RMD160 1484fbe1fda4be2cdbefecef46312241bcae39e4 SHA1 8d468b54986e49bda44c1d860d71da967bafd700 SHA256 add412192d8b829d75d66f73f3ae9ac76707fd341f36df4b88346567781d859b
+DIST freebsd-libexec-7.2.tar.bz2 275993 RMD160 e3cfab5b89c304eeff76d92eaadaaadb6322c90e SHA1 747aa2365565fabb97aa910c01c06b340ddf3ea2 SHA256 375627cd871a4fbed4b7ec79d788bb5e62bc6cc818e971c613b3acd89b2db453
DIST freebsd-sys-6.2.tar.bz2 18344936 RMD160 784230e22ccaf09933ef3f053ff29cc3e579786a SHA1 161b7a4d165665deb1c4434c356b5f610a72a83a SHA256 a754371d88601aaab7152bb3d127bd3777db912e13a26a866e13ba34934c5e5b
DIST freebsd-sys-7.1.tar.bz2 22471627 RMD160 2e09c51d3ffaaf62bd2fbeed8dd949a1463fab4e SHA1 8c53e0d3e20c52c21e8017b35c6e63a65a72a390 SHA256 336734d3e6e90cfc73e5f6b082a42fd4ccb7141912710e173a7da454159750ce
+DIST freebsd-sys-7.2.tar.bz2 23005928 RMD160 0ecdff9fbefe9e16325e09a76310ca2b4a7751b8 SHA1 1c2d6894371a8650288ebf1a4831a4b08c2e4f09 SHA256 38e1fc670b8438be42947b1512ca7d10b0f8c62c58d3234afd8ce2e55b6cae11
DIST freebsd-usbin-6.2.tar.bz2 2695872 RMD160 ea6104fcfbf6c0be511a80d0475e5a8f716292be SHA1 4772ed5fdc591273887fc7a2e97bddf7a1669b5d SHA256 6195301d39e7bc7fa00f6dec71479b1800ea5c3dc9d3ea375dafe4e71e6485f0
DIST freebsd-usbin-7.1.tar.bz2 2584691 RMD160 cf6adf2f1cc60e667417f647cb99bbc3107c85f6 SHA1 7120dd7e7abed78954889ad4e18e5f8775411621 SHA256 e14cd80187a161153ea5eb6e5441171bf1ca1a8b8e8bdeea7306187c77c52af8
+DIST freebsd-usbin-7.2.tar.bz2 2654480 RMD160 af0a94e0affce332cf30532ea45251563e65632e SHA1 b52db981e0250357b40d10ebc7ffd6ca3ea9cc4c SHA256 56574e81ac4ab54a20d83d9a2d1ba3a42b5677691675f1db162fde161da0907f
EBUILD freebsd-lib-6.2-r4.ebuild 9534 RMD160 70d7d2e65c8aa287a0c34ef4bf2be11c2c6d3a6b SHA1 cac825220b60e07e82c509894a7c1de60b591810 SHA256 1da8e2e12b023bf035ddca90222b842b867fb51b0d5c509ed7e7e6654bd8ec1e
EBUILD freebsd-lib-7.1-r3.ebuild 11966 RMD160 690f282706768633a0178ccc8887f3fc25d7131f SHA1 24ba466b0a1249dd4170205fbdcf95761261caf2 SHA256 88eaf2167f2bb1109c1d5dd42434caac09c6fae322bef7ece0f6bcbdc238f88f
EBUILD freebsd-lib-7.1-r4.ebuild 12099 RMD160 48a35b121fd9da509d240d8ea5fdd9308357ddd8 SHA1 8cd9201989dd27ac80d1ee53dffde76848daae36 SHA256 dca49dbe5bbbfac98af82848360156522ebc8b52cfe9a28abb23c56d969526dc
-MISC ChangeLog 18219 RMD160 3d1aea2ca58df994c663142706e17b8fc494e562 SHA1 8e8b30ed0016345e71919ab95ca9d606f0c3975c SHA256 4277cf00c3cfbed2aa24b04e3f9d7d0f1c77be7204b0d1b45bd9fd758449b765
+EBUILD freebsd-lib-7.2.ebuild 12011 RMD160 593a0f2d15d7533af15ffd2f130d3b7e64ea705b SHA1 d6b338db98706f8feb3a49c9c9825041bf8d1079 SHA256 1b65eb2c527acdf750b405a368c4f8f4f3693e581ef4cb7b817efb66bf3b8b72
+MISC ChangeLog 18342 RMD160 843c82accf90dcb75d3c77b21fb12e93c968194a SHA1 f024fc224aefbae3a34f597faf66b34c66457032 SHA256 a56416a160f31a8a3eeba8212528c8fb91f83e1dd2673a910ec2fa4582ac0e23
MISC metadata.xml 436 RMD160 2ad56040ef5be56d841fac077d2d1c45e128be05 SHA1 02288145006b086b03506967c92f08c6e3cd1fce SHA256 69c50839346fe9342a2abb6aabfcdc2dc48cd5256d5c789782909d1bf360cf98
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
-iEYEARECAAYFAkoVMZ8ACgkQAiZjviIA2Xg4tACgo/EMTm7RryDOUcWIO2Nebp4o
-aCIAnjoJQMyOdSstnVqOgbYXMxq9M8gs
-=y6UF
+iEYEARECAAYFAkoWqGMACgkQvFcC4BYPU0o4BgCfX70m8GOhNfG1yj5cMVxjF83D
+LnwAnRIIkwpK0ZBcp3fF86JLmvvoc1Ni
+=xcBW
-----END PGP SIGNATURE-----
diff --git a/sys-freebsd/freebsd-lib/freebsd-lib-7.2.ebuild b/sys-freebsd/freebsd-lib/freebsd-lib-7.2.ebuild
new file mode 100644
index 000000000000..28e714053f80
--- /dev/null
+++ b/sys-freebsd/freebsd-lib/freebsd-lib-7.2.ebuild
@@ -0,0 +1,366 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/freebsd-lib-7.2.ebuild,v 1.1 2009/05/22 13:27:56 aballier Exp $
+
+EAPI=2
+
+inherit bsdmk freebsd flag-o-matic multilib toolchain-funcs
+
+DESCRIPTION="FreeBSD's base system libraries"
+SLOT="7.0"
+KEYWORDS="~sparc-fbsd ~x86-fbsd"
+
+# Crypto is needed to have an internal OpenSSL header
+# sys is needed for libalias, probably we can just extract that instead of
+# extracting the whole tarball
+SRC_URI="mirror://gentoo/${LIB}.tar.bz2
+ mirror://gentoo/${CONTRIB}.tar.bz2
+ mirror://gentoo/${CRYPTO}.tar.bz2
+ mirror://gentoo/${LIBEXEC}.tar.bz2
+ mirror://gentoo/${ETC}.tar.bz2
+ mirror://gentoo/${INCLUDE}.tar.bz2
+ nis? ( mirror://gentoo/${USBIN}.tar.bz2 )
+ build? (
+ mirror://gentoo/${SYS}.tar.bz2 )"
+
+if [ "${CATEGORY#*cross-}" = "${CATEGORY}" ]; then
+ RDEPEND="ssl? ( dev-libs/openssl )
+ hesiod? ( net-dns/hesiod )
+ kerberos? ( virtual/krb5 )
+ !sys-freebsd/freebsd-headers
+ dev-libs/libelf"
+ DEPEND="${RDEPEND}
+ >=sys-devel/flex-2.5.31-r2
+ =sys-freebsd/freebsd-sources-${RV}*
+ !bootstrap? ( app-arch/bzip2 )"
+
+ PROVIDE="virtual/libc
+ virtual/os-headers"
+
+else
+ SRC_URI="${SRC_URI}
+ mirror://gentoo/${SYS}.tar.bz2"
+fi
+
+DEPEND="${DEPEND}
+ =sys-freebsd/freebsd-mk-defs-${RV}*"
+
+S="${WORKDIR}/lib"
+
+export CTARGET=${CTARGET:-${CHOST}}
+if [ "${CTARGET}" = "${CHOST}" -a "${CATEGORY#*cross-}" != "${CATEGORY}" ]; then
+ export CTARGET=${CATEGORY/cross-}
+fi
+
+IUSE="atm bluetooth ssl hesiod ipv6 kerberos nis usb netware
+ build bootstrap crosscompile_opts_headers-only"
+
+pkg_setup() {
+ [ -c /dev/zero ] || \
+ die "You forgot to mount /dev; the compiled libc would break."
+
+ if ! use ssl && use kerberos; then
+ eerror "If you want kerberos support you need to enable ssl support, too."
+ fi
+
+ use atm || mymakeopts="${mymakeopts} WITHOUT_ATM= "
+ use bluetooth || mymakeopts="${mymakeopts} WITHOUT_BLUETOOTH= "
+ use hesiod || mymakeopts="${mymakeopts} WITHOUT_HESIOD= "
+ use ipv6 || mymakeopts="${mymakeopts} WITHOUT_INET6_SUPPORT= "
+ use kerberos || mymakeopts="${mymakeopts} WITHOUT_KERBEROS_SUPPORT= "
+ use netware || mymakeopts="${mymakeopts} WITHOUT_IPX= WITHOUT_IPX_SUPPORT= WITHOUT_NCP= "
+ use nis || mymakeopts="${mymakeopts} WITHOUT_NIS= "
+ use ssl || mymakeopts="${mymakeopts} WITHOUT_OPENSSL= "
+ use usb || mymakeopts="${mymakeopts} WITHOUT_USB= "
+
+ mymakeopts="${mymakeopts} WITHOUT_BIND= WITHOUT_BIND_LIBS= WITHOUT_SENDMAIL="
+
+ if [ "${CTARGET}" != "${CHOST}" ]; then
+ mymakeopts="${mymakeopts} MACHINE=$(tc-arch-kernel ${CTARGET})"
+ mymakeopts="${mymakeopts} MACHINE_ARCH=$(tc-arch-kernel ${CTARGET})"
+ fi
+}
+
+PATCHES="${FILESDIR}/${PN}-bsdxml.patch
+ ${FILESDIR}/${PN}-6.0-pmc.patch
+ ${FILESDIR}/${PN}-6.0-gccfloat.patch
+ ${FILESDIR}/${PN}-6.0-flex-2.5.31.patch
+ ${FILESDIR}/${PN}-6.1-csu.patch
+ ${FILESDIR}/${PN}-6.2-bluetooth.patch
+ ${FILESDIR}/${PN}-new_as.patch
+ ${FILESDIR}/${PN}-7.0-CVE-2008-1391.patch"
+
+# Here we disable and remove source which we don't need or want
+# In order:
+# - ncurses stuff
+# - archiving libraries (have their own ebuild)
+# - sendmail libraries (they are installed by sendmail)
+# - SNMP library and dependency (have their own ebuilds)
+#
+# The rest are libraries we already have somewhere else because
+# they are contribution.
+# Note: libtelnet is an internal lib used by telnet and telnetd programs
+# as it's not used in freebsd-lib package itself, it's pointless building
+# it here.
+REMOVE_SUBDIRS="ncurses
+ libz libbz2 libarchive \
+ libsm libsmdb libsmutil \
+ libbegemot libbsnmp \
+ libpam libpcap bind libwrap libmagic \
+ libcom_err libtelnet
+ libedit libelf"
+
+src_prepare() {
+ sed -i.bak -e 's:-o/dev/stdout:-t:' "${S}/libc/net/Makefile.inc"
+ sed -i.bak -e 's:histedit.h::' "${WORKDIR}/include/Makefile"
+
+ # Upstream Display Managers default to using VT7
+ # We should make FreeBSD allow this by default
+ local x=
+ for x in "${WORKDIR}"/etc/etc.*/ttys ; do
+ sed -i.bak \
+ -e '/ttyv5[[:space:]]/ a\
+# Display Managers default to VT7.\
+# If you use the xdm init script, keep ttyv6 commented out\
+# unless you force a different VT for the DM being used.' \
+ -e '/^ttyv[678][[:space:]]/ s/^/# /' "${x}" \
+ || die "Failed to sed ${x}"
+ rm "${x}".bak
+ done
+
+ # This one is here because it also
+ # patches "${WORKDIR}/include"
+ cd "${WORKDIR}"
+ epatch "${FILESDIR}/${PN}-includes.patch"
+
+ # Don't install the hesiod man page or header
+ rm "${WORKDIR}"/include/hesiod.h || die
+ sed -i.bak -e 's:hesiod.h::' "${WORKDIR}"/include/Makefile || die
+ sed -i.bak -e 's:hesiod.c::' -e 's:hesiod.3::' \
+ "${WORKDIR}"/lib/libc/net/Makefile.inc || die
+
+ # Apply this patch for Gentoo/FreeBSD/SPARC64 to build correctly
+ # from catalyst, then don't do anything else
+ if use build; then
+ cd "${WORKDIR}"
+ # This patch has to be applied on ${WORKDIR}/sys, so we do it here since it
+ # shouldn't be a symlink to /usr/src/sys (which should be already patched)
+ epatch "${FILESDIR}"/${PN}-7.1-types.h-fix.patch
+ # Preinstall includes so we don't use the system's ones.
+ mkdir "${WORKDIR}/include_proper" || die "Couldn't create ${WORKDIR}/include_proper"
+ install_includes "/include_proper"
+ return 0
+ fi
+
+ if [ "${CTARGET}" = "${CHOST}" ]; then
+ ln -s "/usr/src/sys-${RV}" "${WORKDIR}/sys" || die "Couldn't make sys symlink!"
+ else
+ sed -i.bak -e "s:/usr/include:/usr/${CTARGET}/usr/include:g" \
+ "${S}/libc/rpc/Makefile.inc" \
+ "${S}/libc/yp/Makefile.inc"
+ fi
+
+ if install --version 2> /dev/null | grep -q GNU; then
+ sed -i.bak -e 's:${INSTALL} -C:${INSTALL}:' "${WORKDIR}/include/Makefile"
+ fi
+
+ # Preinstall includes so we don't use the system's ones.
+ mkdir "${WORKDIR}/include_proper" || die "Couldn't create ${WORKDIR}/include_proper"
+ install_includes "/include_proper"
+
+ # Let arch-specific includes to be found
+ local machine
+ machine=$(tc-arch-kernel ${CTARGET})
+ ln -s "${WORKDIR}/sys/${machine}/include" "${WORKDIR}/include/machine" || \
+ die "Couldn't make ${machine}/include symlink."
+
+ cd "${S}"
+ use bootstrap && dummy_mk libstand
+}
+
+src_compile() {
+ cd "${WORKDIR}/include"
+ $(freebsd_get_bmake) CC=$(tc-getCC) || die "make include failed"
+
+ use crosscompile_opts_headers-only && return 0
+
+ # Don't use ssp until properly fixed
+ append-flags $(test-flags -fno-stack-protector -fno-stack-protector-all)
+
+ strip-flags
+ if [ "${CTARGET}" != "${CHOST}" ]; then
+ export YACC='yacc -by'
+ CHOST=${CTARGET} tc-export CC LD CXX
+
+ local machine
+ machine=$(tc-arch-kernel ${CTARGET})
+
+ local csudir
+ if [ -d "${S}/csu/${machine}-elf" ]; then
+ csudir="${S}/csu/${machine}-elf"
+ else
+ csudir="${S}/csu/${machine}"
+ fi
+ cd "${csudir}"
+ $(freebsd_get_bmake) ${mymakeopts} || die "make csu failed"
+
+ append-flags "-isystem /usr/${CTARGET}/usr/include"
+ append-flags "-isystem ${WORKDIR}/lib/libutil"
+ append-flags "-isystem ${WORKDIR}/lib/msun/${machine/i386/i387}"
+ append-flags "-B ${csudir}"
+ append-ldflags "-B ${csudir}"
+
+ cd "${S}/libc"
+ $(freebsd_get_bmake) ${mymakeopts} || die "make libc failed"
+ cd "${S}/msun"
+ $(freebsd_get_bmake) ${mymakeopts} || die "make libc failed"
+ else
+ # Forces to use the local copy of headers as they might be outdated in
+ # the system
+ append-flags "-isystem '${WORKDIR}/include_proper'"
+
+ cd "${S}"
+ NOFLAGSTRIP=yes freebsd_src_compile
+ fi
+}
+
+src_install() {
+ [ "${CTARGET}" = "${CHOST}" ] \
+ && INCLUDEDIR="/usr/include" \
+ || INCLUDEDIR="/usr/${CTARGET}/usr/include"
+ dodir ${INCLUDEDIR}
+ einfo "Installing for ${CTARGET} in ${CHOST}.."
+ install_includes ${INCLUDEDIR}
+
+ # Install math.h when crosscompiling, at this point
+ if [ "${CHOST}" != "${CTARGET}" ]; then
+ insinto "/usr/${CTARGET}/usr/include"
+ doins "${S}/msun/src/math.h"
+ fi
+
+ use crosscompile_opts_headers-only && return 0
+
+ if [ "${CTARGET}" != "${CHOST}" ]; then
+ local csudir
+ if [ -d "${S}/csu/$(tc-arch-kernel ${CTARGET})-elf" ]; then
+ csudir="${S}/csu/$(tc-arch-kernel ${CTARGET})-elf"
+ else
+ csudir="${S}/csu/$(tc-arch-kernel ${CTARGET})"
+ fi
+ cd "${csudir}"
+ $(freebsd_get_bmake) ${mymakeopts} DESTDIR="${D}" install \
+ FILESDIR="/usr/${CTARGET}/usr/lib" LIBDIR="/usr/${CTARGET}/usr/lib" || die "Install csu failed"
+
+ cd "${S}/libc"
+ $(freebsd_get_bmake) ${mymakeopts} DESTDIR="${D}" install NO_MAN= \
+ SHLIBDIR="/usr/${CTARGET}/lib" LIBDIR="/usr/${CTARGET}/usr/lib" || die "Install failed"
+
+ cd "${S}/msun"
+ $(freebsd_get_bmake) ${mymakeopts} DESTDIR="${D}" install NO_MAN= \
+ INCLUDEDIR="/usr/${CTARGET}/usr/include" \
+ SHLIBDIR="/usr/${CTARGET}/lib" LIBDIR="/usr/${CTARGET}/usr/lib" || die "Install failed"
+
+ dosym "usr/include" "/usr/${CTARGET}/sys-include"
+ else
+ cd "${S}"
+ # Set SHLIBDIR and LIBDIR for multilib
+ SHLIBDIR="/$(get_libdir)" LIBDIR="/usr/$(get_libdir)" mkinstall || die "Install failed"
+ fi
+
+ # Don't install the rest of the configuration files if crosscompiling
+ if [ "${CTARGET}" != "${CHOST}" ] ; then
+ # This is to get it stripped with the correct tools, otherwise it gets
+ # stripped with the host strip.
+ export CHOST=${CTARGET}
+ return 0
+ fi
+
+ # Add symlinks (-> libthr) for legacy threading libraries, since these are
+ # not built by us (they are disabled in FreeBSD-7 anyway).
+ dosym libthr.a /usr/$(get_libdir)/libpthread.a
+ dosym libthr.so /usr/$(get_libdir)/libpthread.so
+ dosym libthr.a /usr/$(get_libdir)/libc_r.a
+ dosym libthr.so /usr/$(get_libdir)/libc_r.so
+
+ # Add symlink (-> libthr) so previously built binaries still work.
+ dosym libthr.so.3 /$(get_libdir)/libpthread.so.2
+ dosym libthr.so.3 /$(get_libdir)/libc_r.so.6
+
+ # Compatibility symlinks to run FreeBSD 5.x binaries (ABI is mostly
+ # identical, remove when problems will actually happen)
+ dosym /lib/libc.so.7 /usr/$(get_libdir)/libc.so.6
+ dosym /lib/libc.so.6 /usr/$(get_libdir)/libc.so.5
+ dosym /lib/libm.so.4 /usr/$(get_libdir)/libm.so.3
+ dosym /lib/libm.so.5 /usr/$(get_libdir)/libm.so.4
+
+ # install libstand files
+ dodir /usr/include/libstand
+ insinto /usr/include/libstand
+ doins "${S}"/libstand/*.h
+
+ cd "${WORKDIR}/etc/"
+ insinto /etc
+ doins auth.conf nls.alias mac.conf netconfig
+
+ # Install ttys file
+ if [[ $(tc-arch-kernel) == "x86_64" ]]; then
+ local MACHINE="amd64"
+ else
+ local MACHINE="$(tc-arch-kernel)"
+ fi
+ doins "etc.${MACHINE}"/*
+
+ # Generate ldscripts, otherwise bad thigs are supposed to happen
+ gen_usr_ldscript libalias_cuseeme.so libalias_dummy.so libalias_ftp.so \
+ libalias_irc.so libalias_nbt.so libalias_pptp.so libalias_skinny.so \
+ libalias_smedia.so
+ # These show on QA warnings too, however they're pretty much bsd only,
+ # aka, no autotools for them.
+ # libbsdxml.so libcam.so libcrypt.so libdevstat.so libgeom.so \
+ # libipsec.so libipx.so libkiconv.so libkvm.so libmd.so libsbuf.so libufs.so \
+ # libutil.so
+
+ dodir /etc/sandbox.d
+ cat - > "${D}"/etc/sandbox.d/00freebsd <<EOF
+# /dev/crypto is used mostly by OpenSSL on *BSD platforms
+# leave it available as packages might use OpenSSL commands
+# during compile or install phase.
+SANDBOX_PREDICT="/dev/crypto"
+EOF
+}
+
+install_includes()
+{
+ local INCLUDEDIR="$1"
+
+ # The idea is to be called from either install or unpack.
+ # During unpack it's required to install them as portage's user.
+ if [[ "${EBUILD_PHASE}" == "install" ]]; then
+ local DESTDIR="${D}"
+ BINOWN="root"
+ BINGRP="wheel"
+ else
+ local DESTDIR="${WORKDIR}"
+ [[ -z "${USER}" ]] && USER="portage"
+ BINOWN="${USER}"
+ [[ -z "${GROUPS}" ]] && GROUPS="portage"
+ BINGRP="${GROUPS}"
+ fi
+
+ # Must exist before we use it.
+ [[ -d "${DESTDIR}${INCLUDEDIR}" ]] || die "dodir or mkdir ${INCLUDEDIR} before using install_includes."
+ cd "${WORKDIR}/include"
+
+ if [[ $(tc-arch-kernel) == "x86_64" ]]; then
+ local MACHINE="amd64"
+ else
+ local MACHINE="$(tc-arch-kernel)"
+ fi
+
+ einfo "Installing includes into ${INCLUDEDIR} as ${BINOWN}:${BINGRP}..."
+ $(freebsd_get_bmake) installincludes \
+ MACHINE=${MACHINE} DESTDIR="${DESTDIR}" \
+ INCLUDEDIR="${INCLUDEDIR}" BINOWN="${BINOWN}" \
+ BINGRP="${BINGRP}" || die "install_includes() failed"
+ einfo "includes installed ok."
+}