Magellan Linux

Contents of /branches/R11-stable/include/cpan.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 19317 - (show annotations) (download)
Tue Sep 3 15:56:41 2013 UTC (10 years, 8 months ago) by niro
File size: 1395 byte(s)
-release stable
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 : ${CPAN_MODULE="${PNAME}"}
15
16 # some sane defaults
17 : ${PCAT="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.18"
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_check()
44 {
45 return 0
46 }
47
48 cpan_multilib_src_compile()
49 {
50 local configure_opts="$@"
51 perl_multilib_src_compile ${configure_opts} || die
52 }
53
54 cpan_src_install()
55 {
56 perl_src_install || die
57 }
58
59 cpan_multilib_src_install()
60 {
61 perl_multilib_src_install || die
62 }
63
64 export_inherits cpan src_prepare src_check
65 if [[ ${MULTILIB_BUILD} = true ]]
66 then
67 export_inherits cpan_multilib src_compile src_install
68 else
69 export_inherits cpan src_compile src_install
70 fi