# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-lang/ccc/ccc-6.5.9.001.ebuild,v 1.7 2007/07/02 14:39:33 peper Exp $ inherit eutils rpm IUSE="doc" DESCRIPTION="Compaq's C compiler for the Alpha platform" HOMEPAGE="ftp://ftp.compaq.com/pub/products/C-Cxx/linux/" SRC_URI="ccc-6.5.9.001-6.alpha.rpm" S=${WORKDIR} LICENSE="PLDSPv2" SLOT="0" KEYWORDS="-* ~alpha" RESTRICT="fetch strip mirror" DEPEND="sys-devel/gcc-config app-arch/rpm2targz >=sys-apps/sed-4 >=app-shells/bash-2.05b" RDEPEND="dev-libs/libots >=dev-libs/libcpml-5.2.01" ccc_release="${PV}-6" src_unpack() { # convert rpm into tar archive local ccc_rpm="ccc-${ccc_release}.alpha.rpm" rpm_src_unpack ${ccc_rpm} find "${S}"/usr -type d -exec chmod a+rx {} \; # patch up config script to sort gcc-lib paths last. Thanks to # Marc Giger for sorting this out epatch ${FILESDIR}/create-comp-config.patch epatch ${FILESDIR}/probe_linux.patch # remove unwanted documentation if ! use doc > /dev/null; then einfo "Removing unwanted documentation (USE=\"-doc\")..." rm -rf usr/doc fi # Patch create-comp-config.sh to work with gcc-3.x # (06 Feb 2004 agriffis) sed -i -e 's/gcc -v -V \$GCC_VER/gcc -V $GCC_VER -v/' \ usr/lib/compaq/ccc-${ccc_release}/alpha-linux/bin/create-comp-config.sh # man pages are in the wrong place einfo "Reorganising man structure..." rm -rf usr/man mkdir usr/share mv usr/lib/compaq/ccc-${ccc_release}/alpha-linux/man usr/share if use doc > /dev/null; then einfo "Reorganising documentation..." mv usr/doc usr/share fi } src_install() { # move files over mv usr "${D}" || die "ccc installation failed" # prep docs prepalldocs } pkg_config () { einfo "Attempting configuration of ccc" # NOTE: _must_ hide distcc, ccache, etc during this step PATH=/bin:/usr/bin:/sbin:/usr/sbin \ /usr/lib/compaq/ccc-${ccc_release}/alpha-linux/bin/create-comp-config.sh \ ccc-${ccc_release} ${gcc_libs_path} echo # fix up lib paths - bug #15719, comment 6 einfo "Copying crtbegin/crtend from gcc" local gcc_libs_path="`gcc-config --get-lib-path`" if [[ $? != 0 || ! -d "${gcc_libs_path}" ]]; then die "gcc-config returned an invalid library path (${gcc_libs_path})" else rm -f /usr/lib/compaq/ccc-${ccc_release}/alpha-linux/bin/crt{begin,end}.o cp ${gcc_libs_path}/crt{begin,end}.o \ /usr/lib/compaq/ccc-${ccc_release}/alpha-linux/bin assert "Failed to copy crtbegin/crtend.o from ${gcc_libs_path}" fi # add gcc-lib path to ccc's search path # check man ccc for file format info. # einfo "Configuring ccc to observe gcc library path and include paths" # printf '%s %s %s\n' \ # "-L${gcc_libs_path}" \ # " -SysIncDir /usr/lib/compaq/ccc-${ccc_releasei%*-1}/alpha-linux/include" \ # " -SysIncDir /usr/include/linux" \ # > /usr/lib/compaq/ccc-${ccc_release%*-1}/alpha-linux/bin/comp.config # einfo "Additional paths can be set by users using \$DEC_CCC variable." einfo "ccc has been configured, you can now use it as usual." } pkg_postinst () { elog "ccc has been merged successfully, the EULA" elog "is available in" elog elog "/usr/lib/compaq/ccc-${ccc_release}/alpha-linux/bin/LICENSE.txt" elog if use doc >/dev/null; then elog "You can also view the compiler documentation" elog "in /usr/share/doc/ccc-${PV}" fi ewarn ewarn "You _MUST_ now run:" ewarn "emerge --config =${CATEGORY}/${PF}" ewarn "to complete the installation" ewarn }