Ticket #9994: Portfile

File Portfile, 2.6 KB (added by rsky0711@…, 18 years ago)

New Portfile of ruby/rb-hyperestraier

Line 
1# $Id: $
2
3PortSystem      1.0
4PortGroup       ruby 1.0
5name            rb-hyperestraier
6version         1.3.3
7maintainers     rsky0711@gmail.com
8platforms       darwin
9description     Ruby binding of Hyper Estraier
10long_description ${description}
11
12homepage        http://hyperestraier.sourceforge.net/
13master_sites    http://hyperestraier.sourceforge.net/
14dist_subdir     hyperestraier
15distname        hyperestraier-${version}
16worksrcdir      hyperestraier-${version}/rubynative
17checksums       md5    d2c544f48b8b92a62d7028c68736ce40 \
18                sha1   857dba712fd30be7e8d0fbec5ea0a150664522e6 \
19                rmd160 834f401f02231a5f48c7b8354d8ab8599d82155b
20
21categories      ruby textproc
22depends_lib     port:ruby port:hyperestraier
23
24post-extract {
25    # configure
26    reinplace "s|\$HOME|${prefix}|g" \
27        ${worksrcpath}/configure
28    reinplace "s|\"sitelibdir\"|\"sitearchdir\"|g" \
29        ${worksrcpath}/configure
30    # Makefile.in
31    reinplace "s|\$(HOME)|${prefix}|g" \
32        ${worksrcpath}/Makefile.in
33    reinplace "s|MYRBLIBS = estraier\.so|MYRBLIBS = estraier.bundle|g" \
34        ${worksrcpath}/Makefile.in
35    # estcmd.rb
36    reinplace "s|/usr/bin/ruby|${ruby.bin}|g" \
37        ${worksrcpath}/estcmd.rb
38
39    if { [variant_isset p2p] } {
40        # configure
41        reinplace "s|\$HOME|${prefix}|g" \
42            ${workpath}/${distname}/rubypure/configure
43        # Makefile.in
44        reinplace "s|@RUBY@|${ruby.bin}|g" \
45            ${workpath}/${distname}/rubypure/Makefile.in
46        # estcall.rb
47        reinplace "s|/usr/bin/ruby|${ruby.bin}|g" \
48            ${workpath}/${distname}/rubypure/estcall.rb
49    }
50}
51
52post-destroot {
53    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/examples
54    xinstall -m 644 ${worksrcpath}/overview \
55        ${destroot}${prefix}/share/doc/${name}
56    xinstall -m 644 -W ${worksrcpath}/example \
57        example001.rb example002.rb \
58        ${destroot}${prefix}/share/doc/${name}/examples
59
60    if { [variant_isset p2p] } {
61        system "cd ${workpath}/${distname}/rubypure; \
62            ./configure --prefix=${prefix} && \
63            ${build.cmd} && \
64            ${destroot.cmd} install ${destroot.destdir}"
65
66        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/p2p/examples
67        xinstall -m 644 ${workpath}/${distname}/rubypure/overview \
68            ${destroot}${prefix}/share/doc/${name}/p2p
69        xinstall -m 644 -W ${workpath}/${distname}/rubypure/example \
70            example001.rb example002.rb \
71            ${destroot}${prefix}/share/doc/${name}/p2p/examples
72    }
73}
74
75variant p2p {
76    categories-append   net
77}