Ticket #21672: Portfile

File Portfile, 2.5 KB (added by ralf@…, 14 years ago)

Fixed portfile

Line 
1# $Id: Portfile 57864 2009-09-17 19:38:15Z blb@macports.org $
2
3PortSystem          1.0
4PortGroup           ruby 1.0
5set myname          ncurses-ruby
6ruby.setup          ${myname} 1.2.3 fetch
7revision            1
8categories-append   devel
9maintainers         nomaintainer
10description         Ruby access to ncurses functionality
11long_description \
12   ncurses-ruby is an extension module that makes the functions and \
13   constants of the FSF's ncurses library accessible from the ruby \
14   programming language
15
16platforms           darwin
17
18homepage            http://developer.berlios.de/projects/ncurses-ruby
19master_sites        http://download.berlios.de/${myname}/ \
20                    http://download2.berlios.de/${myname}/
21distname            ${myname}-${version}
22use_bzip2           yes
23
24checksums           md5     e00bc593fc0dbc6e311e3b6836bb5801 \
25                    sha1    156e6e663fc3ecae9b48da8e1227427e583c489a \
26                    rmd160  daad8a5044238755c1e79fc2c327e7dfe219733e
27
28depends_lib-append  port:ncurses port:rb-rubygems
29
30patchfiles          patch-extconf.rb
31
32# Do a fake gem-like install by first generating a gem, then install it
33
34# Use gemspec from pkgsrc
35# http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/devel/ruby-ncurses/files/gemspec
36post-extract {
37   copy ${filespath}/${myname}.gemspec ${worksrcpath}
38}
39
40use_configure       no
41
42build {
43   system "cd ${worksrcpath} && ${ruby.gem} build ${myname}.gemspec"
44}
45
46destroot {
47   # This is basically just copied from the ruby portgroup, with a
48   # change to the gem location since we just built it
49   xinstall -d -m 0755 ${destroot}${prefix}/lib/ruby/gems/${ruby.version}
50   system "cd ${worksrcpath} && ${ruby.gem} install --local --force --install-dir ${destroot}${prefix}/lib/ruby/gems/${ruby.version} ${worksrcpath}/ncurses-${version}.gem"
51   set binDir ${destroot}${prefix}/lib/ruby/gems/${ruby.version}/bin
52   if {[file isdirectory $binDir]} {
53      foreach file [readdir $binDir] {
54         file copy [file join $binDir $file] ${destroot}${prefix}/bin
55      }
56   }
57   # symlink to the vendor location so software expecting a non-gem
58   # install can still find it
59   set rubyarch [exec ${prefix}/bin/ruby -rrbconfig -e "puts Config::CONFIG\['sitearch'\]"]
60   file mkdir ${destroot}${ruby.lib}/${rubyarch}
61   set ruby.gemdir ${prefix}/lib/ruby/gems/${ruby.version}/gems
62   ln -s ${ruby.gemdir}/ncurses-${version}/lib/ncurses.rb ${destroot}${ruby.lib}
63   ln -s ${ruby.gemdir}/ncurses-${version}/lib/ncurses_bin.bundle \
64      ${destroot}${ruby.lib}/${rubyarch}
65}
66