app-portage/cpuid2cpuflags: Bump to v5
[gentoo.git] / app-portage / cpuid2cpuflags / cpuid2cpuflags-1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 PYTHON_COMPAT=( python{2_7,3_4} pypy )
7
8 inherit python-r1
9
10 MY_PN=cpuinfo2cpuflags
11 MY_P=${MY_PN}-${PV}
12 DESCRIPTION="Script to guess CPU_FLAGS_X86 flags from /proc/cpuinfo"
13 HOMEPAGE="https://github.com/mgorny/cpuid2cpuflags"
14 SRC_URI="https://github.com/mgorny/cpuid2cpuflags/releases/download/v${PV}/${MY_P}.tar.gz"
15
16 LICENSE="BSD-2"
17 SLOT="0"
18 KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
19 IUSE=""
20
21 RDEPEND=${PYTHON_DEPS}
22 REQUIRED_USE=${PYTHON_REQUIRED_USE}
23
24 S=${WORKDIR}/${MY_P}
25
26 src_install() {
27         python_foreach_impl python_newscript "${MY_PN}-x86"{.py,}
28 }
29
30 pkg_postinst() {
31         if has_version 'sys-apps/portage' \
32                 && ! has_version "sys-apps/portage[${PYTHON_USEDEP}]"
33         then
34                 ewarn "Support for matching Python implementations should be enabled"
35                 ewarn "on sys-apps/portage as well. Otherwise, cpuinfo2cpuflags won't"
36                 ewarn "be able to figure out the correct repository location and will"
37                 ewarn "require you to specify it explicitly."
38         fi
39 }