Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 64830 - Ruby RPM defines 'sitedir' under /usr/local
Ruby RPM defines 'sitedir' under /usr/local
Product: Red Hat Linux
Classification: Retired
Component: ruby (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Akira TAGOH
David Lawrence
: 72021 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2002-05-13 05:28 EDT by Ian Macdonald
Modified: 2007-04-18 12:42 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-08-27 10:20:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Ian Macdonald 2002-05-13 05:28:10 EDT
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:

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

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 \
   --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 test
@@ -321,7 +325,7 @@
 %post libs
-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
-       if [ -w %{_prefix}/local/lib -a -e %{sitedir} ]; then
+       if [ -w %{_prefix}/lib -a -e %{sitedir} ]; then
                rmdir %{sitedir} 2>/dev/null || true
Comment 1 Ian Macdonald 2002-05-13 05:30:51 EDT
Created attachment 57066 [details]
Amended .spec file for Ruby
Comment 2 Ian Macdonald 2002-05-13 05:33:06 EDT
Created attachment 57067 [details]
patch from ruby-talk #38613
Comment 3 Ian Macdonald 2002-05-13 05:34:07 EDT
Created attachment 57068 [details]
patch from ruby-talk #38620
Comment 4 Ian Macdonald 2002-05-16 12:31:32 EDT
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 08:49:03 EDT
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

Comment 6 Akira TAGOH 2002-07-24 06:07:32 EDT
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 10:14:26 EDT
*** Bug 72021 has been marked as a duplicate of this bug. ***
Comment 8 Akira TAGOH 2002-09-03 08:51:39 EDT
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.