--- /dev/null
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-lib/freebsd-lib-6.2-r1.ebuild,v 1.1 2007/04/06 14:44:08 uberlord Exp $
+
+inherit bsdmk freebsd flag-o-matic toolchain-funcs
+
+DESCRIPTION="FreeBSD's base system libraries"
+SLOT="6.0"
+KEYWORDS="~sparc-fbsd ~x86-fbsd"
+
+IUSE="atm bluetooth ssl ipv6 kerberos nis gpib build bootstrap"
+
+# 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 )
+ kerberos? ( virtual/krb5 )
+ !sys-freebsd/freebsd-headers"
+ 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} && ${CATEGORY/cross-} != ${CATEGORY} ]]; then
+ export CTARGET=${CATEGORY/cross-}
+fi
+
+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} NO_ATM= "
+ use bluetooth || mymakeopts="${mymakeopts} NO_BLUETOOTH= "
+ use ssl || mymakeopts="${mymakeopts} NO_OPENSSL= NO_CRYPT= "
+ use ipv6 || mymakeopts="${mymakeopts} NO_INET6= "
+ use kerberos || mymakeopts="${mymakeopts} NO_KERBEROS= "
+ use nis || mymakeopts="${mymakeopts} NO_NIS= "
+ use gpib || mymakeopts="${mymakeopts} NO_GPIB= "
+
+ mymakeopts="${mymakeopts} NO_OPENSSH= NO_BIND= NO_SENDMAIL= "
+
+ replace-flags "-O?" -"O1"
+
+ 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.0-binutils-asm.patch
+ ${FILESDIR}/${PN}-6.0-ssp.patch
+ ${FILESDIR}/${PN}-6.1-csu.patch
+ ${FILESDIR}/${PN}-6.2-gcc41.patch
+ ${FILESDIR}/${PN}-6.2-sparc64.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="libncurses libform libmenu libpanel libedit \
+ libz libbz2 libarchive \
+ libsm libsmdb libsmutil \
+ libbegemot libbsnmp \
+ libpam libpcap bind libwrap libmagic \
+ libcom_err libtelnet"
+
+src_unpack() {
+ freebsd_src_unpack
+
+ sed -i -e 's:-o/dev/stdout:-t:' "${S}/libc/net/Makefile.inc"
+ sed -i -e 's:histedit.h::' "${WORKDIR}/include/Makefile"
+
+ # Apply this patch for Gentoo/FreeBSD/SPARC64 to build correctly
+ # from catalyst, then don't do anything else
+ if use build; then
+ cd "${WORKDIR}"
+ epatch "${FILESDIR}/freebsd-sources-6.2-sparc64.patch"
+ return 0
+ fi
+
+ if [[ ${CTARGET} == ${CHOST} ]]; then
+ ln -s "/usr/src/sys-${RV}" "${WORKDIR}/sys"
+ else
+ sed -i -e "s:/usr/include:/usr/${CTARGET}/usr/include:g" \
+ "${S}/libc/"{yp,rpc}"/Makefile.inc"
+ fi
+
+ [[ -n $(install --version 2> /dev/null | grep GNU) ]] && \
+ sed -i -e 's:${INSTALL} -C:${INSTALL}:' "${WORKDIR}/include/Makefile"
+
+ # Let arch-specific includes to be found
+ local machine
+ machine=$(tc-arch-kernel ${CTARGET})
+ ln -s "${WORKDIR}/sys/${machine}/include" "${WORKDIR}/include/machine"
+
+ 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 "-B ${csudir}"
+ append-ldflags "-B ${csudir}"
+ cd "${S}/libc"
+ $(freebsd_get_bmake) ${mymakeopts} || die "make libc failed"
+
+ append-flags "-isystem ${WORKDIR}/lib/msun/${machine/i386/i387}"
+ 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}/sys' -isystem '${WORKDIR}/include'"
+
+ cd "${S}"
+ NOFLAGSTRIP=yes freebsd_src_compile
+ fi
+}
+
+src_install() {
+ cd "${WORKDIR}/include"
+
+ [[ ${CTARGET} == ${CHOST} ]] \
+ && INCLUDEDIR="/usr/include" \
+ || INCLUDEDIR="/usr/${CTARGET}/usr/include"
+
+ einfo "Installing for ${CTARGET} in ${CHOST}.."
+
+ dodir "${INCLUDEDIR}"
+ $(freebsd_get_bmake) installincludes \
+ MACHINE=$(tc-arch-kernel) \
+ DESTDIR="${D}" INCLUDEDIR="${INCLUDEDIR}" || die "Install failed"
+
+ # 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}"
+ mkinstall || die "Install failed"
+ fi
+
+ # Don't install the rest of the configuration files if crosscompiling
+ [[ ${CTARGET} != ${CHOST} ]] && return 0
+
+ # Compatibility symlinks to run FreeBSD 5.x binaries (ABI is mostly
+ # identical, remove when problems will actually happen)
+ dosym /lib/libc.so.6 /usr/lib/libc.so.5
+ dosym /lib/libm.so.4 /usr/lib/libm.so.3
+
+ # 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
+ doins "etc.$(tc-arch-kernel)"/*
+
+ 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
+}
+
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
AUX freebsd-usbin-6.0-fixmakefiles.patch 691 RMD160 247fdda9f51068dece3098d1ef01df0e30da7c65 SHA1 77a29d98fe51c2b848d663a150326baec5e718cc SHA256 d94f8d091ec7eaf75c264ee351b1b6c590297cb99f0c603c5e75672bb6c6c069
MD5 7158b6024cc0e8c5a8237fcc899e6210 files/freebsd-usbin-6.0-fixmakefiles.patch 691
RMD160 247fdda9f51068dece3098d1ef01df0e30da7c65 files/freebsd-usbin-6.0-fixmakefiles.patch 691
MD5 4855fe0bc6e7d9a037631453e024fa20 files/nfs.confd 589
RMD160 6ba14cb8218bf7ea16eb6274885dc92e1a84803c files/nfs.confd 589
SHA256 642ff72e941722b6c235bb4a8c4f8bbb9444866559e65b55032e0206d9a970a5 files/nfs.confd 589
-AUX nfs.initd 5985 RMD160 e42809b0a86e35427b66de4c4bc07d5e95093ff8 SHA1 3c717acab47b7428f12c47cbe572d9576711c2a3 SHA256 aa071504b3669816d0295456301042224cd6cd820ea85167d85a12aab2ffa2d2
-MD5 6974742df7e94e46b96bff63413a8d2f files/nfs.initd 5985
-RMD160 e42809b0a86e35427b66de4c4bc07d5e95093ff8 files/nfs.initd 5985
-SHA256 aa071504b3669816d0295456301042224cd6cd820ea85167d85a12aab2ffa2d2 files/nfs.initd 5985
-AUX nfsmount.initd 1596 RMD160 a54832db1b10f15f8c0b65266deffeef90bc3c52 SHA1 e23b356c798c4a101080718524e505f0f1105da0 SHA256 8b133f58fa1ec085d36871df062b779fdee0f4ee7f8fe2227b5e23b1c15fc7a8
-MD5 dceaac028c9a2318c49b628ddfd0a554 files/nfsmount.initd 1596
-RMD160 a54832db1b10f15f8c0b65266deffeef90bc3c52 files/nfsmount.initd 1596
-SHA256 8b133f58fa1ec085d36871df062b779fdee0f4ee7f8fe2227b5e23b1c15fc7a8 files/nfsmount.initd 1596
+AUX nfs.initd 6037 RMD160 e3cc0632fc4b7501d5d31b4173d7c93e95bf7e79 SHA1 32efac163b088adb225ac82ecf7a06f36c003e7e SHA256 ba24e9a1e08a92b9f0f8056a4569bb506bbf91cda6abdb30725f6a404acd0730
+MD5 cc71d93fee07b29c331f2f3cdd64f6ab files/nfs.initd 6037
+RMD160 e3cc0632fc4b7501d5d31b4173d7c93e95bf7e79 files/nfs.initd 6037
+SHA256 ba24e9a1e08a92b9f0f8056a4569bb506bbf91cda6abdb30725f6a404acd0730 files/nfs.initd 6037
+AUX nfsmount.initd 1596 RMD160 8f47abac7148ad8c35fe314dad6ae2fdffc73cb3 SHA1 5a839e1b4f135619ec1b6c614e9a1cf8d018f0d6 SHA256 0cea497d66d41d093792f8bb2590c45b6b8f965cef9c148b835b362f2a172cbe
+MD5 88d5e0269b1cfad8e10696f3169a434b files/nfsmount.initd 1596
+RMD160 8f47abac7148ad8c35fe314dad6ae2fdffc73cb3 files/nfsmount.initd 1596
+SHA256 0cea497d66d41d093792f8bb2590c45b6b8f965cef9c148b835b362f2a172cbe files/nfsmount.initd 1596
AUX powerd.confd 368 RMD160 4273367b5b1956080d70c300f071ccb7aa614672 SHA1 6cbebc62910ff2d45079f8430d2494ebd7293546 SHA256 989e31b98daacb3d6ecddf8788ee496f3c100d549e7a210e387f03d69c3c8e98
MD5 49d44524fbab807f81ab22b8e439f78c files/powerd.confd 368
RMD160 4273367b5b1956080d70c300f071ccb7aa614672 files/powerd.confd 368
DIST freebsd-sys-6.2.tar.bz2 18344936 RMD160 784230e22ccaf09933ef3f053ff29cc3e579786a SHA1 161b7a4d165665deb1c4434c356b5f610a72a83a SHA256 a754371d88601aaab7152bb3d127bd3777db912e13a26a866e13ba34934c5e5b
DIST freebsd-ubin-6.2.tar.bz2 1772844 RMD160 8101bc3e98fa485e31ecf0d5529136ddeb4be5b9 SHA1 34debd5e3142cbde5e603ce6c89e358d0039e68f SHA256 446c1a8c7031defda8b184ccf4535cacf651928f324db6ce0aaec3b87b04d9ae
DIST freebsd-usbin-6.2.tar.bz2 2695872 RMD160 ea6104fcfbf6c0be511a80d0475e5a8f716292be SHA1 4772ed5fdc591273887fc7a2e97bddf7a1669b5d SHA256 6195301d39e7bc7fa00f6dec71479b1800ea5c3dc9d3ea375dafe4e71e6485f0
+EBUILD freebsd-usbin-6.2-r1.ebuild 5416 RMD160 3c96b4dc4edb2cdc28f6de4747a2e7a024acfb40 SHA1 b1e4dbdf5d33437dcbe3a00aea268abe96093415 SHA256 c5947d4db5c08e190e7c0cbce03bc1dd62fbb9d5e433be30bb3a4c1cdf9ac91f
+MD5 8b94935eeae1be43250b04c818ebdafa freebsd-usbin-6.2-r1.ebuild 5416
+RMD160 3c96b4dc4edb2cdc28f6de4747a2e7a024acfb40 freebsd-usbin-6.2-r1.ebuild 5416
+SHA256 c5947d4db5c08e190e7c0cbce03bc1dd62fbb9d5e433be30bb3a4c1cdf9ac91f freebsd-usbin-6.2-r1.ebuild 5416
EBUILD freebsd-usbin-6.2.ebuild 5411 RMD160 a167afc50ceec708bb170cab3b03eebbce6028b0 SHA1 10db5b7d1f4e72bd9b4cf625807f56eb8cf5a489 SHA256 f4cd4f06ef418ec11348ff71c387c19a5f60bbe27b2543a2bb176ff0c1f5e148
MD5 18b8c4905fc21040a01567c2b24ee04d freebsd-usbin-6.2.ebuild 5411
RMD160 a167afc50ceec708bb170cab3b03eebbce6028b0 freebsd-usbin-6.2.ebuild 5411
SHA256 f4cd4f06ef418ec11348ff71c387c19a5f60bbe27b2543a2bb176ff0c1f5e148 freebsd-usbin-6.2.ebuild 5411
-MISC ChangeLog 14088 RMD160 ea2f96f52f57e4f728283b9d2cf11d270257f5ef SHA1 cd2d2095f255343f045358ae2e7c202273877244 SHA256 d2d5a7d9eeba4ee2874783db9f211e007d1449dcea357d49b993a6787abcd79c
-MD5 d5cc6ec6053ade340aa49c21d409ec3f ChangeLog 14088
-RMD160 ea2f96f52f57e4f728283b9d2cf11d270257f5ef ChangeLog 14088
-SHA256 d2d5a7d9eeba4ee2874783db9f211e007d1449dcea357d49b993a6787abcd79c ChangeLog 14088
+MISC ChangeLog 14292 RMD160 d2522c3a454af76091fd92d767c029a35a69756d SHA1 8c5cb9bd2a751db233c89cbd0efa34bd46ee2f50 SHA256 7ab278123bf3b34d3ff75827097a7136e5625b4b4166951b7715026f8506db5d
+MD5 2e9765124aeb1c4d6ea48a09a7334dae ChangeLog 14292
+RMD160 d2522c3a454af76091fd92d767c029a35a69756d ChangeLog 14292
+SHA256 7ab278123bf3b34d3ff75827097a7136e5625b4b4166951b7715026f8506db5d ChangeLog 14292
MISC metadata.xml 156 RMD160 60b5820a08275f307e5bd936d78f5afd1f141086 SHA1 d9d9d4f2b5afc58339ea3e562fca490156935f1f SHA256 30ab515d6ac492d3d6c36ac3c675511742c2149e56a6b3228c8d22ab8edb3ff7
MD5 2bd48a5ae413433cbb36110b219ce97c metadata.xml 156
RMD160 60b5820a08275f307e5bd936d78f5afd1f141086 metadata.xml 156
MD5 c0f7f64e7397df601f6a8a035c40721e files/digest-freebsd-usbin-6.2 2322
RMD160 2c74c614cc5fe32efc4f1a9c9149a6ec49f58c2f files/digest-freebsd-usbin-6.2 2322
SHA256 75f92c7c16164e2b95abaa8bcf34c259d2b3663bf7dbccf0bc59c64f6032a39e files/digest-freebsd-usbin-6.2 2322
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.2 (GNU/Linux)
-
-iD8DBQFF5pgvGDyatLGpTbYRAjL6AJ98GSD0JBNXa/BjY4qafH8hoTKNrACbBXVa
-wXteDrVS73ljt/ZwRnsF54c=
-=s9EG
------END PGP SIGNATURE-----
+MD5 c0f7f64e7397df601f6a8a035c40721e files/digest-freebsd-usbin-6.2-r1 2322
+RMD160 2c74c614cc5fe32efc4f1a9c9149a6ec49f58c2f files/digest-freebsd-usbin-6.2-r1 2322
+SHA256 75f92c7c16164e2b95abaa8bcf34c259d2b3663bf7dbccf0bc59c64f6032a39e files/digest-freebsd-usbin-6.2-r1 2322