Annotation of /trunk/include/cpan.sminc
Parent Directory | Revision Log
Revision 1981 -
(hide annotations)
(download)
Thu Jun 11 12:29:59 2009 UTC (15 years, 4 months ago) by niro
Original Path: trunk/core/include/cpan.sminc
File size: 1007 byte(s)
Thu Jun 11 12:29:59 2009 UTC (15 years, 4 months ago) by niro
Original Path: trunk/core/include/cpan.sminc
File size: 1007 byte(s)
-die if something goes wrong
1 | niro | 1971 | # $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 | 1974 | 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 | 1971 | |
14 | # some sane defaults | ||
15 | : ${PCATEGORIE="dev-perl"} | ||
16 | # always lower letters | ||
17 | : ${HOMEPAGE="http://search.cpan.org/~${CPAN_AUTHOR_LOWER}/"} | ||
18 | niro | 1974 | : ${SRCFILE="${PNAME}-${PVER}.tar.gz"} |
19 | : ${SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"} | ||
20 | niro | 1971 | |
21 | DEPEND="${DEPEND} | ||
22 | >= dev-lang/perl-5.10" | ||
23 | |||
24 | SRC_URI=( | ||
25 | ${SRC_URI[*]} | ||
26 | http://search.cpan.org/CPAN/authors/id/${CPAN_AUTHOR_UPPER:0:1}/${CPAN_AUTHOR_UPPER:0:2}/${CPAN_AUTHOR_UPPER}/${SRCFILE} | ||
27 | mirror://${PNAME}/${SRCFILE} | ||
28 | ) | ||
29 | |||
30 | cpan_src_prepare() | ||
31 | { | ||
32 | niro | 1981 | perl_src_prepare || die |
33 | niro | 1971 | } |
34 | |||
35 | cpan_src_compile() | ||
36 | { | ||
37 | niro | 1972 | local configure_opts="$@" |
38 | niro | 1981 | perl_src_compile ${configure_opts} || die |
39 | niro | 1971 | } |
40 | |||
41 | niro | 1980 | cpan_src_install() |
42 | niro | 1971 | { |
43 | niro | 1981 | perl_src_install || die |
44 | niro | 1971 | } |
45 | |||
46 | export_inherits cpan src_prepare src_compile src_install |