Re: Whither site_ruby?

Dan Cross <[email protected]> Tue, 18 Jan 2005 22:19:31 -0500
Newsgroups gmane.comp.apache.mod-ruby
Message-ID <[email protected]>
Shugo Maeda <[email protected]> writes:
> Dan Cross wrote:
> > This works reasonably well, and when I built Ruby, I configured it with
> > the ``--with-sitedir=/sw/lib/ruby/1.8'' option, so the Ruby interpreter
> > itself will look for modules in the right place, despite being
> > installed elsewhere.
> 
> If you specify `--with-sitedir=/sw/lib/ruby/1.8', ruby will
> search libraries in /sw/lib/ruby/1.8/1.8,
> /sw/lib/ruby/1.8/1.8/i686-linux, and /sw/lib/ruby/1.8.
> ``--with-sitedir=/sw/lib/ruby'' is what you want, isn't it?

Yes!  Sorry, that's another typo.  Reviewing the notes I took, I
built Ruby with --with-sitedir=/sw/lib/ruby, excluding the version.

> > However, when I run ``make site-install'' for mod_ruby, it installs it
> > directly into /sw/lib/ruby/site_ruby/1.8, which isn't where I want it.
> > Using either `make install' or `make site-install', mod_ruby.so is
> > installed directly into the Apache libexec directory, though I can work
> > around that with a make variable specified on the command line.
> 
> ``make site-install'' installs libraries into /sw/lib/ruby/1.8/1.8 on my
> machine.

Even the corrected path, /sw/lib/ruby/1.8, is not where I want them to
go.  I want them to go into ${prefix}/lib/ruby/site_ruby/1.8, which I
then merge into /sw/lib/ruby/site_ruby/1.8 with stow (or epkg, or a similar
tool).  In this case, ${prefix} is not ``/sw'', but something like
``/contrib/packages/mod_ruby/1.2.4.''

> Did you run configure.rb with the right Ruby interpreter?

Yes; I only have one Ruby interpreter on this machine.

> Please check $sitelibdir by the Ruby interpreter which ran configure.rb

But I don't want it to look at $sitelibdir, I want it to install into
the site_ruby directory under my $prefix by default.  Perhaps my weird
requirements are too weird.

> $ ruby -r mkmf -e 'p $sitelibdir'
> "$(sitedir)/$(ruby_version)"
> $ ruby -r mkmf -e 'p $sitedir'
> "$(DESTDIR)/tmp/ruby/1.8"
> 
> Then, where do you want to install mod_ruby.so?

Well, that's a separate can of worms since mod_ruby.so is installed
into wherever Apache tells it to go, but that's easy to fix with a
variable specified to make at install time.  Currently, here's how
I'm building and installing mod_ruby:

	P=/contrib/packages/mod_ruby/1.2.4
	./configure.rb --prefix=$P --with-apxs=...
	make XLDFLAGS=-L/contrib/lib
	make site-install APACHE_LIBEXECDIR=$P/libexec sitelibdir=$P/lib/ruby/site_ruby/1.8

This seems less than optimal.  If mod_ruby were to install itself into
site_ruby by default, it'd be a bit more trivial; I'd only have to
worry about telling it where to put mod_ruby.so.  I understand,
however, that not everyone necessarily shares in my views on how to
manage installed software.  But I am curious why Ruby doesn't install
into site_ruby by default; is there something important I'm missing
there?  Should I be looking to revise my strategy for managing software
installation as a result?

	- Dan C.