# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: # # @ECLASS: mythtv.eclass # @AUTHOR: Doug Goldstein # @MAINTAINER: Doug Goldstein # @BLURB: Downloads the MythTV source packages and any patches from the fixes branch # inherit eutils versionator # MYTHTV_COMMIT is the specific commit found in the repository, defined in each ebuild. # MYTHTV_SCOMMIT is the abbreviated commit useful in unpacking and describing the version. # CORE_PACKAGE is defined because the primary snapshot includes core MythTV and plugins. MYTHTV_COMMIT="${MYTHTV_COMMIT}" MYTHTV_SCOMMIT="$(echo ${MYTHTV_COMMIT} | cut -c1-7)" CORE_PACKAGE="mythtv mythplugins" # Release version MY_PV="${PV%_*}" # what product do we want case "${PN}" in mythtv) MY_PN="mythtv";; mythweb) MY_PN="mythweb";; mythtv-themes) MY_PN="myththemes";; *) MY_PN="mythplugins";; esac # If a commit isn't defined, we can't download or describe the version. if [[ ${MYTHTV_COMMIT} == "" ]] ; then die "Expected MythTV commit not found." fi # _pre is from GIT master while _p and _beta are from GIT ${MY_PV}-fixes # TODO: probably ought to do something smart if the regex doesn't match anything [[ "${PV}" =~ (_alpha|_beta|_pre|_rc|_p)([0-9]+) ]] || { eerror "Invalid version requested (_alpha|_beta|_pre|_rc|_p) only" exit 1 } REV_PREFIX="${BASH_REMATCH[1]}" # _alpha, _beta, _pre, _rc, or _p case $REV_PREFIX in _pre|_alpha) MYTHTV_REPO="master";; _p|_beta|_rc) VER_COMP=( $(get_version_components ${MY_PV}) ) FIXES_VER="${VER_COMP[0]}.${VER_COMP[1]}" MYTHTV_REPO="${FIXES_VER}-fixes";; esac HOMEPAGE="http://www.mythtv.org" LICENSE="GPL-2" if hasq ${MY_PN} ${CORE_PACKAGE}; then # MythTV and plugins are in the same snapshot now. SRC_URI="https://github.com/MythTV/mythtv/tarball/${MYTHTV_COMMIT} -> mythtv-${PV}-${MYTHTV_SCOMMIT}.tar.gz" S="${WORKDIR}/MythTV-mythtv-${MYTHTV_SCOMMIT}/${MY_PN}" else # This should be suitably generic for themes, web and else anything outside of main tree. SRC_URI="https://github.com/MythTV/${MY_PN}/tarball/${MYTHTV_COMMIT} -> ${PN}-${PV}-${MYTHTV_SCOMMIT}.tar.gz" S="${WORKDIR}/MythTV-${MY_PN}-${MYTHTV_SCOMMIT}" fi