Contents of /branches/R11-unstable/include/pypi.sminc
Parent Directory | Revision Log
Revision 20740 -
(show annotations)
(download)
Tue Feb 4 16:02:29 2014 UTC (10 years, 7 months ago) by niro
Original Path: trunk/include/pypi.sminc
File size: 1211 byte(s)
Tue Feb 4 16:02:29 2014 UTC (10 years, 7 months ago) by niro
Original Path: trunk/include/pypi.sminc
File size: 1211 byte(s)
-honor up2 variables
1 | # $Id$ |
2 | # Pypi functions |
3 | |
4 | # needs python |
5 | sminclude python |
6 | |
7 | : ${PYPI_MODULE="${PNAME}"} |
8 | : ${PYPI_ARCHIVE="gz"} |
9 | |
10 | # some sane defaults |
11 | : ${PCAT="dev-python"} |
12 | # always lower letters |
13 | : ${HOMEPAGE="http://pypi.python.org/pypi/${PYPI_MODULE}"} |
14 | |
15 | case ${PYPI_ARCHIVE} in |
16 | gz|bz2) : ${SRCFILE="${PYPI_MODULE}-${PVER}.tar.${PYPI_ARCHIVE}"} ;; |
17 | *) : ${SRCFILE="${PYPI_MODULE}-${PVER}.${PYPI_ARCHIVE}"} ;; |
18 | esac |
19 | |
20 | : ${SRCDIR="${BUILDDIR}/${PYPI_MODULE}-${PVER}"} |
21 | |
22 | DEPEND="${DEPEND} |
23 | >= dev-lang/python-2.7" |
24 | |
25 | SRC_URI=( |
26 | ${SRC_URI[*]} |
27 | https://pypi.python.org/packages/source/${PYPI_MODULE:0:1}/${PYPI_MODULE}/${SRCFILE} |
28 | mirror://${PNAME}/${SRCFILE} |
29 | ) |
30 | |
31 | # we cannot sort with C=M;O=A |
32 | : ${UP2TARBALL="${PYPI_MODULE}"} |
33 | : ${UP2SEPERATOR="-"} |
34 | UP2DATE="updatecmd -listonly https://pypi.python.org/packages/source/${PYPI_MODULE:0:1}/${PYPI_MODULE}/ | grep ${PYPI_MODULE} | sed 's:.*${UP2TARBALL}${UP2SEPERATOR}\(.*\):\1:' | sort -n | sed 's:^:-:g' | lasttarball ${PYPI_ARCHIVE}" |
35 | |
36 | pypi_src_prepare() |
37 | { |
38 | python_src_prepare || die |
39 | } |
40 | |
41 | pypi_src_compile() |
42 | { |
43 | local configure_opts="$@" |
44 | python_src_compile ${configure_opts} || die |
45 | } |
46 | |
47 | pypi_src_install() |
48 | { |
49 | python_src_install || die |
50 | } |
51 | |
52 | export_inherits pypi src_prepare src_compile src_install |