aboutsummaryrefslogtreecommitdiffstats
path: root/devel/freeride/files
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2004-06-24 16:58:10 +0800
committerpav <pav@FreeBSD.org>2004-06-24 16:58:10 +0800
commit6cf89eaa1e707d8937acaa474edd169ed60d10e2 (patch)
treebe059db067db0dcc2010a96b3fc22e9a6f58f387 /devel/freeride/files
parentb0c50d9106d652f4bf13db25abb7e76ffaea8ed4 (diff)
downloadfreebsd-ports-gnome-6cf89eaa1e707d8937acaa474edd169ed60d10e2.tar.gz
freebsd-ports-gnome-6cf89eaa1e707d8937acaa474edd169ed60d10e2.tar.zst
freebsd-ports-gnome-6cf89eaa1e707d8937acaa474edd169ed60d10e2.zip
Add freeride, The Free Ruby IDE, written in Ruby.
PR: ports/68088 Submitted by: Alexander Novitsky <alecn2002@yandex.ru>
Diffstat (limited to 'devel/freeride/files')
-rw-r--r--devel/freeride/files/freeride1
-rw-r--r--devel/freeride/files/install.rb89
2 files changed, 90 insertions, 0 deletions
diff --git a/devel/freeride/files/freeride b/devel/freeride/files/freeride
new file mode 100644
index 000000000000..44600aade24d
--- /dev/null
+++ b/devel/freeride/files/freeride
@@ -0,0 +1 @@
+/usr/local/bin/ruby /usr/local/lib/ruby/site_ruby/1.8/freeride/freeride.rb %1 %2 %3 %4%5 %6 %7 %8 %9
diff --git a/devel/freeride/files/install.rb b/devel/freeride/files/install.rb
new file mode 100644
index 000000000000..8867c2abd3c5
--- /dev/null
+++ b/devel/freeride/files/install.rb
@@ -0,0 +1,89 @@
+require 'rbconfig'
+require 'find'
+require 'ftools'
+
+Dir.chdir ".." if Dir.pwd =~ /bin.?$/
+
+include Config
+
+FREERIDE = "freeride"
+$srcdir = CONFIG["srcdir"]
+$version = CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
+$libdir = File.join(CONFIG["libdir"], "ruby", $version)
+$archdir = File.join($libdir, CONFIG["arch"])
+$site_libdir = $:.find {|x| x =~ /site_ruby$/}
+if !$site_libdir
+ $site_libdir = File.join($libdir, "site_ruby")
+elsif $site_libdir !~ Regexp.quote($version)
+ $site_libdir = File.join($site_libdir, $version)
+end
+
+$libdir = ["config", "plugins", "redist"]
+$libdir_excl = /i686-mswin32/
+$libdir_subst = [ [/i686-linux/, CONFIG["arch"] ] ]
+
+class File
+ def File.libdirPath( f )
+ ofn = File.join($site_libdir, FREERIDE, f)
+ $libdir_subst.each { |p, s| ofn.gsub!( p, s ) }
+ ofn
+ end
+end
+
+def install_rb(noharm = false, srcdir = nil)
+ libdir = $libdir
+ libdir_excl = $libdir_excl
+ libdir.collect! { |ld|
+ File.join(srcdir, ld)
+ } if srcdir
+ path = ["freeride.rb"]
+ dir = [ "" ]
+ libdir.each { |ld|
+ Find.find(ld) do |f|
+ next unless FileTest.file?(f)
+ next if (f = f[ld.length+1..-1]) == nil
+ next if (/CVS$/ =~ File.dirname(f))
+ next if f =~ libdir_excl
+ path.push File.join( ld, f )
+ dir |= [File.join( ld, File.dirname(f) )]
+ end
+ }
+ for f in dir
+ next if f == "."
+ next if f == "CVS"
+ odn = File.libdirPath( f )
+ if noharm then
+ $stderr << "mkdir #{odn}\n"
+ else
+ File::makedirs( odn )
+ end
+ end
+ for f in path
+ ofn = File.libdirPath( f )
+ if noharm then
+ $stderr << "install #{f} #{ofn}\n"
+ else
+ File::install( f, ofn, 0644, true)
+ end
+ $stderr.flush
+ end
+end
+
+class Array
+ def include_like?( pattern )
+ return include?( pattern ) unless pattern.kind_of?( Regexp )
+ ans = false
+ each { |v|
+ if v.kind_of?( String ) then
+ break if (ans |= (v =~ pattern) )
+ end
+ }
+ ans
+ end
+end
+
+no_harm = (ARGV.include_like?(/\A^-[a-zA-Z0-9]*n/) or ARGV.include?("--no-harm"))
+$stderr << "No-harm install\n" if no_harm
+$stderr.flush
+install_rb( no_harm )
+