--O5XBE6gyVG5Rl6Rj Content-Type: multipart/mixed; boundary="YZ5djTAD1cGYuMQK" Content-Disposition: inline --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Build and install system changes: FHS: - pure-ruby files install separete from ruby extentions(binary). /usr/share/ruby/X.Y for *.rb /usr/lib/ruby/X.Y for *.so - ruby headers install to /usr/include/ruby/X.Y/ Non-FHS: - vendor-specific ruby-modules dirs. It's useful for a distribution. We have three type of ruby-modules: 1. stdlib 2. vendor-specific(a ruby modules prepared for a distribution) 3. user's modules which installed by hand -- Kirill A. Shutemov Belarus, Minsk E-mail: k.shutemov (AT) sam-solutions.net JID: kas (AT) altlinux.org ICQ: 152302675 Be regular and orderly in your life, so that you may be violent and original in your work. -- Flaubert --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ruby-1.9-alt-fhs.patch" Content-Transfer-Encoding: quoted-printable diff -uNr ruby.orig/configure.in ruby/configure.in --- ruby.orig/configure.in 2005-11-17 11:05:54 +0200 +++ ruby/configure.in 2005-11-17 11:06:34 +0200 @@ -72,7 +72,6 @@ program_prefix= fi AC_CANONICAL_TARGET -target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'` dnl checks for fat-binary AC_ARG_ENABLE(fat-binary, @@ -1470,15 +1469,17 @@ RUBY_LIB_PREFIX="/lib/ruby" ;; *) - RUBY_LIB_PREFIX="${prefix}/lib/ruby" + RUBY_LIB_PREFIX="${prefix}/share/ruby" + RUBY_LIB_PREFIX2="${prefix}/lib/ruby" ;; esac RUBY_LIB_PATH="${RUBY_LIB_PREFIX}/${MAJOR}.${MINOR}" +RUBY_LIB_PATH2="${RUBY_LIB_PREFIX2}/${MAJOR}.${MINOR}" AC_ARG_WITH(sitedir, - [ --with-sitedir=DIR site libraries in DIR [PREFIX/lib/ruby/site_ruby]], + [ --with-sitedir=DIR site libraries in DIR [PREFIX/share/ruby/site_ruby]], [sitedir=$withval], - [sitedir='${prefix}/lib/ruby/site_ruby']) + [sitedir="${prefix}/share/ruby/site_ruby"]) SITE_DIR="`eval \"echo ${sitedir}\"`" case "$target_os" in cygwin*|mingw*|*djgpp*|os2-emx*) @@ -1488,14 +1489,34 @@ RUBY_SITE_LIB_PATH="$SITE_DIR";; esac RUBY_SITE_LIB_PATH2="${RUBY_SITE_LIB_PATH}/${MAJOR}.${MINOR}" +RUBY_SITE_LIB_PATH3="`echo ${RUBY_SITE_LIB_PATH2}|sed -e 's@/share/@/lib/@;'`" AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB_PATH}") AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_SITE_LIB_PATH}") AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, "${RUBY_SITE_LIB_PATH2}") +AC_ARG_WITH(vendordir, + [ --with-vendordir=DIR vendor libraries in DIR [PREFIX/share/ruby/vendor_ruby]], + [vendordir=$withval], + [vendordir="${prefix}/share/ruby/vendor_ruby"]) +VENDOR_DIR="`eval \"echo ${vendordir}\"`" +case "$target_os" in + cygwin*|mingw*|*djgpp*|os2_emx*) + RUBY_VENDOR_LIB_PATH="`expr "$VENDOR_DIR" : "$prefix\(/.*\)"`" || + RUBY_VENDOR_LIB_PATH="$VENDOR_DIR";; + *) + RUBY_VENDOR_LIB_PATH="$VENDOR_DIR";; +esac +RUBY_VENDOR_LIB_PATH2="${RUBY_VENDOR_LIB_PATH}/${MAJOR}.${MINOR}" +RUBY_VENDOR_LIB_PATH3="`echo ${RUBY_VENDOR_LIB_PATH2}|sed -e 's@/share/@/lib/@;'`" + +AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, "${RUBY_VENDOR_LIB_PATH}") +AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB2, "${RUBY_VENDOR_LIB_PATH2}") + AC_SUBST(arch)dnl AC_SUBST(sitearch)dnl AC_SUBST(sitedir)dnl +AC_SUBST(vendordir)dnl configure_args=$ac_configure_args AC_SUBST(configure_args)dnl @@ -1519,8 +1540,16 @@ *) sitearch="${arch}" ;; esac -AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${RUBY_LIB_PATH}/${arch}") -AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH2}/${sitearch}") +archdir="${RUBY_LIB_PATH2}/${arch}" +sitearchdir="${RUBY_SITE_LIB_PATH3}/${sitearch}" +vendorarchdir="${RUBY_VENDOR_LIB_PATH3}/${sitearch}" + +AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${archdir}") +AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${sitearchdir}") +AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCHLIB, "${vendorarchdir}") +AC_SUBST(archdir)dnl +AC_SUBST(sitearchdir)dnl +AC_SUBST(vendorarchdir)dnl AC_ARG_WITH(search-path, [ --with-search-path=DIR specify the additional search path], diff -uNr ruby.orig/ext/extmk.rb ruby/ext/extmk.rb --- ruby.orig/ext/extmk.rb 2005-11-17 11:05:54 +0200 +++ ruby/ext/extmk.rb 2005-11-17 11:06:34 +0200 @@ -380,8 +380,26 @@ if $extout Config.expand(extout = "#$extout", Config::CONFIG.merge("topdir"=>$topdir)) if $install - Config.expand(dest = "#{$destdir}#{$rubylibdir}") - FileUtils.cp_r(extout+"/.", dest, :verbose => true, :noop => $dryrun) + + Config.expand(rubylibdest = "#{$destdir}#{$rubylibdir}") + Config.expand(archdest = "#{$destdir}#{$archdir}") + Config.expand(rubyincludedest = "#{$destdir}#{$rubyincludedir}") + + Dir[extout+"/**"].each{|f| + case f + when /^#{extout}\/#{Config::CONFIG['arch']}/ + Dir[f+"/**"].each{|f| + FileUtils.cp_r(f, archdest, :verbose => true, :noop => $dryrun) + } + when /^#{extout}\/include/ + Dir[f+"/**"].each{|f| + FileUtils.cp_r(f, rubyincludedest, :verbose => true, :noop => $dryrun) + } + else + FileUtils.cp_r(f, rubylibdest, :verbose => true, :noop => $dryrun) + end + } + exit end unless $ignore diff -uNr ruby.orig/instruby.rb ruby/instruby.rb --- ruby.orig/instruby.rb 2005-11-17 11:05:54 +0200 +++ ruby/instruby.rb 2005-11-17 11:06:34 +0200 @@ -95,6 +95,7 @@ version = CONFIG["ruby_version"] bindir = with_destdir(CONFIG["bindir"]) libdir = with_destdir(CONFIG["libdir"]) +rubyincludedir = with_destdir(CONFIG["rubyincludedir"]) rubylibdir = with_destdir(CONFIG["rubylibdir"]) archlibdir = with_destdir(CONFIG["archdir"]) sitelibdir = with_destdir(CONFIG["sitelibdir"]) @@ -106,7 +107,7 @@ lib = CONFIG["LIBRUBY"] arc = CONFIG["LIBRUBY_A"] -makedirs [bindir, libdir, rubylibdir, archlibdir, sitelibdir, sitearchlibdir] +makedirs [bindir, libdir, rubyincludedir, rubylibdir, archlibdir, sitelibdir, sitearchlibdir] install?(:bin) do ruby_bin = File.join(bindir, ruby_install_name) @@ -118,8 +119,8 @@ install dll, bindir, :mode => 0755 if enable_shared and dll != lib install lib, libdir, :mode => 0755 unless lib == arc install arc, libdir, :mode => 0644 -install "config.h", archlibdir, :mode => 0644 -install "rbconfig.rb", archlibdir, :mode => 0644 +install "config.h", rubyincludedir, :mode => 0644 +install "rbconfig.rb", rubylibdir, :mode => 0644 if CONFIG["ARCHFILE"] for file in CONFIG["ARCHFILE"].split install file, archlibdir, :mode => 0644 @@ -192,7 +193,7 @@ install?(:bin) do for f in Dir["*.h"] - install f, archlibdir, :mode => 0644 + install f, rubyincludedir, :mode => 0644 end if RUBY_PLATFORM =~ /mswin32|mingw|bccwin32/ diff -uNr ruby.orig/lib/mkmf.rb ruby/lib/mkmf.rb --- ruby.orig/lib/mkmf.rb 2005-11-17 11:05:56 +0200 +++ ruby/lib/mkmf.rb 2005-11-17 11:06:34 +0200 @@ -47,6 +47,7 @@ $libdir = CONFIG["libdir"] $rubylibdir = CONFIG["rubylibdir"] $archdir = CONFIG["archdir"] +$rubyincludedir = CONFIG["rubyincludedir"] $sitedir = CONFIG["sitedir"] $sitelibdir = CONFIG["sitelibdir"] $sitearchdir = CONFIG["sitearchdir"] @@ -74,6 +75,7 @@ [dir_re("sitedir"), "$(RUBYCOMMONDIR)"], [dir_re('rubylibdir'), "$(RUBYLIBDIR)"], [dir_re('archdir'), "$(RUBYARCHDIR)"], + [dir_re('rubyincludedir'), "$(RUBYINCLUDEDIR)"], [dir_re('sitelibdir'), "$(RUBYLIBDIR)"], [dir_re('sitearchdir'), "$(RUBYARCHDIR)"] ] @@ -84,6 +86,7 @@ ['RUBYCOMMONDIR', '$(extout)'], ['RUBYLIBDIR', '$(extout)$(target_prefix)'], ['RUBYARCHDIR', '$(extout)/$(arch)$(target_prefix)'], + ['RUBYINCLUDEDIR', '$(extout)/include'], ['extout', "#$extout"], ['extout_prefix', "#$extout_prefix"], ] @@ -92,12 +95,14 @@ ['RUBYCOMMONDIR', '$(rubylibdir)'], ['RUBYLIBDIR', '$(rubylibdir)$(target_prefix)'], ['RUBYARCHDIR', '$(archdir)$(target_prefix)'], + ['RUBYARCHDIR', '$(rubyincludedir)'], ] else dirs = [ ['RUBYCOMMONDIR', '$(sitedir)$(target_prefix)'], ['RUBYLIBDIR', '$(sitelibdir)$(target_prefix)'], ['RUBYARCHDIR', '$(sitearchdir)$(target_prefix)'], + ['RUBYARCHDIR', '$(rubyincludedir)'], ] end dirs << ['target_prefix', (target_prefix ? "/#{target_prefix}" : "")] @@ -112,8 +117,8 @@ topdir = File.dirname(libdir = File.dirname(__FILE__)) extdir = File.expand_path("ext", topdir) $extmk = File.expand_path($0)[0, extdir.size+1] == extdir+"/" -if not $extmk and File.exist?(Config::CONFIG["archdir"] + "/ruby.h") - $hdrdir = $topdir = Config::CONFIG["archdir"] +if not $extmk and File.exist?(Config::CONFIG["rubyincludedir"] + "/ruby.h") + $hdrdir = $topdir = Config::CONFIG["rubyincludedir"] elsif File.exist?(($top_srcdir ||= topdir) + "/ruby.h") and File.exist?(($topdir ||= Config::CONFIG["topdir"]) + "/config.h") $hdrdir = $top_srcdir @@ -269,7 +274,7 @@ 'LDFLAGS' => "#$LDFLAGS #{ldflags}", 'LIBPATH' => libpathflag(libpath), 'LOCAL_LIBS' => "#$LOCAL_LIBS #$libs", - 'LIBS' => "#$LIBRUBYARG_STATIC #{opt} #$LIBS")) + 'LIBS' => "#$LIBRUBYARG #{opt} #$LIBS")) end def cc_command(opt="") diff -uNr ruby.orig/mkconfig.rb ruby/mkconfig.rb --- ruby.orig/mkconfig.rb 2005-11-17 11:05:58 +0200 +++ ruby/mkconfig.rb 2005-11-17 11:06:34 +0200 @@ -109,10 +109,17 @@ print v_fast, v_others print <<EOS CONFIG["ruby_version"] = "$(MAJOR).$(MINOR)" - CONFIG["rubylibdir"] = "$(libdir)/ruby/$(ruby_version)" - CONFIG["archdir"] = "$(rubylibdir)/$(arch)" + CONFIG["rubylibdir"] = "$(datadir)/ruby/$(ruby_version)" + CONFIG["rubyincludedir"] = "$(includedir)/ruby/$(ruby_version)" + CONFIG["archdir"] = "$(libdir)/ruby/$(ruby_version)/$(arch)" CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)" CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)" + if defined?(VENDOR_SPECIFIC) && VENDOR_SPECIFIC + CONFIG["sitedir"] = "$(vendordir)" + CONFIG["sitelibdir"] = "$(vendordir)/$(ruby_version)" + CONFIG["sitearchdir"] = "$(vendorarchdir)" + end + CONFIG["CFLAGS"] += " -I"+CONFIG["rubyincludedir"] CONFIG["topdir"] = File.dirname(__FILE__) MAKEFILE_CONFIG = {} CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup} diff -uNr ruby.orig/ruby.c ruby/ruby.c --- ruby.orig/ruby.c 2005-11-17 11:05:59 +0200 +++ ruby/ruby.c 2005-11-17 11:06:34 +0200 @@ -312,11 +312,14 @@ #endif ruby_incpush(RUBY_RELATIVE(RUBY_SITE_LIB2)); + ruby_incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB2)); #ifdef RUBY_SITE_THIN_ARCHLIB ruby_incpush(RUBY_RELATIVE(RUBY_SITE_THIN_ARCHLIB)); #endif ruby_incpush(RUBY_RELATIVE(RUBY_SITE_ARCHLIB)); ruby_incpush(RUBY_RELATIVE(RUBY_SITE_LIB)); + ruby_incpush(RUBY_RELATIVE(RUBY_VENDOR_ARCHLIB)); + ruby_incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB)); ruby_incpush(RUBY_RELATIVE(RUBY_LIB)); #ifdef RUBY_THIN_ARCHLIB --- ruby.orig/ext/dl/extconf.rb 2005-11-17 11:05:54 +0200 +++ ruby/ext/dl/extconf.rb 2005-11-17 13:08:31 +0200 @@ -5,7 +5,7 @@ end $INSTALLFILES = [ - ["dl.h", "$(archdir)$(target_prefix)", ""], + ["dl.h", "$(rubyincludedir)", ""], ] $distcleanfiles << "callback.h" --YZ5djTAD1cGYuMQK-- --O5XBE6gyVG5Rl6Rj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFD1MOzbWYnhzC5v6oRAv6pAJ9/n9YwVdqwxyLgQgFwG9JGgjgS6ACfZ72t RHQ7dRL7C4cuVCrPoW0Tv6sÝÂu -----END PGP SIGNATURE----- --O5XBE6gyVG5Rl6Rj--