Contents of /trunk/include/cpan.sminc
Parent Directory
|
Revision Log
Revision 1981 -
(show annotations)
(download)
Thu Jun 11 12:29:59 2009 UTC (14 years, 11 months ago) by niro
Original Path: trunk/core/include/cpan.sminc
File size: 1007 byte(s)
Thu Jun 11 12:29:59 2009 UTC (14 years, 11 months ago) by niro
Original Path: trunk/core/include/cpan.sminc
File size: 1007 byte(s)
-die if something goes wrong
1 | # $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 | CPAN_AUTHOR_UPPER=$(echo ${CPAN_AUTHOR} | tr [a-z] [A-Z]) |
12 | CPAN_AUTHOR_LOWER=$(echo ${CPAN_AUTHOR} | tr [A-Z] [a-z]) |
13 | |
14 | # some sane defaults |
15 | : ${PCATEGORIE="dev-perl"} |
16 | # always lower letters |
17 | : ${HOMEPAGE="http://search.cpan.org/~${CPAN_AUTHOR_LOWER}/"} |
18 | : ${SRCFILE="${PNAME}-${PVER}.tar.gz"} |
19 | : ${SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"} |
20 | |
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 | perl_src_prepare || die |
33 | } |
34 | |
35 | cpan_src_compile() |
36 | { |
37 | local configure_opts="$@" |
38 | perl_src_compile ${configure_opts} || die |
39 | } |
40 | |
41 | cpan_src_install() |
42 | { |
43 | perl_src_install || die |
44 | } |
45 | |
46 | export_inherits cpan src_prepare src_compile src_install |