Ticket #15115: Portfile

File Portfile, 5.6 KB (added by n0ts (Naoya Nakazawa), 17 years ago)
Line 
1# $Id: Portfile 33751 2008-02-04 17:10:22Z nox@macports.org $
2
3PortSystem      1.0
4
5name            zsh-devel
6set my_name     [strsed ${name} {s/-.*//}]
7version         4.3.6
8categories      shells
9platforms       darwin
10maintainers     nox
11description     Zsh is a UNIX command interpreter (shell)
12
13long_description \
14    Zsh is a UNIX command interpreter (shell) which of the standard shells most resembles the Korn shell \
15    (ksh), although it is not completely compatible. It includes enhancements of many types, notably in \
16    the command-line editor, options for customising its behaviour, filename globbing, features to make \
17    C-shell (csh) users feel more at home and extra features drawn from tcsh (another `custom' shell).
18
19homepage        http://www.zsh.org/
20use_bzip2       yes
21dist_subdir     ${my_name}
22distname        ${my_name}-${version}
23master_sites    ${homepage}pub/ \
24                ftp://ftp.zsh.org/${my_name} \
25                ftp://ftp.sterling.com/${my_name}/ \
26                ftp://ftp.rge.com/pub/shells/${my_name}/ \
27                ftp://ftp.fu-berlin.de/pub/unix/shells/${my_name}/ \
28                ftp://ftp.ips.oz.au/pub/packages/${my_name}/ \
29                ftp://ftp.uit.no/pub/unix/shells/${my_name}/ \
30                ftp://ftp.iij.ad.jp/pub/misc/${my_name}/ \
31                ftp://ftp.icm.edu.pl/vol/wojsyl/${my_name}/ \
32                ftp://ftp.sunsite.auc.dk/disk1/${my_name}/ \
33                sourceforge:${my_name} \
34                http://deb.grml.org/pool/main/z/${my_name}-lovers/:love
35
36# Some love for zsh: http://grml.org/zsh/zsh-lovers.html
37set love_distname   zsh-lovers_0.7.0
38set love_distfile   ${love_distname}.tar.gz
39set worklovedir     [strsed [strsed ${love_distname} {s/-[0-9][0-9]*$//}] {g/_/-/}]
40set worklovepath    ${workpath}/${worklovedir}
41
42checksums       [suffix ${distname}] \
43                    md5 16f399af1081ad3c303a794c9c7dc47e \
44                    sha1 7600f56d4304d1b84428b57a9b1d394de185c207 \
45                    rmd160 fedd72f427439e75b8488479a3d20e9d8d5be794 \
46                [suffix ${distname}-doc] \
47                    md5 cab29228a90f58b1431a66ab24a0a0c2 \
48                    sha1 0475edfbbe2d745f3247f3b70a23ed9f169ca7b7 \
49                    rmd160 048e0a30fa860d20020932f5f030edb8661697e1 \
50                ${love_distfile} \
51                    md5 e7a4ecabe514afdf2d1a56d1e925fb86 \
52                    sha1 669fd529080492819c10379ad41b7b5e7a575fd1 \
53                    rmd160 16367651748e7e7102de74b1f70e5d3b59fdd867
54
55depends_lib     port:libiconv \
56                port:ncursesw
57
58# configure.universal_ldflags-append  -isysroot ${sysroot}
59configure.universal_ldflags-append  -isysroot /Developer/SDKs/MacOSX10.4u.sdk
60
61configure.args  --mandir=${prefix}/share/man \
62                --infodir=${prefix}/share/info \
63                --with-curses-terminfo \
64                --enable-multibyte \
65                --enable-etcdir=${prefix}/etc
66
67test.run        yes
68test.target     check
69
70set docdir      ${prefix}/share/doc/${my_name}-${version}
71
72post-destroot {
73    # This manpage only includes every zsh manpage; as manpages are gzipped in MacPorts,
74    # .so groff directives will fail.
75    system "cd ${destroot}${prefix}/share/man/man1 && \
76        soelim -I.. zshall.1 > zshall.1.soelim"
77    move -force \
78        ${destroot}${prefix}/share/man/man1/zshall.1.soelim \
79        ${destroot}${prefix}/share/man/man1/zshall.1
80
81    xinstall -d ${destroot}${docdir}
82    xinstall -m 0644 -W ${worksrcpath} ChangeLog FEATURES LICENCE NEWS README ${destroot}${docdir}
83
84    if {[variant_isset doc] || [variant_isset examples]} {
85        xinstall -d ${destroot}${docdir}/pdf
86    }
87}
88
89post-install {
90    ui_info "If you want MacPorts' ${my_name} as login shell, you should run:"
91    ui_info "% sudo sh -c \"echo '${prefix}/bin/${my_name}' >> /etc/shells\""
92    ui_info "% chsh -s ${prefix}/bin/${my_name}"
93}
94
95platform darwin {
96    # Dynamic loadable libraries' extension is `bundle` on Darwin
97    configure.env-append    DL_EXT=bundle
98}
99
100platform darwin 8 {
101    post-configure {
102        # poll(2) is broken on Darwin 8.
103        reinplace "s|#define HAVE_POLL 1|#undef HAVE_POLL|" \
104          ${worksrcpath}/config.h
105    }
106}
107
108variant mp_completion description {Install port(1) completion file} {
109    post-destroot {
110        set sitedir ${prefix}/share/${my_name}/site-functions
111        xinstall -m 0644 ${filespath}/_port \
112            ${destroot}${sitedir}
113    }
114}
115
116variant pcre description {Add regular expressions support in builtin functions through PCRE} {
117    configure.args-append   --enable-pcre
118    depends_lib-append      port:pcre
119}
120
121variant doc description {Install extra documentation} {
122    distfiles-append        [suffix ${distname}-doc]
123
124    post-build {
125        system "make -C ${worksrcpath}/Doc html info"
126    }
127
128    destroot.target-append  install.html \
129                            install.info
130}
131
132variant examples description {Install configuration examples} {
133    distfiles-append    ${love_distfile}:love
134    extract.only-delete ${love_distfile}
135
136    post-extract {
137        system "tar xzf ${distpath}/${love_distfile} -C ${workpath}"
138    }
139
140    post-destroot {
141        proc xinstall_dir {dir destdir} {
142            xinstall -d ${destdir}
143
144            foreach {file} [glob ${dir}/*] {
145                if {[file isdirectory ${file}]} {
146                    xinstall_dir ${file} [file join ${destdir} [file tail ${file}]]
147                } else {
148                    xinstall -m 0644 ${file} ${destdir}
149                }
150            }
151        }
152
153        xinstall -m 0644 ${worklovepath}/refcard.pdf ${destroot}${docdir}/pdf
154        xinstall_dir ${worklovepath}/zsh_people ${destroot}${docdir}/examples
155    }
156}
157
158livecheck.distname  ${my_name}-dev