# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit nsplugins flag-o-matic DESCRIPTION="Netscape Plugin Wrapper - Load 32bit plugins on 64bit browser" HOMEPAGE="http://www.gibix.net/projects/nspluginwrapper/" SRC_URI="http://www.gibix.net/projects/nspluginwrapper/files/${P}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="-* ~amd64" IUSE="" RDEPEND=">=x11-libs/gtk+-2 app-emulation/emul-linux-x86-xlibs sys-apps/setarch" DEPEND="${RDEPEND} dev-util/pkgconfig" TARGET_CPU="i386" src_unpack() { unpack ${A} cd "${S}" epatch "${FILESDIR}"/${P}-gentoo.patch } src_compile() { append-flags "-std=c99" ./configure \ --prefix=/usr \ --with-lib=$(get_libdir) \ --with-cc=$(tc-getCC) \ --target-cpu=${TARGET_CPU} || die emake || die mkdir build-${TARGET_CPU}-linux cd build-${TARGET_CPU}-linux linux32 ../configure \ --prefix=/usr \ --with-lib=lib32 \ --with-cc=$(tc-getCC)32 \ --target-cpu=${TARGET_CPU} || die linux32 emake npviewer.bin || die } src_install() { emake DESTDIR="${D}" install || die cd build-${TARGET_CPU}-linux emake DESTDIR="${D}" install.viewer || die cd "${S}" inst_plugin /usr/lib/nspluginwrapper/x86_64/npwrapper.so dosym /usr/lib/nspluginwrapper/x86_64/npconfig /usr/bin/nspluginwrapper dodoc NEWS README TODO } pkg_postinst() { einfo "Auto installing 32bit plugins" nspluginwrapper -v -a -i einfo "Any 32bit plugins you currently have installed have now been" einfo "configured to work in a 64bit browser. Any plugins you install in" einfo "the future will first need to be setup with:" einfo " \"nspluginwrapper -i \"" einfo "before they will function in a 64bit browser" } pkg_prerm() { einfo "Removing wrapper plugins" nspluginwrapper -v -a -r } pkg_postrm() { if [ -x /usr/bin/nspluginwrapper ] ; then einfo "Auto installing 32bit plugins" nspluginwrapper -v -a -i fi }