Magellan Linux

Annotation of /trunk/include/cpan.sminc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 23248 - (hide annotations) (download)
Wed Nov 5 13:03:05 2014 UTC (9 years, 6 months ago) by niro
File size: 1615 byte(s)
-support variable tarball suffix in up2date via CPAN_TARBALL_SUFFIX
1 niro 21549 # $Id$
2 niro 1971 # 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 22058 if [[ ${BASH_VERSINFO[0]} -le 3 ]]
12     then
13     CPAN_AUTHOR_UPPER=$(echo ${CPAN_AUTHOR} | tr '[a-z]' '[A-Z]')
14     CPAN_AUTHOR_LOWER=$(echo ${CPAN_AUTHOR} | tr '[A-Z]' '[a-z]')
15     else
16     CPAN_AUTHOR_UPPER="${CPAN_AUTHOR^^}"
17     CPAN_AUTHOR_LOWER="${CPAN_AUTHOR,,}"
18     fi
19 niro 1971
20 niro 7291 : ${CPAN_MODULE="${PNAME}"}
21 niro 23248 : ${CPAN_TARBALL_SUFFIX="gz"}
22 niro 7291
23 niro 1971 # some sane defaults
24 niro 9863 : ${PCAT="dev-perl"}
25 niro 1971 # always lower letters
26     : ${HOMEPAGE="http://search.cpan.org/~${CPAN_AUTHOR_LOWER}/"}
27 niro 7291 : ${SRCFILE="${CPAN_MODULE}-${PVER}.tar.gz"}
28     : ${SRCDIR="${BUILDDIR}/${CPAN_MODULE}-${PVER}"}
29 niro 1971
30     DEPEND="${DEPEND}
31 niro 21549 >= dev-lang/perl-5.20"
32 niro 1971
33     SRC_URI=(
34     ${SRC_URI[*]}
35     http://search.cpan.org/CPAN/authors/id/${CPAN_AUTHOR_UPPER:0:1}/${CPAN_AUTHOR_UPPER:0:2}/${CPAN_AUTHOR_UPPER}/${SRCFILE}
36     mirror://${PNAME}/${SRCFILE}
37     )
38    
39 niro 23248 UP2DATE="updatecmd_perl ${CPAN_MODULE} ${CPAN_TARBALL_SUFFIX}"
40 niro 21549
41 niro 1971 cpan_src_prepare()
42     {
43 niro 1981 perl_src_prepare || die
44 niro 1971 }
45    
46     cpan_src_compile()
47     {
48 niro 1972 local configure_opts="$@"
49 niro 1981 perl_src_compile ${configure_opts} || die
50 niro 1971 }
51    
52 niro 11553 cpan_src_check()
53     {
54     return 0
55     }
56    
57 niro 11552 cpan_multilib_src_compile()
58     {
59     local configure_opts="$@"
60     perl_multilib_src_compile ${configure_opts} || die
61     }
62    
63 niro 1980 cpan_src_install()
64 niro 1971 {
65 niro 1981 perl_src_install || die
66 niro 1971 }
67    
68 niro 11552 cpan_multilib_src_install()
69     {
70     perl_multilib_src_install || die
71     }
72    
73 niro 11553 export_inherits cpan src_prepare src_check
74 niro 11552 if [[ ${MULTILIB_BUILD} = true ]]
75     then
76 niro 11553 export_inherits cpan_multilib src_compile src_install
77 niro 11552 else
78 niro 11553 export_inherits cpan src_compile src_install
79 niro 11552 fi