diff options
author | Sergey Matveychuk <sem@FreeBSD.org> | 2005-11-09 10:45:36 +0000 |
---|---|---|
committer | Sergey Matveychuk <sem@FreeBSD.org> | 2005-11-09 10:45:36 +0000 |
commit | 3dac76cf680738231ac5d55b08e3dd770afc1e1e (patch) | |
tree | 17a49318043dd3bc6a22465d9ab16f58d09d7d59 /devel/freeride | |
parent | cdefe0a24d019307fd6bfde5f1ca87d4a5521d4f (diff) |
Notes
Diffstat (limited to 'devel/freeride')
-rw-r--r-- | devel/freeride/Makefile | 26 | ||||
-rw-r--r-- | devel/freeride/files/install.rb | 52 |
2 files changed, 63 insertions, 15 deletions
diff --git a/devel/freeride/Makefile b/devel/freeride/Makefile index 917d76a3d8d2..98b2903f2c19 100644 --- a/devel/freeride/Makefile +++ b/devel/freeride/Makefile @@ -5,36 +5,46 @@ # $FreeBSD$ # -PORTNAME= freeride +PORTNAME?= ${MASTERPORTNAME} PORTVERSION= 0.9.4 +PORTREVISION?= 1 CATEGORIES= devel ruby -MASTER_SITES= http://rubyforge.org/frs/download.php/3931/ +MASTER_SITES= http://rubyforge.planetargon.com/${MASTERPORTNAME}/ PKGNAMEPREFIX= ${RUBY_PKGNAMEPREFIX} DIST_SUBDIR= ruby MAINTAINER= alecn2002@yandex.ru -COMMENT= Ruby Integrated Developement Environment written in Ruby +COMMENT?= Ruby Integrated Developement Environment written in Ruby -RUN_DEPENDS= ${RUBY_SITEARCHLIBDIR}/fox12.so:${PORTSDIR}/x11-toolkits/ruby-fox-devel \ - ${RUBY_SITELIBDIR}/freebase/freebase.rb:${PORTSDIR}/devel/freebase \ - ${RUBY_SITEARCHLIBDIR}/rrb_ripper.so:${PORTSDIR}/devel/ruby-rrb +MASTERPORTNAME= freeride +DISTNAME= ${MASTERPORTNAME}-${PORTVERSION} USE_RUBY= yes NO_BUILD= yes +# IF >>>>>> + +.if ${PORTNAME} == ${MASTERPORTNAME} +RUN_DEPENDS= ${RUBY_SITEARCHLIBDIR}/fox12.so:${PORTSDIR}/x11-toolkits/ruby-fox-devel \ + ${RUBY_SITELIBDIR}/freebase/freebase.rb:${PORTSDIR}/devel/freebase \ + ${RUBY_SITEARCHLIBDIR}/rrb_ripper.so:${PORTSDIR}/devel/ruby-rrb + post-patch: ${CP} ${FILESDIR}/install.rb ${WRKSRC}/ do-install: - cd ${WRKSRC}; ${RUBY} install.rb + cd ${WRKSRC}; ${RUBY} install.rb --prefix=${PREFIX} post-install: ${INSTALL_SCRIPT} ${FILESDIR}/freeride ${PREFIX}/bin - ${CHMOD} a+w ${RUBY_SITELIBDIR}/freeride/config + ${CHMOD} a+w ${RUBY_SITELIBDIR:S|${LOCALBASE}|${PREFIX}|g}/freeride/config # # For testing of installation, no real install # install-noharm: build pre-install cd ${WRKSRC}; ${RUBY} install.rb --no-harm +.endif + +# <<<<<< IF .include <bsd.port.mk> diff --git a/devel/freeride/files/install.rb b/devel/freeride/files/install.rb index cbd7bf840b9a..012999c9f31c 100644 --- a/devel/freeride/files/install.rb +++ b/devel/freeride/files/install.rb @@ -1,17 +1,57 @@ require 'rbconfig' require 'find' require 'ftools' +require 'getoptlong' Dir.chdir ".." if Dir.pwd =~ /bin.?$/ +class Prefixizer + attr_reader :orig_prefix, :my_prefix + + def initialize( orig_prefix = "/usr/local", my_prefix = nil ) + self.orig_prefix = orig_prefix + self.my_prefix = my_prefix + end + + def orig_prefix=( orig_prefix = "/usr/local" ) + @orig_prefix = orig_prefix + end + + def my_prefix=( my_prefix = nil ) + @my_prefix = my_prefix + end + + def prefixize( str ) + my_prefix ? + str.gsub( Regexp::compile( "^#{Regexp::escape(orig_prefix)}" ), my_prefix ) : + str + end +end + include Config +prefixizer = Prefixizer.new( CONFIG["prefix"] ) +no_harm = false + +opts = GetoptLong.new( + [ "--no-harm", "-n", GetoptLong::OPTIONAL_ARGUMENT], + [ "--prefix", "-p", GetoptLong::OPTIONAL_ARGUMENT] +) + +opts.each { |opt, arg| + case opt + when "--no-harm" + no_harm = true + when "--prefix" + prefixizer.my_prefix = arg + end +} + 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 = CONFIG["sitelibdir"] +$libdir = prefixizer.prefixize( CONFIG["rubylibdir"] ) +$archdir = prefixizer.prefixize( CONFIG["archdir"] ) +$site_libdir = prefixizer.prefixize( CONFIG["sitelibdir"] ) $libdir = ["config", "plugins", "redist"] $libdir_excl = [ /CVS[^\/]*$/, /i[36]86-/, /^rrb\//, /\.so\s*$/, /ripper/ ] @@ -19,7 +59,6 @@ $libdir_subst = [ [/i686-linux/, CONFIG["arch"] ] ] class Array def contains? - return false unless defined?( yield ) each { |e| return true if yield( e ) } return false end @@ -40,7 +79,7 @@ end class String attr_accessor :localDir - + def rmLocal localDir = "/usr/local/" if localDir.nil? gsub( Regexp.new( "^#{Regexp.escape(localDir)}" ), "" ) @@ -98,7 +137,6 @@ def install_rb(noharm = false, srcdir = nil) $stdout.flush 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 ) |