Annotation of /smage/branches/alx07x-unstable/include/cpan.sminc
Parent Directory | Revision Log
Revision 5867 -
(hide annotations)
(download)
Fri Oct 17 08:00:14 2014 UTC (9 years, 11 months ago) by niro
Original Path: smage/trunk/include/cpan.sminc
File size: 1565 byte(s)
Fri Oct 17 08:00:14 2014 UTC (9 years, 11 months ago) by niro
Original Path: smage/trunk/include/cpan.sminc
File size: 1565 byte(s)
-sync with upstream
1 | niro | 5710 | # $Id$ |
2 | niro | 1838 | # 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 | 5867 | 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 | 1838 | |
20 | : ${CPAN_MODULE="${PNAME}"} | ||
21 | |||
22 | # some sane defaults | ||
23 | niro | 3582 | : ${PCAT="dev-perl"} |
24 | niro | 1838 | # always lower letters |
25 | : ${HOMEPAGE="http://search.cpan.org/~${CPAN_AUTHOR_LOWER}/"} | ||
26 | : ${SRCFILE="${CPAN_MODULE}-${PVER}.tar.gz"} | ||
27 | : ${SRCDIR="${BUILDDIR}/${CPAN_MODULE}-${PVER}"} | ||
28 | |||
29 | DEPEND="${DEPEND} | ||
30 | niro | 5710 | >= dev-lang/perl-5.20" |
31 | niro | 1838 | |
32 | SRC_URI=( | ||
33 | ${SRC_URI[*]} | ||
34 | http://search.cpan.org/CPAN/authors/id/${CPAN_AUTHOR_UPPER:0:1}/${CPAN_AUTHOR_UPPER:0:2}/${CPAN_AUTHOR_UPPER}/${SRCFILE} | ||
35 | mirror://${PNAME}/${SRCFILE} | ||
36 | ) | ||
37 | |||
38 | niro | 5710 | UP2DATE="updatecmd_perl ${CPAN_MODULE} gz" |
39 | |||
40 | niro | 1838 | cpan_src_prepare() |
41 | { | ||
42 | perl_src_prepare || die | ||
43 | } | ||
44 | |||
45 | cpan_src_compile() | ||
46 | { | ||
47 | local configure_opts="$@" | ||
48 | perl_src_compile ${configure_opts} || die | ||
49 | } | ||
50 | |||
51 | niro | 3582 | cpan_src_check() |
52 | { | ||
53 | return 0 | ||
54 | } | ||
55 | |||
56 | cpan_multilib_src_compile() | ||
57 | { | ||
58 | local configure_opts="$@" | ||
59 | perl_multilib_src_compile ${configure_opts} || die | ||
60 | } | ||
61 | |||
62 | niro | 1838 | cpan_src_install() |
63 | { | ||
64 | perl_src_install || die | ||
65 | } | ||
66 | |||
67 | niro | 3582 | cpan_multilib_src_install() |
68 | { | ||
69 | perl_multilib_src_install || die | ||
70 | } | ||
71 | |||
72 | export_inherits cpan src_prepare src_check | ||
73 | if [[ ${MULTILIB_BUILD} = true ]] | ||
74 | then | ||
75 | export_inherits cpan_multilib src_compile src_install | ||
76 | else | ||
77 | export_inherits cpan src_compile src_install | ||
78 | fi |