Use https by default
[gentoo.git] / app-portage / gentoolkit-dev / gentoolkit-dev-9999.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6
7 PYTHON_COMPAT=( python{2_7,3_3,3_4} )
8 PYTHON_REQ_USE="xml"
9
10 inherit python-r1
11
12 if [[ ${PV} == 9999 ]]; then
13         inherit git-r3
14         EGIT_REPO_URI="git://anongit.gentoo.org/proj/gentoolkit.git
15                 http://anongit.gentoo.org/git/proj/gentoolkit.git"
16         EGIT_BRANCH="gentoolkit-dev"
17 else
18         SRC_URI="https://dev.gentoo.org/~floppym/dist/${P}.tar.gz"
19         KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
20 fi
21
22 DESCRIPTION="Collection of developer scripts for Gentoo"
23 HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage-Tools"
24
25 LICENSE="GPL-2"
26 SLOT="0"
27 IUSE="test"
28
29 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
30
31 CDEPEND="
32         sys-apps/portage[${PYTHON_USEDEP}]
33         dev-lang/perl
34         sys-apps/diffutils"
35 DEPEND="${PYTHON_DEPS}
36         test? ( ${CDEPEND} )"
37 RDEPEND="${PYTHON_DEPS}
38         ${CDEPEND}"
39
40 src_prepare() {
41         if [[ -n ${EPREFIX} ]] ; then
42                 # fix shebangs of scripts
43                 local d p
44                 ebegin "Fixing shebangs"
45                 for d in src/* ; do
46                         p=${d#*/}
47                         sed -i \
48                                 -e "1s:\(\(/usr\)\?/bin/\):${EPREFIX}\1:" \
49                                 ${d}/${p}* \
50                                 || die "failed to fix ${d}/${p}"
51                 done
52                 eend $?
53
54                 # fix repo location
55                 sed -i \
56                         -e "s:portage\.db\['/'\]:portage.db['${EPREFIX}/']:g" \
57                         src/ekeyword/ekeyword.py \
58                         || die "failed to set EPREFIX in ekeyword"
59         fi
60 }
61
62 src_test() {
63         # echangelog test is not able to run as root
64         # the EUID check may not work for everybody
65         if [[ ${EUID} -ne 0 ]]; then
66                 python_foreach_impl emake test
67         else
68                 ewarn "test skipped, please re-run as non-root if you wish to test ${PN}"
69         fi
70 }
71
72 src_install() {
73         emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install
74         python_replicate_script "${ED}"/usr/bin/{ekeyword,imlate}
75 }