ports/87366: [PATCH] devel/ruby18-freeride: [Fix fetch error]
Alexander Novitsky
alecn2002 at yandex.ru
Thu Oct 13 10:00:30 UTC 2005
>Number: 87366
>Category: ports
>Synopsis: [PATCH] devel/ruby18-freeride: [Fix fetch error]
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Thu Oct 13 10:00:28 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Alexander Novitsky
>Release: FreeBSD 5.4-RELEASE i386
>Organization:
>Environment:
System: FreeBSD server.v42of.icc-vvd.ru 5.4-RELEASE FreeBSD 5.4-RELEASE #1: Fri May 13 16:59:19 MSD 2005
>Description:
Fixed fetch error (see http://people.freebsd.org/~fenner/portsurvey/devel.html#freeride).
Prepared this to be a master port for repocopied devel/freebase
Reworked installation script to accept --prefix option - for port test purposes.
Port maintainer (alecn2002 at yandex.ru) is cc'd.
Generated with FreeBSD Port Tools 0.63
>How-To-Repeat:
>Fix:
--- ruby18-freeride-0.9.4_1.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/devel/freeride/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- Makefile 1 Aug 2005 16:54:45 -0000 1.7
+++ Makefile 13 Oct 2005 09:52:28 -0000
@@ -5,36 +5,46 @@
# $FreeBSD: ports/devel/freeride/Makefile,v 1.7 2005/08/01 16:54:45 lawrance Exp $
#
-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 at 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>
Index: files/install.rb
===================================================================
RCS file: /home/ncvs/ports/devel/freeride/files/install.rb,v
retrieving revision 1.4
diff -u -r1.4 install.rb
--- files/install.rb 1 Aug 2005 16:54:46 -0000 1.4
+++ files/install.rb 13 Oct 2005 09:52:29 -0000
@@ -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 @@
class Array
def contains?
- return false unless defined?( yield )
each { |e| return true if yield( e ) }
return false
end
@@ -40,7 +79,7 @@
class String
attr_accessor :localDir
-
+
def rmLocal
localDir = "/usr/local/" if localDir.nil?
gsub( Regexp.new( "^#{Regexp.escape(localDir)}" ), "" )
@@ -98,7 +137,6 @@
$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 )
--- ruby18-freeride-0.9.4_1.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list