# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils qt4 MVER="${PV/_*/}" SVER="${PV/*_/}" MY_P="${PN}-${MVER}-${SVER}" DESCRIPTION="Qt Cryptographic Architecture (QCA)" HOMEPAGE="http://delta.affinix.com/qca/" SRC_URI="http://delta.affinix.com/download/qca/${MVER/\.0/}/${SVER}/${MY_P}.tar.bz2" LICENSE="GPL-2" SLOT="2" KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" IUSE="debug doc" RDEPEND="$(qt4_min_version 4.2.0)" DEPEND="${RDEPEND} doc? ( app-doc/doxygen )" S="${WORKDIR}/${MY_P}" pkg_setup() { if use debug && ! built_with_use qt debug; then einfo einfo "You are trying to compile ${PN} package with active USE=\"debug\"" einfo "while qt4 is build without this particular flag. It will not" einfo "work." einfo einfo "Possible solutions to this problem are:" einfo "a) install package ${PN} without debug USE flag" einfo "b) re-emerge qt4 with debug USE flag" einfo die "can't emerge ${PN} with debug USE flag" fi } src_unpack() { unpack ${A} cd "${S}" sed -i 's#/include/QtCrypto#/include/qca2/QtCrypto#g' crypto.prf.in sed -i "s#/lib#/$(get_libdir)/qca2#g" crypto.prf.in } src_compile() { # check wheter qt was build with debug use flag if use debug; then myconf="${myconf} --debug-and-release" else myconf="${myconf} --release --disable-tests" fi; ./configure \ --qtdir="/usr" \ --prefix="/usr" \ --libdir="/usr/$(get_libdir)/qca2" \ ${myconf} \ || die "configure failed" MAKEOPTS="-j1" emake || die "make failed" use doc && doxygen } src_install() { sed -i 's#$(INSTALL_ROOT)/usr/include/QtCrypto#$(INSTALL_ROOT)/usr/include/qca2/QtCrypto#g' src/Makefile sed -i "s#\${prefix}/lib#\${prefix}/$(get_libdir)/qca2#g" lib/qca.pc sed -i 's#/include/QtCrypto#/include/qca2/QtCrypto#g' lib/qca.pc emake INSTALL_ROOT="${D}" install || die "make install failed" dodoc README TODO cat > "${T}/44qca2" << EOF LDPATH=/usr/$(get_libdir)/qca2 EOF doenvd "${T}/44qca2" if use doc; then insinto "/usr/share/doc/${PF}/doxydoc" doins "${S}/apidocs/html/*" fi; }