Ticket #34275: Portfile

File Portfile, 3.7 KB (added by burdges (Jeff Burdges), 9 years ago)

textproc/pdftk/Portfile

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 114325 2013-12-05 09:20:31Z ryandesign@macports.org $
3
4PortSystem              1.0
5
6name                    pdftk
7version                 1.44
8categories              textproc graphics pdf
9maintainers             ryandesign
10platforms               darwin
11license                 GPL-2+
12homepage                http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/
13master_sites            ${homepage}
14use_zip                 yes
15use_configure           no
16universal_variant       no
17use_parallel_build      no
18
19description \
20    pdftk - PDF Toolkit, for various operations on PDF files
21
22long_description \
23    pdftk is a simple tool for doing everyday things with PDF documents: \
24    Merge PDF Documents \
25    Split PDF Pages into a New Document \
26    Decrypt Input as Necessary (Password Required) \
27    Encrypt Output as Desired \
28    Fill PDF Forms with FDF Data and/or Flatten Forms \
29    Apply a Background Watermark \
30    Report on PDF Metrics such as Metadata, Bookmarks, and Page Labels \
31    Update PDF Metadata \
32    Attach Files to PDF Pages or the PDF Document \
33    Unpack PDF Attachments \
34    Burst a PDF Document into Single Pages \
35    Uncompress and Re-Compress Page Streams \
36    Repair Corrupted PDF (Where Possible)
37
38checksums               sha1    7cb137dcba885caff32ff96b7e11c9dc4ce2cba7 \
39                        rmd160  cacd286759005f002f5a46c0af28d3a1aaad73eb
40
41distname                ${name}-${version}-src
42worksrcdir              ${name}-${version}-dist
43
44depends_lib \
45    port:libiconv
46
47build.dir               ${worksrcpath}/${name}
48
49patchfiles              patch-Makefile.OSX-10.6.diff
50
51post-patch {
52    reinplace "s|@PREFIX@|${prefix}|g" ${build.dir}/Makefile.OSX-10.6
53}
54
55set versuff ""
56
57pre-configure {
58    if {![file exists ${prefix}/bin/gcj${versuff}]} {
59        return -code error "
60
61Cannot build ${name} because ${prefix}/bin/gcj${versuff}
62is missing, possibly because of this gcc bug:
63
64http://trac.macports.org/ticket/13553
65"
66    }
67}
68
69pre-build {
70    build.args-append   VERSUFF=${versuff}
71}
72
73build.args-append       -f Makefile.OSX-10.6
74
75destroot {
76    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
77    xinstall -m 755 -W ${destroot.dir} pdftk ${destroot}${prefix}/bin
78    xinstall -m 644 -W ${worksrcpath} changelog.html changelog.txt pdftk.1.html pdftk.1.txt \
79        ${destroot}${prefix}/share/doc/${name}
80    xinstall -m 644 -W ${worksrcpath} pdftk.1 \
81        ${destroot}${prefix}/share/man/man1
82}
83
84variant gcc42 conflicts gcc45 gcc47 gcc49 description {Build using gcc42} {
85    patchfiles-append   patch-gcj-4.2-and-older.diff
86    configure.compiler  macports-gcc-4.2
87    depends_build-append port:fastjar
88    set versuff         -mp-4.2
89}
90
91variant gcc45 conflicts gcc42 gcc47 gcc49 description {Build using gcc45} {
92    configure.compiler  macports-gcc-4.5
93    set versuff         -mp-4.5
94}
95
96variant gcc47 conflicts gcc42 gcc45 gcc49 description {Build using gcc47} {
97    configure.compiler  macports-gcc-4.7
98    set versuff         -mp-4.7
99}
100
101variant gcc49 conflicts gcc42 gcc45 gcc47 description {Build using gcc49} {
102    configure.compiler  macports-gcc-4.9
103    set versuff         -mp-4.9
104}
105
106if {![variant_isset gcc42] && ![variant_isset gcc45] && ![variant_isset gcc47]} {
107    if {${os.platform} eq "darwin"} {
108        if {${os.major} < 10} {
109            default_variants    +gcc42
110        } elseif {${os.major} < 11} {
111            default_variants    +gcc45
112        } else {
113            default_variants    +gcc47
114        }
115    } else {
116        default_variants    +gcc49
117    }
118}
119
120livecheck.type          regex
121livecheck.regex         ${name}-(\[0-9.\]+)-src${extract.suffix}