summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-06 11:57:15 -0800
committerMichael Leibowitz <michael.leibowitz@intel.com>2013-08-15 15:11:33 -0700
commit60bff48d977f5c365443096378f40bbf32c51c92 (patch)
tree0237fd3570a3e2f72498b69c40e232ac94e261d7
parent6b0e2a11aeccf2ebc707c22548a0c15c8c2bae06 (diff)
downloadruby-60bff48d977f5c365443096378f40bbf32c51c92.tar.gz
ruby-60bff48d977f5c365443096378f40bbf32c51c92.tar.bz2
ruby-60bff48d977f5c365443096378f40bbf32c51c92.zip
add packaging
-rw-r--r--packaging/ruby-1.9.2p290_tcl_no_stupid_rpaths.patch15
-rw-r--r--packaging/ruby.spec231
-rw-r--r--packaging/ruby19-export_init_prelude.patch25
-rw-r--r--packaging/rubygems-1.5.0_buildroot.patch60
4 files changed, 331 insertions, 0 deletions
diff --git a/packaging/ruby-1.9.2p290_tcl_no_stupid_rpaths.patch b/packaging/ruby-1.9.2p290_tcl_no_stupid_rpaths.patch
new file mode 100644
index 0000000..baa2c3e
--- /dev/null
+++ b/packaging/ruby-1.9.2p290_tcl_no_stupid_rpaths.patch
@@ -0,0 +1,15 @@
+Index: ext/tk/extconf.rb
+===================================================================
+--- ext/tk/extconf.rb.orig
++++ ext/tk/extconf.rb
+@@ -215,9 +215,7 @@ def get_shlib_path_head
+
+ else
+ [
+- '/opt', '/pkg', '/share',
+- '/usr/local/opt', '/usr/local/pkg', '/usr/local/share', '/usr/local',
+- '/usr/opt', '/usr/pkg', '/usr/share', '/usr/contrib', '/usr'
++ '/usr'
+ ].each{|dir|
+ next unless File.directory?(dir)
+
diff --git a/packaging/ruby.spec b/packaging/ruby.spec
new file mode 100644
index 0000000..7a616fe
--- /dev/null
+++ b/packaging/ruby.spec
@@ -0,0 +1,231 @@
+Name: ruby
+Version: 1.9.3.p194
+Release: 0
+#
+%define pkg_version 1.9.3
+%define patch_level p194
+# keep in sync with macro file!
+%define rb_binary_suffix 1.9
+%define rb_ver 1.9.1
+%define rb_arch %(echo %{_target_cpu}-linux | sed -e "s/ppc/powerpc/")
+%define rb_libdir %{_libdir}/ruby/%{rb_ver}/
+%define rb_archdir %{_libdir}/ruby/%{rb_ver}/%{rb_arch}
+# keep in sync with macro file!
+#
+# from valgrind.spec
+%ifarch %ix86 x86_64 ppc ppc64
+%define use_valgrind 1
+%endif
+License: BSD-2-Clause or Ruby
+#
+Summary: An Interpreted Object-Oriented Scripting Language
+#
+Url: http://www.ruby-lang.org/
+Group: Development/Languages/Ruby
+Source: ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-%{pkg_version}-%{patch_level}.tar.bz2
+Source6: ruby19.macros
+Source7: gem_install_wrapper.sh
+Patch0: rubygems-1.5.0_buildroot.patch
+Patch1: ruby-1.9.2p290_tcl_no_stupid_rpaths.patch
+Patch2: ruby19-export_init_prelude.patch
+BuildRequires: ca-certificates
+BuildRequires: gdbm-devel
+BuildRequires: libffi-devel
+BuildRequires: libyaml-devel
+BuildRequires: ncurses-devel
+BuildRequires: openssl-devel
+BuildRequires: pkg-config
+BuildRequires: readline-devel
+BuildRequires: zlib-devel
+#BuildRequires: ca-certificates-cacert
+#
+Provides: rubygem-rake = 0.9.2.2
+Provides: ruby(abi) = %{rb_ver}
+%define run_tests 0
+#
+#
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+
+%description
+Ruby is an interpreted scripting language for quick and easy
+object-oriented programming. It has many features for processing text
+files and performing system management tasks (as in Perl). It is
+simple, straight-forward, and extensible.
+
+* Ruby features:
+
+- Simple Syntax
+
+- *Normal* Object-Oriented features (class, method calls, for
+ example)
+
+- *Advanced* Object-Oriented features(Mix-in, Singleton-method, for
+ example)
+
+- Operator Overloading
+
+- Exception Handling
+
+- Iterators and Closures
+
+- Garbage Collection
+
+- Dynamic Loading of Object Files (on some architectures)
+
+- Highly Portable (works on many UNIX machines; DOS, Windows, Mac,
+BeOS, and more)
+
+%package devel
+Summary: Development files to link against Ruby
+Group: Development/Languages/Ruby
+Requires: %{name} = %{version}
+Requires: ruby-common
+Provides: rubygems19 = 1.3.7
+Provides: rubygems19_with_buildroot_patch
+
+%description devel
+Development files to link against Ruby.
+
+%package doc-ri
+Summary: Ruby Interactive Documentation
+Group: Development/Languages/Ruby
+Requires: %{name} = %{version}
+%if 0%{?suse_version} >= 1120
+BuildArch: noarch
+%endif
+%description doc-ri
+This package contains the RI docs for ruby
+
+%package doc-html
+Summary: This package contains the HTML docs for ruby
+Group: Development/Languages/Ruby
+Requires: %{name} = %{version}
+%if 0%{?suse_version} >= 1120
+BuildArch: noarch
+%endif
+%description doc-html
+This package contains the HTML docs for ruby
+
+%package examples
+Summary: Example scripts for ruby
+Group: Development/Languages/Ruby
+Requires: %{name} = %{version}
+BuildArch: noarch
+%description examples
+Example scripts for ruby
+
+%package test-suite
+Summary: An Interpreted Object-Oriented Scripting Language
+Group: Development/Languages/Ruby
+Requires: %{name} = %{version}
+%if 0%{?suse_version} >= 1120
+BuildArch: noarch
+%endif
+%description test-suite
+Ruby is an interpreted scripting language for quick and easy
+object-oriented programming. It has many features for processing text
+files and performing system management tasks (as in Perl). It is
+simple, straight-forward, and extensible.
+
+* Ruby features:
+
+- Simple Syntax
+
+- *Normal* Object-Oriented features (class, method calls, for
+ example)
+
+- *Advanced* Object-Oriented features(Mix-in, Singleton-method, for
+ example)
+
+- Operator Overloading
+
+- Exception Handling
+
+- Iterators and Closures
+
+- Garbage Collection
+
+- Dynamic Loading of Object Files (on some architectures)
+
+- Highly Portable (works on many UNIX machines; DOS, Windows, Mac,
+BeOS, and more)
+
+%prep
+%setup -q -n ruby-%{pkg_version}-%{patch_level}
+%patch0
+%patch1
+%patch2 -p1
+%if 0%{?needs_optimization_zero}
+touch -r configure configure.timestamp
+perl -p -i.bak -e 's|-O2|-O0|g' configure
+diff -urN configure{.bak,} ||:
+touch -r configure.timestamp configure
+%endif
+find sample -type f -print0 | xargs -r0 chmod a-x
+grep -Erl '^#! */' benchmark bootstraptest ext lib sample test \
+ | xargs -r perl -p -i -e 's|^#!\s*\S+(\s+.*)?$|#!/usr/bin/ruby1.9$1|'
+
+%build
+%if 0%{?needs_optimization_zero}
+export CFLAGS="%{optflags}"
+export CFLAGS="${CFLAGS//-O2/}"
+export CXXFLAGS="$CFLAGS"
+export FFLAGS="$CFLAGS"
+%endif
+%configure \
+ --target=%{_target_platform} \
+ --with-mantype=man \
+ --enable-shared \
+ --disable-static \
+ --disable-rpath
+make all V=1
+
+%install
+%make_install V=1
+install -D -m 0644 %{SOURCE6} %{buildroot}%{_sysconfdir}/rpm/macros.ruby19
+install -D -m 0755 %{SOURCE7} %{buildroot}/usr/lib/rpm/gem_install_wrapper.sh
+
+%if 0%{?run_tests}
+%check
+export LD_LIBRARY_PATH="$PWD"
+# we know some tests will fail when they do not find a /usr/bin/ruby
+make check V=1 ||:
+%endif
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(-,root,root,-)
+%config(noreplace) %{_sysconfdir}/rpm/macros.ruby19
+%{_bindir}/erb
+%{_bindir}/gem
+%{_bindir}/irb
+%{_bindir}/rake
+%{_bindir}/rdoc
+%{_bindir}/ri
+%{_bindir}/ruby
+%{_bindir}/testrb
+%{_libdir}/libruby.so.1.9*
+%{_libdir}/ruby/
+%{_libdir}/rpm/gem_install_wrapper.sh
+%{_mandir}/man1/ri.1*
+%{_mandir}/man1/irb.1*
+%{_mandir}/man1/erb.1*
+%{_mandir}/man1/rake.1*
+%{_mandir}/man1/ruby.1*
+%doc COPYING COPYING.ja GPL
+
+%files devel
+%defattr(-,root,root,-)
+%{_includedir}/ruby-%{rb_ver}
+%{_libdir}/libruby.so
+%{_libdir}/pkgconfig/ruby-1.9.pc
+
+
+%files doc-ri
+%defattr(-,root,root,-)
+%dir %{_datadir}/ri/
+%{_datadir}/ri/%{rb_ver}/
+
+%changelog
diff --git a/packaging/ruby19-export_init_prelude.patch b/packaging/ruby19-export_init_prelude.patch
new file mode 100644
index 0000000..34215de
--- /dev/null
+++ b/packaging/ruby19-export_init_prelude.patch
@@ -0,0 +1,25 @@
+Index: ruby-1.9.3-p194/include/ruby/ruby.h
+===================================================================
+--- ruby-1.9.3-p194.orig/include/ruby/ruby.h
++++ ruby-1.9.3-p194/include/ruby/ruby.h
+@@ -1225,6 +1225,7 @@ void ruby_init_stack(volatile VALUE*);
+ VALUE variable_in_this_stack_frame; \
+ ruby_init_stack(&variable_in_this_stack_frame);
+ void ruby_init(void);
++void ruby_init_prelude(void);
+ void *ruby_options(int, char**);
+ int ruby_run_node(void *);
+ int ruby_exec_node(void *);
+Index: ruby-1.9.3-p194/ruby.c
+===================================================================
+--- ruby-1.9.3-p194.orig/ruby.c
++++ ruby-1.9.3-p194/ruby.c
+@@ -1091,7 +1091,7 @@ proc_options(long argc, char **argv, str
+ return argc0 - argc;
+ }
+
+-static void
++void
+ ruby_init_prelude(void)
+ {
+ Init_prelude();
diff --git a/packaging/rubygems-1.5.0_buildroot.patch b/packaging/rubygems-1.5.0_buildroot.patch
new file mode 100644
index 0000000..7e4f09f
--- /dev/null
+++ b/packaging/rubygems-1.5.0_buildroot.patch
@@ -0,0 +1,60 @@
+Index: lib/rubygems/dependency_installer.rb
+===================================================================
+--- lib/rubygems/dependency_installer.rb.orig
++++ lib/rubygems/dependency_installer.rb
+@@ -69,6 +69,7 @@ class Gem::DependencyInstaller
+ @installed_gems = []
+
+ @install_dir = options[:install_dir] || Gem.dir
++ @build_root = options[:build_root]
+ @cache_dir = options[:cache_dir] || @install_dir
+
+ # Set with any errors that SpecFetcher finds while search through
+@@ -290,6 +291,7 @@ class Gem::DependencyInstaller
+ :format_executable => @format_executable,
+ :ignore_dependencies => @ignore_dependencies,
+ :install_dir => @install_dir,
++ :build_root => @build_root,
+ :security_policy => @security_policy,
+ :user_install => @user_install,
+ :wrappers => @wrappers
+Index: lib/rubygems/installer.rb
+===================================================================
+--- lib/rubygems/installer.rb.orig
++++ lib/rubygems/installer.rb
+@@ -427,9 +427,18 @@ class Gem::Installer
+ @wrappers = options[:wrappers]
+ @bin_dir = options[:bin_dir]
+ @development = options[:development]
++ @build_root = options[:build_root]
+
+ raise "NOTE: Installer option :source_index is dead" if
+ options[:source_index]
++
++ unless @build_root.nil?
++ require 'pathname'
++ @build_root = Pathname.new(@build_root).expand_path
++ @bin_dir = File.join(@build_root, options[:bin_dir] || Gem.bindir(@gem_home))
++ @gem_home = File.join(@build_root,@gem_home)
++ alert_warning "You build with buildroot.\n Build root: #{@build_root}\n Bin dir: #{@bin_dir}\n Gem home: #{@gem_home}"
++ end
+ end
+
+ def check_that_user_bin_dir_is_in_path
+Index: lib/rubygems/install_update_options.rb
+===================================================================
+--- lib/rubygems/install_update_options.rb.orig
++++ lib/rubygems/install_update_options.rb
+@@ -44,6 +44,12 @@ module Gem::InstallUpdateOptions
+ options[:bin_dir] = File.expand_path(value)
+ end
+
++ add_option(:"Install/Update", '--build-root DIR',
++ 'Temporary installation root. Useful for building',
++ 'packages. Do not use this when installing remote gems.') do |value, options|
++ options[:build_root] = File.expand_path(value)
++ end
++
+ add_option(:"Install/Update", '-d', '--[no-]rdoc',
+ 'Generate RDoc documentation for the gem on',
+ 'install') do |value, options|