Annotation of /smage/trunk/include/cpan.sminc
Parent Directory | Revision Log
Revision 5114 -
(hide annotations)
(download)
Tue Sep 24 09:03:16 2013 UTC (11 years ago) by niro
File size: 1395 byte(s)
Tue Sep 24 09:03:16 2013 UTC (11 years ago) by niro
File size: 1395 byte(s)
-revert wrong commit
1 | niro | 1838 | # $ID$ |
2 | # CPAN functions | ||
3 | |||
4 | # needs perl | ||
5 | sminclude perl | ||
6 | |||
7 | # needed extra vars: | ||
8 | # ${CPAN_AUTHOR}: needed, author of the CPAN-module | ||
9 | [[ -z ${CPAN_AUTHOR} ]] && die "cpan.sminc: \$CPAN_AUTHOR not given!" | ||
10 | |||
11 | niro | 4520 | CPAN_AUTHOR_UPPER=$(echo ${CPAN_AUTHOR} | tr '[a-z]' '[A-Z]') |
12 | CPAN_AUTHOR_LOWER=$(echo ${CPAN_AUTHOR} | tr '[A-Z]' '[a-z]') | ||
13 | niro | 1838 | |
14 | : ${CPAN_MODULE="${PNAME}"} | ||
15 | |||
16 | # some sane defaults | ||
17 | niro | 3582 | : ${PCAT="dev-perl"} |
18 | niro | 1838 | # always lower letters |
19 | : ${HOMEPAGE="http://search.cpan.org/~${CPAN_AUTHOR_LOWER}/"} | ||
20 | : ${SRCFILE="${CPAN_MODULE}-${PVER}.tar.gz"} | ||
21 | : ${SRCDIR="${BUILDDIR}/${CPAN_MODULE}-${PVER}"} | ||
22 | |||
23 | DEPEND="${DEPEND} | ||
24 | niro | 5114 | >= dev-lang/perl-5.14" |
25 | niro | 1838 | |
26 | SRC_URI=( | ||
27 | ${SRC_URI[*]} | ||
28 | http://search.cpan.org/CPAN/authors/id/${CPAN_AUTHOR_UPPER:0:1}/${CPAN_AUTHOR_UPPER:0:2}/${CPAN_AUTHOR_UPPER}/${SRCFILE} | ||
29 | mirror://${PNAME}/${SRCFILE} | ||
30 | ) | ||
31 | |||
32 | cpan_src_prepare() | ||
33 | { | ||
34 | perl_src_prepare || die | ||
35 | } | ||
36 | |||
37 | cpan_src_compile() | ||
38 | { | ||
39 | local configure_opts="$@" | ||
40 | perl_src_compile ${configure_opts} || die | ||
41 | } | ||
42 | |||
43 | niro | 3582 | cpan_src_check() |
44 | { | ||
45 | return 0 | ||
46 | } | ||
47 | |||
48 | cpan_multilib_src_compile() | ||
49 | { | ||
50 | local configure_opts="$@" | ||
51 | perl_multilib_src_compile ${configure_opts} || die | ||
52 | } | ||
53 | |||
54 | niro | 1838 | cpan_src_install() |
55 | { | ||
56 | perl_src_install || die | ||
57 | } | ||
58 | |||
59 | niro | 3582 | cpan_multilib_src_install() |
60 | { | ||
61 | perl_multilib_src_install || die | ||
62 | } | ||
63 | |||
64 | export_inherits cpan src_prepare src_check | ||
65 | if [[ ${MULTILIB_BUILD} = true ]] | ||
66 | then | ||
67 | export_inherits cpan_multilib src_compile src_install | ||
68 | else | ||
69 | export_inherits cpan src_compile src_install | ||
70 | fi |