Created
November 30, 2014 17:03
-
-
Save jaypeche/0674a963c83612cf3617 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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="CC-BY-3.0" | |
| SLOT="0" | |
| KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86" | |
| IUSE="-oscam -systemd" | |
| RESTRICT="nomirror" | |
| DEPEND=">=app-arch/unzip-5.52-r2" | |
| RDEPEND="amd64? ( >=sys-devel/gcc-4.6.3[multilib] | |
| >=sys-libs/glibc-2.16[multilib] ) | |
| oscam? ( media-tv/oscam ) | |
| systemd? ( sys-apps/gentoo-systemd-integration | |
| >=sys-apps/systemd-204-r1 )" | |
| 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 mips ; then | |
| einfo "Install mips binary" | |
| dobin CCcam.mipsel || die "dobin failed !" | |
| dosym ${CCCAM_PREFIX}/CCcam.mipsel ${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 file" | |
| 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() { | |
| if [ ! -x "${CCCAM_PREFIX}/${PN}" ] ; then | |
| eerror | |
| eerror "The binary file could not be installed..." | |
| eerror "Your Arch seems not to be supported !" | |
| eerror | |
| else | |
| einfo | |
| einfo "CCcam version ${PV} was successfully installed !" | |
| einfo | |
| fi | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment