Contents of /trunk/include/cpan.sminc
Parent Directory | Revision Log
Revision 29369 -
(show annotations)
(download)
Thu Jun 1 13:57:57 2017 UTC (7 years, 3 months ago) by niro
File size: 1678 byte(s)
Thu Jun 1 13:57:57 2017 UTC (7 years, 3 months ago) by niro
File size: 1678 byte(s)
-use CPAN_MODULE home as homepage, not the author and updated perl version
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 | 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 | |
20 | : ${CPAN_MODULE="${PNAME}"} |
21 | : ${CPAN_TARBALL_SUFFIX="gz"} |
22 | |
23 | # some sane defaults |
24 | : ${PCAT="dev-perl"} |
25 | # always lower letters |
26 | #: ${HOMEPAGE="http://search.cpan.org/~${CPAN_AUTHOR_LOWER}/"} |
27 | : ${HOMEPAGE="http://search.cpan.org/dist/${CPAN_MODULE}/"} |
28 | : ${SRCFILE="${CPAN_MODULE}-${PVER}.tar.gz"} |
29 | : ${SRCDIR="${BUILDDIR}/${CPAN_MODULE}-${PVER}"} |
30 | |
31 | DEPEND="${DEPEND} |
32 | >= dev-lang/perl-5.24.1" |
33 | |
34 | SRC_URI=( |
35 | ${SRC_URI[*]} |
36 | http://search.cpan.org/CPAN/authors/id/${CPAN_AUTHOR_UPPER:0:1}/${CPAN_AUTHOR_UPPER:0:2}/${CPAN_AUTHOR_UPPER}/${SRCFILE} |
37 | mirror://${PNAME}/${SRCFILE} |
38 | ) |
39 | |
40 | UP2DATE="updatecmd_perl ${CPAN_MODULE} ${CPAN_TARBALL_SUFFIX}" |
41 | |
42 | cpan_src_prepare() |
43 | { |
44 | perl_src_prepare || die |
45 | } |
46 | |
47 | cpan_src_compile() |
48 | { |
49 | local configure_opts="$@" |
50 | perl_src_compile ${configure_opts} || die |
51 | } |
52 | |
53 | cpan_src_check() |
54 | { |
55 | return 0 |
56 | } |
57 | |
58 | cpan_multilib_src_compile() |
59 | { |
60 | local configure_opts="$@" |
61 | perl_multilib_src_compile ${configure_opts} || die |
62 | } |
63 | |
64 | cpan_src_install() |
65 | { |
66 | perl_src_install || die |
67 | } |
68 | |
69 | cpan_multilib_src_install() |
70 | { |
71 | perl_multilib_src_install || die |
72 | } |
73 | |
74 | export_inherits cpan src_prepare src_check |
75 | if [[ ${MULTILIB_BUILD} = true ]] |
76 | then |
77 | export_inherits cpan_multilib src_compile src_install |
78 | else |
79 | export_inherits cpan src_compile src_install |
80 | fi |