Skip to content

Instantly share code, notes, and snippets.

@jaypeche
Created November 30, 2014 17:04
Show Gist options
  • Save jaypeche/ac65e4ac29f06419110b to your computer and use it in GitHub Desktop.
Save jaypeche/ac65e4ac29f06419110b to your computer and use it in GitHub Desktop.
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header:
EAPI=4
inherit eutils linux-info multilib systemd
DESCRIPTION="The CCcam emulator for cardsharing"
HOMEPAGE="http://www.cccam.co/"
SRC_URI="http://dvb.oppserver.net/cams/cccam/${P}.zip"
LICENSE=""
SLOT="0"
KEYWORDS="~amd64 ~arm ~ppc ~x86"
IUSE="-oscam -systemd"
RESTRICT="nomirror"
DEPEND="oscam? ( media-tv/oscam )
systemd? ( sys-apps/gentoo-systemd-integration
>=sys-apps/systemd-204-r1 )"
RDEPEND=">=app-arch/unzip-6.0-r3"
CCCAM_CONF="/var/etc"
CCCAM_KEYS="/var/keys"
CCCAM_PREFIX="/usr/bin"
src_unpack() {
unpack ${A}
cd "${S}"
}
pkg_setup() {
if use systemd ; then
if ! linux_config_exists; then
eerror "Kernel configuration file doesn't exist"
elif ! linux_chkconfig_present GENTOO_LINUX_INIT_SYSTEMD; then
eerror "WARNING : GENTOO_LINUX_INIT_SYSTEMD not enabled in kernel"
fi
fi
}
src_install () {
einfo
if use amd64 && has_multilib_profile ; then
einfo "Install x86 binary (On amd64 multilib)"
dobin CCcam.x86 || die "dobin failed !"
dosym ${CCCAM_PREFIX}/CCcam.x86 ${CCCAM_PREFIX}/${PN}
fi
if use arm ; then
einfo "Install arm binary"
dobin CCcam.armeb || die "dobin failed !"
dosym ${CCCAM_PREFIX}/CCcam.armeb ${CCCAM_PREFIX}/${PN}
fi
if use ppc ; then
einfo "Install ppc binary"
dobin CCcam.ppc || die "dobin failed !"
dosym ${CCCAM_PREFIX}/CCcam.ppc ${CCCAM_PREFIX}/${PN}
fi
if use x86 ; then
einfo "Install x86 binary"
dobin CCcam.x86 || die "dobin failed !"
dosym ${CCCAM_PREFIX}/CCcam.x86 ${CCCAM_PREFIX}/${PN}
fi
einfo "Copying configuration files"
insinto ${CCCAM_CONF}
doins CCcam.cfg || die "doins failed !"
einfo "Copying ChangeLog"
dodoc ChangeLog || die "dodoc failed !"
einfo "Creating folder for keys"
dodir ${CCCAM_KEYS} || die "dodir failed !"
if use systemd ; then
einfo "Install systemd unit"
systemd_dounit "${FILESDIR}/${PN}.service" || die "dounit failed !"
else
einfo "Install init runscript"
doinitd "${FILESDIR}/${PN}" || die "doinitd failed !"
fi
einfo
}
pkg_postinst() {
einfo
einfo "CCcam version ${PV} was successfully installed !"
einfo
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment