# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=4 inherit eutils subversion user DESCRIPTION="OSCam is an Open Source Conditional Access Module software" HOMEPAGE="http://www.streamboard.tv/oscam/wiki" SRC_URI="" ESVN_REPO_URI="http://streamboard.de.vu/svn/oscam/trunk" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="ac csp debug doc dvb gbox ipv6 irdeto lb led lcd log monitor pcsc +reader +ssl usb +www" IUSE_PROTOCOL="camd33 camd35 camd35_tcp newcamd cccam gbox radegast serial constcw pandora ghttp" for share in ${IUSE_PROTOCOL}; do IUSE="${IUSE} protocol_${share}" done IUSE_READER="nagra irdeto conax cryptoworks seca viaccess videoguard dre tongfang bulcrypt griffin" for card in ${IUSE_READER}; do IUSE="${IUSE} reader_${card}" done IUSE_CARD_READERS="phoenix internal sc8in1 mp35 smargo db2com stapi" for card_readers in ${IUSE_CARD_READERS}; do IUSE="${IUSE} cardreader_${card_readers}" done REQUIRED_USE=" protocol_camd35_tcp? ( protocol_camd35 ) reader_irdeto? ( irdeto ) " DEPEND="dev-util/cmake" RDEPEND="${DEPEND} dev-libs/openssl usb? ( dev-libs/libusb ) pcsc? ( sys-apps/pcsc-lite )" OSCAMUSER="oscam" S="${WORKDIR}/${PN}" src_defs() { myconf="" if use ac; then myconf="${myconf} CS_ANTICASC" fi if use lb; then myconf="${myconf} WITH_LB" fi if use monitor; then myconf="${myconf} MODULE_MONITOR" fi if use csp; then myconf="${myconf} CS_CACHEEX" fi if use debug; then myconf="${myconf} WITH_DEBUG" fi if use dvb; then myconf="${myconf} HAVE_DVBAPI" fi if use ipv6; then myconf="${myconf} IPV6SUPPORT" fi if use irdeto; then myconf="${myconf} IRDETO_GUESSING" fi if use lcd; then myconf="${myconf} LCDSUPPORT" fi if use led; then myconf="${myconf} LEDSUPPORT" fi if use ssl; then myconf="${myconf} WITH_SSL" fi if use www; then myconf="${myconf} WEBIF" myconf="${myconf} TOUCH" fi if use protocol_camd33; then myconf="${myconf} MODULE_CAMD33" fi if use protocol_camd35; then myconf="${myconf} MODULE_CAMD35" fi if use protocol_camd35_tcp; then myconf="${myconf} MODULE_CAMD35_TCP" fi if use protocol_newcamd; then myconf="${myconf} MODULE_NEWCAMD" fi if use protocol_cccam; then myconf="${myconf} MODULE_CCCAM" myconf="${myconf} MODULE_CCCSHARE" fi if use protocol_gbox; then myconf="${myconf} MODULE_GBOX" fi if use protocol_radegast; then myconf="${myconf} MODULE_RADEGAST" fi if use protocol_serial; then myconf="${myconf} MODULE_SERIAL" fi if use protocol_constcw; then myconf="${myconf} MODULE_CONSTCW" fi if use protocol_pandora; then myconf="${myconf} MODULE_PANDORA" fi if use protocol_ghttp; then myconf="${myconf} MODULE_GHTTP" fi if use reader_nagra; then myconf="${myconf} READER_NAGRA" fi if use reader_irdeto; then myconf="${myconf} READER_IRDETO" fi if use reader_conax; then myconf="${myconf} READER_CONAX" fi if use reader_cryptoworks; then myconf="${myconf} READER_CRYPTOWORKS" fi if use reader_seca; then myconf="${myconf} READER_SECA" fi if use reader_viaccess; then myconf="${myconf} READER_VIACCESS" fi if use reader_videoguard; then myconf="${myconf} READER_VIDEOGUARD" fi if use reader_dre; then myconf="${myconf} READER_DRE" fi if use reader_tongfang; then myconf="${myconf} READER_TONGFANG" fi if use reader_bulcrypt; then myconf="${myconf} READER_BULCRYPT" fi if use reader_griffin; then myconf="${myconf} READER_GRIFFIN" fi if use cardreader_phoenix; then myconf="${myconf} CARDREADER_PHOENIX" fi if use cardreader_internal; then myconf="${myconf} CARDREADER_INTERNAL" fi if use cardreader_sc8in1; then myconf="${myconf} CARDREADER_SC8IN1" fi if use cardreader_mp35; then myconf="${myconf} CARDREADER_MP35" fi if use cardreader_smargo; then myconf="${myconf} CARDREADER_SMARGO" fi if use cardreader_db2com; then myconf="${myconf} CARDREADER_DB2COM" fi if use cardreader_stapi; then myconf="${myconf} CARDREADER_STAPI" fi export myconf } src_defs_2() { myconf_2="" if use ssl; then myconf="${myconf_2} USE_LIBCRYPTO=1" fi if use usb; then myconf="${myconf_2} USE_LIBUSB=1" fi if use pcsc; then myconf="${myconf_2} USE_PCSC=1" fi export myconf_2 } src_prepare() { if use csp && ! use log; then einfo "Using this patch will eliminate logging of rejects in Cache-EX mode1" epatch "${FILESDIR}"/oscam-8282_csp_logging.patch fi if ! use debug; then epatch "${FILESDIR}"/oscam-7929_no_debug.patch fi } src_configure() { src_defs # Disable everything and enable set options ./config.sh -D all -E ${myconf} } src_compile() { src_defs_2 emake ${myconf_2} || die "emake failed" } src_install() { newbin Distribution/oscam-1.20-unstable_svn0-x86_64-pc-linux-gnu-ssl ${PN} || die "newbin failed" doman Distribution/doc/man/* || die "doman failed" if use doc; then dodoc -r Distribution/doc/txt/* || die "dodoc failed" dodoc -r Distribution/doc/example/* || die "dodoc failed" fi newconfd "${FILESDIR}/oscam.confd" ${PN} fperms 600 /etc/conf.d/${PN} newinitd "${FILESDIR}/oscam.initd" ${PN} } pkg_preinst() { enewuser ${OSCAMUSER} -1 -1 /home/oscam users } pkg_postinst() { einfo "" einfo "Please reffer to the wiki for assistance with the setup " einfo " located at http://streamboard.de.vu/wiki/OSCam/en " einfo "" einfo "Don't forget to add the 'oscam' user to the right groups," einfo " 'usb' for a usb reader or 'tty' for serial reader." }