Bug 64830 - Ruby RPM defines 'sitedir' under /usr/local
Summary: Ruby RPM defines 'sitedir' under /usr/local
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: ruby
Version: 7.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Akira TAGOH
QA Contact: David Lawrence
URL:
Whiteboard:
: 72021 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-05-13 09:28 UTC by Ian Macdonald
Modified: 2007-04-18 16:42 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-08-27 14:20:36 UTC
Embargoed:


Attachments (Terms of Use)
Amended .spec file for Ruby (18.52 KB, text/plain)
2002-05-13 09:30 UTC, Ian Macdonald
no flags Details
patch from ruby-talk #38613 (4.66 KB, patch)
2002-05-13 09:33 UTC, Ian Macdonald
no flags Details | Diff
patch from ruby-talk #38620 (3.22 KB, patch)
2002-05-13 09:34 UTC, Ian Macdonald
no flags Details | Diff

Description Ian Macdonald 2002-05-13 09:28:10 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc2) Gecko/20020510

Description of problem:
Ruby RPM defines 'sitedir' to be under /usr/local, which is just plain wrong on
a package-managed system. RPMs of modules compiled against this version will
also installed into /usr/local, rather than into /usr. This is undesirable.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. install Ruby RPM
2. Run: ruby -e 'puts $:'
3.
	

Actual Results:  Library include path was shown to expect /usr/local, which
should not be touched by RPM based systems.

Expected Results:  sitedir should not be defined to be in /usr/local. It should
be left as the default at compile time, i.e. --with-sitedir= should not be
passed to ./configure.

Additional info:

--- ruby.spec   Tue Mar 19 09:00:19 2002
+++ ruby.spec~  Mon May 13 02:12:33 2002
@@ -1,10 +1,10 @@
 %define manver         1.4.6
 %define        rubyxver        1.6
-%define        sitedir         %{_prefix}/local/lib/site_ruby/%{rubyxver}
+%define        sitedir         %{_prefix}/lib/site_ruby/%{rubyxver}
 
 Name:          ruby
 Version:       1.6.7
-Release:       2
+Release:       6
 License:       Distributable
 URL:           http://www.ruby-lang.org/
 BuildRoot:     %{_tmppath}/%{name}-%{version}-root
@@ -130,16 +136,14 @@
 rb_cv_func_strtod=no ./configure \
 %endif
   --prefix=%{_prefix} \
-  --mandir='${prefix}/share/man' \
+  --mandir=%{_mandir} \
   --sysconfdir=%{_sysconfdir} \
   --localstatedir=%{_localstatedir} \
-  --with-sitedir='${prefix}/local/lib/site_ruby/%{rubyxver}' \
   --with-default-kcode=none \
   --with-dbm-include=/usr/include/db1 \
   --enable-shared \
   --enable-ipv6 \
-  --with-lookup-order-hack=INET \
-  %{_target_cpu}-%{_target_os}
+  --with-lookup-order-hack=INET
 
 make
 make test
@@ -321,7 +325,7 @@
 
 %post libs
 /sbin/ldconfig
-if [ -w %{_prefix}/local/lib -a ! -e %{sitedir} ]; then
+if [ -w %{_prefix}/lib -a ! -e %{sitedir} ]; then
        mkdir -p %{sitedir} %{sitedir}/%{_target_cpu}-%{_target_os}
        chown root.root %{sitedir} %{sitedir}/%{_target_cpu}-%{_target_os}
        chmod 2775 %{sitedir} %{sitedir}/%{_target_cpu}-%{_target_os}
@@ -333,7 +337,7 @@
        if [ -w %{sitedir} -a -e %{sitedir}/%{_target_cpu}-%{_target_os} ]; then
                rmdir %{sitedir}/%{_target_cpu}-%{_target_os} 2>/dev/null || true
        fi
-       if [ -w %{_prefix}/local/lib -a -e %{sitedir} ]; then
+       if [ -w %{_prefix}/lib -a -e %{sitedir} ]; then
                rmdir %{sitedir} 2>/dev/null || true
        fi
 fi

Comment 1 Ian Macdonald 2002-05-13 09:30:51 UTC
Created attachment 57066 [details]
Amended .spec file for Ruby

Comment 2 Ian Macdonald 2002-05-13 09:33:06 UTC
Created attachment 57067 [details]
patch from ruby-talk #38613

Comment 3 Ian Macdonald 2002-05-13 09:34:07 UTC
Created attachment 57068 [details]
patch from ruby-talk #38620

Comment 4 Ian Macdonald 2002-05-16 16:31:32 UTC
I just uploaded a new ruby RPM to the /libc6 contrib area of incoming.

This RPM (ruby-1.6.7-7) not only fixes the problems I've reported here, but also
includes some patches from the ruby-talk mailing list, plus a header file patch
that enables packages like ruby-FXRuby to build.

Actually, you'll find many Ruby module RPMs uploaded to the contrib area, all of
which were made by me. Feel free to use them.

Comment 5 Steve Snyder 2002-06-07 12:49:03 UTC
Perhaps it's moot at this point, but RPM does not indicate ownership of the
directories created by the ruby package:

# rpm -qf /usr/local/lib/site_ruby
file /usr/local/lib/site_ruby is not owned by any package
# rpm -qf /usr/local/lib/site_ruby/1.6/
file /usr/local/lib/site_ruby/1.6 is not owned by any package
# rpm -qf /usr/local/lib/site_ruby/1.6/i386-linux/
file /usr/local/lib/site_ruby/1.6/i386-linux is not owned by any package

FYI.

Comment 6 Akira TAGOH 2002-07-24 10:07:32 UTC
Well, the packages as RPM should uses Config::CONFIG['rubylibdir']. I'll be
going to do so at least if we provide some rpm related with Ruby. and site_ruby
should be used to install some Ruby script by the users. so /usr/local is
appropriate for that. see also FHS 2.2 Section 4.9 for more details.


Comment 7 Elliot Lee 2002-08-27 14:14:26 UTC
*** Bug 72021 has been marked as a duplicate of this bug. ***

Comment 8 Akira TAGOH 2002-09-03 12:51:39 UTC
should be fixed in 1.6.7-10


Note You need to log in before you can comment on or make changes to this bug.