Annotation of /smage/trunk/include/cpan.sminc
Parent Directory | Revision Log
Revision 1838 -
(hide annotations)
(download)
Thu Apr 21 10:11:35 2011 UTC (13 years, 5 months ago) by niro
Original Path: smage/branches/alx-0_6_0/include/cpan.sminc
File size: 1048 byte(s)
Thu Apr 21 10:11:35 2011 UTC (13 years, 5 months ago) by niro
Original Path: smage/branches/alx-0_6_0/include/cpan.sminc
File size: 1048 byte(s)
-added cpan module for xml-parser
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 | 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 | : ${CPAN_MODULE="${PNAME}"} | ||
15 | |||
16 | # some sane defaults | ||
17 | : ${PCATEGORIE="dev-perl"} | ||
18 | # 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 | >= dev-lang/perl-5.10" | ||
25 | |||
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 | cpan_src_install() | ||
44 | { | ||
45 | perl_src_install || die | ||
46 | } | ||
47 | |||
48 | export_inherits cpan src_prepare src_compile src_install |