Ticket #24551: Portfile

File Portfile, 3.7 KB (added by ash@…, 14 years ago)

Perl5.12 Portfile

Line 
1# $Id$
2
3PortSystem      1.0
4
5name            perl5.12
6conflicts       perl5.8 perl5.10
7version         5.12.0
8revision        0
9categories      lang
10platforms       darwin freebsd linux
11maintainers     ricci openmaintainer
12description     Perl 5.12.x - Practical Extraction and Report Language
13
14long_description \
15    Perl is a general-purpose programming language originally developed \
16    for text manipulation and now used for a wide range of tasks including \
17    system administration, web development, network programming, GUI \
18    development, and more.
19
20distname        perl-${version}
21use_bzip2       yes
22homepage        http://www.perl.org/
23master_sites    http://www.cpan.org/src/5.0/
24
25checksums           md5     3e15696f4160775a90f6b2fb3ccc98c2 \
26                    sha1    f533687077e2da113b48a6c5e578f4a206fbf173 \
27                    rmd160  10819912e62e14777942c482903f354170e73990
28
29# patchfiles    patch-Configure.diff patch-darwin.sh.diff
30
31#platform darwin {
32#    patchfiles-append   patch-hints_darwin.diff \
33#                                               patch-perl.c.diff
34#}
35
36pre-configure {
37    reinplace "s|/opt/local|${prefix}|g" ${worksrcpath}/Configure
38}
39
40configure.ccache    no
41configure.distcc    no
42configure.env       LC_ALL=C
43configure.cmd       sh Configure
44configure.pre_args
45configure.universal_args-delete --disable-dependency-tracking
46configure.post_args     \
47                                        -des    \
48                                        -Dprefix='${prefix}'    \
49                                        -Dscriptdir='${prefix}/bin' \
50                                        -Dcppflags="\${CPPFLAGS}" \
51                                        -Dccflags="\${CFLAGS}" \
52                                        -Dldflags="\${LDFLAGS}" \
53                                        -Dvendorprefix='${prefix}'      \
54                                        -Dusemultiplicity=y \
55                                        -D cc=\${CC} \
56                                        -D ld=\${CC} \
57                                        -D man1ext='1pm' \
58                                        -D man3ext='3pm' \
59                                        -D man1dir='${prefix}/share/man/man1p' \
60                                        -D man3dir='${prefix}/share/man/man3p' \
61                                        -D siteman1dir='${prefix}/share/man/man1' \
62                                        -D siteman3dir='${prefix}/share/man/man3' \
63                                        -D vendorman1dir='${prefix}/share/man/man1' \
64                                        -D vendorman3dir='${prefix}/share/man/man3'     \
65                                        -D pager="/usr/bin/less -sR"
66
67configure.ccache        no
68
69if {[variant_isset universal]} {
70    post-configure {
71        system "cd ${worksrcpath} && ed - ${worksrcpath}/config.h < ${filespath}/config.h.ed"
72    }
73} elseif {![info exists configure.ld_archflags]} {
74    eval configure.ldflags-append ${configure.cc_archflags}
75}
76
77test.run            yes
78
79variant threads description {Build with thread support} {
80    configure.args-append   -Dusethreads
81}
82
83variant shared description {Build shared perl library} {
84    configure.args-append   -Duseshrplib
85}
86
87variant dtrace description {Build with DTrace probes} {
88    configure.args-append   ‚àíDusedtrace
89}
90
91variant mangle_names description {mangle the installed names by appending -5.12 to avoid conflicting with perl5.8 and perl5.10} {
92    conflicts-delete perl5.8
93    conflicts-delete perl5.10
94    post-destroot {
95        file delete ${destroot}${prefix}/bin/perl
96        set branch [join [lrange [split ${version} .] 0 1] .]
97        foreach bin [glob ${destroot}${prefix}/bin/*] {
98            if {$bin != "${destroot}${prefix}/bin/perl${version}"} {
99                move ${bin} ${bin}-${branch}
100            }
101        }
102   
103        ln -s ${prefix}/bin/perl${version} ${destroot}${prefix}/bin/$name
104   
105        foreach man1File [glob ${destroot}${prefix}/share/man/man1p/*] {
106            regexp (.*)(\.1.*) ${man1File} -> program suffix
107            file rename ${man1File} ${program}-${branch}${suffix}
108        }
109        foreach man3File [glob ${destroot}${prefix}/share/man/man3p/*] {
110            regexp (.*)(\.3.*) ${man3File} -> program suffix
111            file rename ${man3File} ${program}-${branch}${suffix}
112        }
113    }
114}
115
116livecheck.type  regex
117livecheck.url   http://www.cpan.org/src
118livecheck.regex latest_[join [lrange [split ${version} .] 0 1] .]_is_(\\d+(?:\\.\\d+)*)
119
120