aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--devel/freebase/Makefile16
-rw-r--r--devel/freebase/files/patch-freebase_bin_install.rb (renamed from devel/freebase/files/patch-freebase:bin:install.rb)12
-rw-r--r--devel/freeride/Makefile26
-rw-r--r--devel/freeride/files/install.rb52
4 files changed, 78 insertions, 28 deletions
diff --git a/devel/freebase/Makefile b/devel/freebase/Makefile
index 40eac80ab22b..9001260d6949 100644
--- a/devel/freebase/Makefile
+++ b/devel/freebase/Makefile
@@ -6,22 +6,18 @@
#
PORTNAME= freebase
-PORTVERSION= 0.9.4
-CATEGORIES= devel ruby
-MASTER_SITES= http://rubyforge.org/frs/download.php/3931/
-PKGNAMEPREFIX= ${RUBY_PKGNAMEPREFIX}
-DISTNAME= freeride-${PORTVERSION}
-DIST_SUBDIR= ruby
+PORTREVISION= 1
-MAINTAINER= alecn2002@yandex.ru
COMMENT= Plugin subsystem of FreeRIDE
WRKSRC= ${WRKDIR}/${DISTNAME}/${PORTNAME}
-USE_RUBY= yes
-NO_BUILD= yes
+MASTERDIR= ${.CURDIR}/../freeride
+FILESDIR= ${.CURDIR}/files
+PATCHDIR= ${FILESDIR}
+PLIST= ${.CURDIR}/pkg-plist
do-install:
cd ${WRKSRC}; ${RUBY} bin/install.rb --prefix=${PREFIX}
-.include <bsd.port.mk>
+.include "${MASTERDIR}/Makefile"
diff --git a/devel/freebase/files/patch-freebase:bin:install.rb b/devel/freebase/files/patch-freebase_bin_install.rb
index 691d0ad5d772..e2cf68b0eaf0 100644
--- a/devel/freebase/files/patch-freebase:bin:install.rb
+++ b/devel/freebase/files/patch-freebase_bin_install.rb
@@ -1,6 +1,6 @@
--- bin/install.rb.orig Mon Mar 24 07:10:57 2003
-+++ bin/install.rb Mon Feb 21 18:38:00 2005
-@@ -1,21 +1,40 @@
++++ bin/install.rb Thu Oct 13 12:05:17 2005
+@@ -1,21 +1,39 @@
require 'rbconfig'
require 'find'
require 'ftools'
@@ -34,7 +34,6 @@
-$srcdir = CONFIG["srcdir"]
+$prefix = CONFIG["prefix"]
-+$srcdir = prefixize( CONFIG["srcdir"] )
$version = CONFIG["MAJOR"]+"."+CONFIG["MINOR"]
-$libdir = File.join(CONFIG["libdir"], "ruby", $version)
-$archdir = File.join($libdir, CONFIG["arch"])
@@ -50,3 +49,10 @@
def install_rb(srcdir = nil)
libdir = "lib"
+@@ -39,4 +57,4 @@
+ end
+ end
+
+-install_rb
+\ No newline at end of file
++install_rb
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 )