| 1 | # Copyright 1999-2006 Gentoo Foundation |
1 | # Copyright 1999-2006 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/mythtv.eclass,v 1.9 2008/02/14 20:37:45 cardoe Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/mythtv.eclass,v 1.10 2008/02/14 22:41:49 cardoe Exp $ |
| 4 | # |
4 | # |
| 5 | # @ECLASS: mythtv.eclass |
5 | # @ECLASS: mythtv.eclass |
| 6 | # @MAINTAINER: Doug Goldstein <cardoe@gentoo.org> |
6 | # @MAINTAINER: Doug Goldstein <cardoe@gentoo.org> |
| 7 | # @BLURB: Downloads the MythTV source packages and any patches from the fixes branch |
7 | # @BLURB: Downloads the MythTV source packages and any patches from the fixes branch |
| 8 | # |
8 | # |
| 9 | |
9 | |
| 10 | inherit eutils versionator |
10 | inherit eutils versionator subversion |
| 11 | |
11 | |
| 12 | # Release version |
12 | # Release version |
| 13 | MY_PV="${PV%_*}" |
13 | MY_PV="${PV%_*}" |
| 14 | |
14 | |
| 15 | # what product do we want |
15 | # what product do we want |
| 16 | if [[ ${PN} = mythtv ]]; then |
16 | case "${PN}" in |
| 17 | MY_PN="mythtv" |
17 | mythtv) MY_PN="mythtv";; |
| 18 | elif [[ ${PN} = mythtv-themes ]]; then |
18 | mythtv-themes) MY_PN="myththemes";; |
| 19 | MY_PN="myththemes" |
19 | *) MY_PN="mythplugins";; |
| 20 | else |
20 | esac |
| 21 | MY_PN="mythplugins" |
|
|
| 22 | fi |
|
|
| 23 | |
21 | |
| 24 | # _pre is from SVN trunk while _p is from SVN ${MY_PV}-fixes |
22 | # _pre is from SVN trunk while _p and _beta are from SVN ${MY_PV}-fixes |
| 25 | if [[ ${MY_PV} != ${PV} ]]; then |
23 | # TODO: probably ought to do something smart if the regex doesn't match anything |
| 26 | if [[ $PV = *_pre* ]]; then |
24 | [[ "${PV}" =~ (_beta|_pre|_p)([0-9]+) ]] || { |
| 27 | SVNREV="${PV##*_pre}" |
25 | eerror "Invalid version requested (_beta|_pre|_p) only" |
| 28 | ESVN_REPO_URI="http://svn.mythtv.org/svn/trunk/${MY_PN}" |
26 | exit 1 |
| 29 | elif [[ $PV = *_p* || $PV = *_beta* ]]; then |
27 | } |
| 30 | PATCHREV="${PV##*_p}" |
|
|
| 31 | # as of 0.20_p13783, we're using svn always |
|
|
| 32 | if [[ $PATCHREV -gt 13783 ]]; then |
|
|
| 33 | SVNREV=$PATCHREV |
|
|
| 34 | unset PATCHREV |
|
|
| 35 | VER_COMP=( $(get_version_components ${MY_PV}) ) |
|
|
| 36 | FIXES_VER="${VER_COMP[0]}-${VER_COMP[1]}" |
|
|
| 37 | ESVN_REPO_URI="http://svn.mythtv.org/svn/branches/release-${FIXES_VER}-fixes/${MY_PN}" |
|
|
| 38 | fi |
|
|
| 39 | fi |
|
|
| 40 | fi |
|
|
| 41 | |
28 | |
|
|
29 | REV_PREFIX="${BASH_REMATCH[1]}" # _beta, _pre, or _p |
|
|
30 | MYTHTV_REV="${BASH_REMATCH[2]}" # revision number |
|
|
31 | |
|
|
32 | case $REV_PREFIX in |
|
|
33 | _pre) MYTHTV_REPO="trunk/${MY_PN}";; |
|
|
34 | _p|_beta) VER_COMP=( $(get_version_components ${MY_PV}) ) |
|
|
35 | FIXES_VER="${VER_COMP[0]}-${VER_COMP[1]}" |
|
|
36 | MYTHTV_REPO="branches/release-${FIXES_VER}-fixes/${MY_PN}";; |
|
|
37 | esac |
|
|
38 | |
|
|
39 | ESVN_REPO_URI="http://svn.mythtv.org/svn/${MYTHTV_REPO}" |
| 42 | ESVN_OPTIONS="-r ${SVNREV}" |
40 | ESVN_OPTIONS="-r ${MYTHTV_REV}" |
| 43 | |
41 | |
| 44 | HOMEPAGE="http://www.mythtv.org" |
42 | HOMEPAGE="http://www.mythtv.org" |
| 45 | LICENSE="GPL-2" |
43 | LICENSE="GPL-2" |
| 46 | SRC_URI="" |
44 | SRC_URI="" |
| 47 | if [[ -z ${SVNREV} ]] ; then |
|
|
| 48 | SRC_URI="${SRC_URI} mirror://gentoo/${MY_PN}-${MY_PV}.tar.bz2" |
|
|
| 49 | fi |
|
|
| 50 | if [[ -n ${PATCHREV} ]] ; then |
|
|
| 51 | SRC_URI="${SRC_URI} |
|
|
| 52 | http://dev.gentoo.org/~cardoe/files/mythtv/${MY_PN}-${MY_PV}_svn${PATCHREV}.patch.bz2" |
|
|
| 53 | fi |
|
|
| 54 | |
|
|
| 55 | mythtv-fixes_patch() { |
|
|
| 56 | if [[ -n ${PATCHREV} ]]; then |
|
|
| 57 | epatch "${WORKDIR}/${MY_PN}-${MY_PV}_svn${PATCHREV}.patch" |
|
|
| 58 | fi |
|
|
| 59 | } |
|
|