Ticket #26320: Portfile.txt

File Portfile.txt, 5.0 KB (added by geychaner@…, 14 years ago)

My best guess as to what the portfile should look like

Line 
1# $Id$
2
3PortSystem 1.0
4PortGroup perl5 1.0
5
6perl5.setup             ikiwiki 3.20100831
7name                    ikiwiki
8revision                1.1
9categories              www perl
10description             A wiki compiler.
11long_description        Ikiwiki is a wiki compiler. It converts wiki pages \
12                        into HTML pages suitable for publishing on a website. \
13                        Ikiwiki stores pages and history in a revision control \
14                        system such as Subversion or Git. There are many other \
15                        features, including support for blogging, as well as a \
16                        large array of plugins.
17homepage                http://ikiwiki.info/
18maintainers             tommyd openmaintainer
19platforms               darwin
20master_sites            http://ftp.debian.org/debian/pool/main/i/ikiwiki/
21distname                ${name}_${version}
22worksrcdir              ${name}
23
24patchfiles              patch-Makefile.PL.diff
25
26checksums               md5     0270ac24e132cf43d96e13e509b1ccdc \
27                        sha1    7aac193e19b572fa8f5395e2cf6fbc8b85d74f39 \
28                        rmd160  958591f586aee203cc122c76b8f746602ae59ae8
29
30depends_build           port:coreutils
31
32if {![variant_isset perl5_10]} {
33    default_variants    +perl5_12
34}
35
36set perl_req ""
37
38variant perl5_10 conflicts perl5_12 description "Require an installed Perl 5.10" {
39    depends_build-append    port:perl5.10
40    set perl_req "5.10"
41}
42
43variant perl5_12 conflicts perl5_10 description "Require an installed Perl 5.12" {
44    depends_build-append    port:perl5.12
45    set perl_req "5.12"
46}
47
48variant mangle_names description {mangle the installed perl names} {
49}
50
51# needed modules (see Bundle/IkiWiki.pm)
52depends_lib-append      port:p5-cgi-formbuilder \
53                        port:p5-cgi-session \
54                        port:p5-data-dumper \
55                        port:p5-html-parser \
56                        port:p5-html-scrubber \
57                        port:p5-html-template \
58                        port:p5-html-tree \
59                        port:p5-mail-sendmail \
60                        port:p5-text-markdown \
61                        port:p5-uri \
62                        port:p5-timedate \
63                        port:p5-xml-simple
64
65# a couple of optional extra modules bundled from MacPorts used by plugins
66# (for a complete list see Bundle/IkiWiki/Extras.pm)
67depends_lib-append      port:p5-crypt-ssleay \
68                        port:p5-digest-sha1 \
69                        port:p5-file-mimeinfo \
70                        port:p5-locale-gettext \
71                        port:p5-rpc-xml \
72                        port:p5-term-readline-gnu \
73                        port:p5-text-csv \
74                        port:p5-text-wikiformat \
75                        port:p5-xml-feed \
76                        port:p5-yaml
77
78destroot.target         CP=gcp install
79configure.args          INSTALLDIRS=vendor PREFIX=${prefix}
80
81post-patch {
82    set perl_binary "${prefix}/bin/perl"
83    if { [file exists ${perl_binary}] } {
84        set perl_inst [join [lrange [split [exec ${perl_binary} -e "printf '%vd\n', $^V"] .] 0 1] .]
85        if { ${perl_inst} == ${perl_req} } {
86            ui_msg "Required Perl version ${perl_req} found at '${perl_binary}')."
87        } else {
88            set perl_binary "${prefix}/bin/perl${perl_req}"
89            if { [file exists ${perl_binary}] } {
90                ui_msg "Required Perl version ${perl_req} found at '${perl_binary}'."
91            } else {
92                # This shouldn't happen, because perl is a prereq for installing.
93                ui_warn "Required Perl version ${perl_req} not found."
94            }
95        }
96    } else {
97        # This shouldn't happen, because perl is a prereq for installing.
98        ui_warn "Required Perl version ${perl_req} not found."
99    }
100    reinplace "s|/usr/bin/perl|${perl_binary}|g" \
101        ${worksrcpath}/ikiwiki.in \
102        ${worksrcpath}/IkiWiki.pm \
103        ${worksrcpath}/Makefile.PL \
104        ${worksrcpath}/ikiwiki-calendar.in \
105        ${worksrcpath}/ikiwiki-makerepo \
106        ${worksrcpath}/ikiwiki-mass-rebuild \
107        ${worksrcpath}/ikiwiki-transition.in \
108        ${worksrcpath}/ikiwiki-update-wikilist \
109        ${worksrcpath}/ikiwiki-w3m.cgi \
110        ${worksrcpath}/ikiwiki.in \
111        ${worksrcpath}/gitremotes \
112        ${worksrcpath}/mdwn2man \
113        ${worksrcpath}/pm_filter \
114        ${worksrcpath}/docwiki.setup \
115        ${worksrcpath}/auto.setup \
116        ${worksrcpath}/auto-blog.setup
117    reinplace "s|/etc/ikiwiki/wikilist|${prefix}/etc/ikiwiki/wikilist|g" \
118        ${worksrcpath}/ikiwiki-update-wikilist \
119        ${worksrcpath}/ikiwiki-mass-rebuild
120}
121
122post-activate {
123    ui_msg "###########################################################"
124    ui_msg "# If you upgrade from version 3.20100403 or earlier, please"
125    ui_msg "# read the upgrade instruction here:                       "
126    ui_msg "# http://ikiwiki.info/news/version_3.20100427/             "
127    ui_msg "###########################################################"
128}