Magellan Linux

Annotation of /smage/branches/alx07x-unstable/include/cpan.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2792 - (hide annotations) (download)
Mon Aug 29 20:03:18 2011 UTC (12 years, 8 months ago) by niro
Original Path: smage/trunk/include/cpan.sminc
File size: 1048 byte(s)
-merged branch alx-0_6_0 into trunk
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