Annotation of /trunk/include/cpan.sminc
Parent Directory | Revision Log
Revision 21549 -
(hide annotations)
(download)
Tue Jul 1 08:34:47 2014 UTC (10 years, 4 months ago) by niro
File size: 1389 byte(s)
Tue Jul 1 08:34:47 2014 UTC (10 years, 4 months ago) by niro
File size: 1389 byte(s)
-include UP2DATE URI and updated perl version
1 | niro | 21549 | # $Id$ |
2 | niro | 1971 | # 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 | 21549 | CPAN_AUTHOR_UPPER="${CPAN_AUTHOR^^}" |
12 | CPAN_AUTHOR_LOWER="${CPAN_AUTHOR,,}" | ||
13 | niro | 1971 | |
14 | niro | 7291 | : ${CPAN_MODULE="${PNAME}"} |
15 | |||
16 | niro | 1971 | # some sane defaults |
17 | niro | 9863 | : ${PCAT="dev-perl"} |
18 | niro | 1971 | # always lower letters |
19 | : ${HOMEPAGE="http://search.cpan.org/~${CPAN_AUTHOR_LOWER}/"} | ||
20 | niro | 7291 | : ${SRCFILE="${CPAN_MODULE}-${PVER}.tar.gz"} |
21 | : ${SRCDIR="${BUILDDIR}/${CPAN_MODULE}-${PVER}"} | ||
22 | niro | 1971 | |
23 | DEPEND="${DEPEND} | ||
24 | niro | 21549 | >= dev-lang/perl-5.20" |
25 | niro | 1971 | |
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 | niro | 21549 | UP2DATE="updatecmd_perl ${CPAN_MODULE} gz" |
33 | |||
34 | niro | 1971 | cpan_src_prepare() |
35 | { | ||
36 | niro | 1981 | perl_src_prepare || die |
37 | niro | 1971 | } |
38 | |||
39 | cpan_src_compile() | ||
40 | { | ||
41 | niro | 1972 | local configure_opts="$@" |
42 | niro | 1981 | perl_src_compile ${configure_opts} || die |
43 | niro | 1971 | } |
44 | |||
45 | niro | 11553 | cpan_src_check() |
46 | { | ||
47 | return 0 | ||
48 | } | ||
49 | |||
50 | niro | 11552 | cpan_multilib_src_compile() |
51 | { | ||
52 | local configure_opts="$@" | ||
53 | perl_multilib_src_compile ${configure_opts} || die | ||
54 | } | ||
55 | |||
56 | niro | 1980 | cpan_src_install() |
57 | niro | 1971 | { |
58 | niro | 1981 | perl_src_install || die |
59 | niro | 1971 | } |
60 | |||
61 | niro | 11552 | cpan_multilib_src_install() |
62 | { | ||
63 | perl_multilib_src_install || die | ||
64 | } | ||
65 | |||
66 | niro | 11553 | export_inherits cpan src_prepare src_check |
67 | niro | 11552 | if [[ ${MULTILIB_BUILD} = true ]] |
68 | then | ||
69 | niro | 11553 | export_inherits cpan_multilib src_compile src_install |
70 | niro | 11552 | else |
71 | niro | 11553 | export_inherits cpan src_compile src_install |
72 | niro | 11552 | fi |