summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-06 13:39:38 -0800
committerMichael Leibowitz <michael.leibowitz@intel.com>2013-08-15 15:11:33 -0700
commite9b90b3caede12e355d2954f538a983633ed1fa5 (patch)
tree939866257f992bf500e69cbbe18b563bba1f72df
parent60bff48d977f5c365443096378f40bbf32c51c92 (diff)
downloadruby-e9b90b3caede12e355d2954f538a983633ed1fa5.tar.gz
ruby-e9b90b3caede12e355d2954f538a983633ed1fa5.tar.bz2
ruby-e9b90b3caede12e355d2954f538a983633ed1fa5.zip
add packaging
-rw-r--r--packaging/gem_install_wrapper.sh14
-rw-r--r--packaging/ruby-rpmlintrc2
-rw-r--r--packaging/ruby.macros51
-rw-r--r--packaging/ruby.spec44
4 files changed, 90 insertions, 21 deletions
diff --git a/packaging/gem_install_wrapper.sh b/packaging/gem_install_wrapper.sh
new file mode 100644
index 0000000..98d56d9
--- /dev/null
+++ b/packaging/gem_install_wrapper.sh
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+/usr/bin/gem1.9 install --verbose --local --build-root=$RPM_BUILD_ROOT "$@"
+if test -d $RPM_BUILD_ROOT/usr/bin; then
+ cd $RPM_BUILD_ROOT/usr/bin
+ bins=`ls -1 *1.9 2> /dev/null`
+ if test -n "$bins"; then
+ for bin in $bins; do
+ mv -v $bin $(echo "$bin" | sed -e 's,1.9$,,')
+ done
+ fi
+fi
+
diff --git a/packaging/ruby-rpmlintrc b/packaging/ruby-rpmlintrc
new file mode 100644
index 0000000..045f9b7
--- /dev/null
+++ b/packaging/ruby-rpmlintrc
@@ -0,0 +1,2 @@
+addFilter("files-duplicate /usr/share/ri/.*")
+addFilter("unexpanded-macro /usr/share/ri/.*")
diff --git a/packaging/ruby.macros b/packaging/ruby.macros
new file mode 100644
index 0000000..b4ce873
--- /dev/null
+++ b/packaging/ruby.macros
@@ -0,0 +1,51 @@
+%rb19_binary /usr/bin/ruby1.9
+%rb19_arch %(%{rb19_binary} -e 'print RUBY_PLATFORM')
+%rb19_ver %(%{rb19_binary} -r rbconfig -e 'print RbConfig::CONFIG["ruby_version"]')
+#
+#rb19_dir %{_libdir}/ruby/
+#rb19_libdir %{_libdir}/ruby/%{rb19_ver}/
+#rb19_archdir %{_libdir}/ruby/%{rb19_ver}/%{rb19_arch}
+#
+#rb19_sitedir %{_libdir}/ruby/site_ruby
+#rb19_sitelib %{rb19_sitedir}/%{rb19_ver}
+#rb19_sitearch %{rb19_sitedir}/%{rb19_ver}/%{rb19_arch}
+#
+#rb19_vendordir %{_libdir}/ruby/vendor_ruby
+#rb19_vendorlib %{rb19_vendordir}/%{rb19_ver}
+#rb19_vendorarch %{rb19_vendordir}/%{rb19_ver}/%{rb19_arch}
+
+
+## Base
+# "rubylibprefix"=>"/usr/lib64/ruby",
+%rb19_dir %(%{rb19_binary} -rrbconfig -e 'puts RbConfig::CONFIG["rubylibprefix"]' )
+# "rubylibdir" =>"/usr/lib64/ruby/1.9.1",
+%rb19_libdir %(%{rb19_binary} -rrbconfig -e 'puts RbConfig::CONFIG["rubylibdir"]' )
+# "archdir" =>"/usr/lib64/ruby/1.9.1/x86_64-linux",
+%rb19_archdir %(%{rb19_binary} -rrbconfig -e 'puts RbConfig::CONFIG["archdir"]' )
+
+## Site
+# "sitedir" =>"/usr/lib64/ruby/site_ruby",
+%rb19_sitedir %(%{rb19_binary} -rrbconfig -e 'puts RbConfig::CONFIG["sitedir"]' )
+# "sitelibdir" =>"/usr/lib64/ruby/site_ruby/1.9.1",
+%rb19_sitelibdir %(%{rb19_binary} -rrbconfig -e 'puts RbConfig::CONFIG["sitelibdir"]' )
+# "sitearchdir" =>"/usr/lib64/ruby/site_ruby/1.9.1/x86_64-linux",
+%rb19_sitearchdir %(%{rb19_binary} -rrbconfig -e 'puts RbConfig::CONFIG["sitearchdir"]' )
+
+## Vendor
+# "vendordir" =>"/usr/lib64/ruby/vendor_ruby",
+%rb19_vendordir %(%{rb19_binary} -rrbconfig -e 'puts RbConfig::CONFIG["vendordir"]' )
+# "vendorlibdir" =>"/usr/lib64/ruby/vendor_ruby/1.9.1",
+%rb19_vendorlibdir %(%{rb19_binary} -rrbconfig -e 'puts RbConfig::CONFIG["vendorlibdir"]' )
+# "vendorarchdir" =>"/usr/lib64/ruby/vendor_ruby/1.9.1/x86_64-linux",
+%rb19_vendorarchdir %(%{rb19_binary} -rrbconfig -e 'puts RbConfig::CONFIG["vendorarchdir"]' )
+
+
+%gem19_install /usr/lib/rpm/gem_install_wrapper.sh
+%gem19_cleanup /usr/bin/gem_build_cleanup %{buildroot}%{_libdir}/ruby/gems/%{rb19_ver}/gems/%{mod_name}-%{version}/
+%rubygems19_requires() \
+%if 0%{?suse_version} > 1100 \
+%{requires_ge ruby19} \
+%else \
+%{requires_eq ruby19} \
+%endif
+
diff --git a/packaging/ruby.spec b/packaging/ruby.spec
index 7a616fe..3605e31 100644
--- a/packaging/ruby.spec
+++ b/packaging/ruby.spec
@@ -16,19 +16,10 @@ Release: 0
%ifarch %ix86 x86_64 ppc ppc64
%define use_valgrind 1
%endif
-License: BSD-2-Clause or Ruby
+%define run_tests 0
#
-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
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: gdbm-devel
BuildRequires: libffi-devel
BuildRequires: libyaml-devel
@@ -37,14 +28,23 @@ BuildRequires: openssl-devel
BuildRequires: pkg-config
BuildRequires: readline-devel
BuildRequires: zlib-devel
+BuildRequires: ca-certificates
#BuildRequires: ca-certificates-cacert
#
Provides: rubygem-rake = 0.9.2.2
Provides: ruby(abi) = %{rb_ver}
-%define run_tests 0
#
+Url: http://www.ruby-lang.org/
+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
+Patch: rubygems-1.5.0_buildroot.patch
+Patch1: ruby-1.9.2p290_tcl_no_stupid_rpaths.patch
+Patch2: ruby19-export_init_prelude.patch
#
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
+Summary: An Interpreted Object-Oriented Scripting Language
+License: BSD-2-Clause or Ruby
+Group: Development/Languages/Ruby
%description
Ruby is an interpreted scripting language for quick and easy
@@ -75,17 +75,19 @@ simple, straight-forward, and extensible.
- 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
+Requires: ruby-common
%description devel
Development files to link against Ruby.
+
%package doc-ri
Summary: Ruby Interactive Documentation
Group: Development/Languages/Ruby
@@ -115,9 +117,9 @@ BuildArch: noarch
Example scripts for ruby
%package test-suite
+Requires: %{name} = %{version}
Summary: An Interpreted Object-Oriented Scripting Language
Group: Development/Languages/Ruby
-Requires: %{name} = %{version}
%if 0%{?suse_version} >= 1120
BuildArch: noarch
%endif
@@ -152,7 +154,7 @@ BeOS, and more)
%prep
%setup -q -n ruby-%{pkg_version}-%{patch_level}
-%patch0
+%patch
%patch1
%patch2 -p1
%if 0%{?needs_optimization_zero}
@@ -178,12 +180,12 @@ export FFLAGS="$CFLAGS"
--enable-shared \
--disable-static \
--disable-rpath
-make all V=1
+%{__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
+%{__install} -D -m 0644 %{S:6} %{buildroot}/etc/rpm/macros.ruby19
+%{__install} -D -m 0755 %{S:7} %{buildroot}/usr/lib/rpm/gem_install_wrapper.sh
%if 0%{?run_tests}
%check
@@ -197,7 +199,7 @@ make check V=1 ||:
%files
%defattr(-,root,root,-)
-%config(noreplace) %{_sysconfdir}/rpm/macros.ruby19
+%config(noreplace) /etc/rpm/macros.ruby19
%{_bindir}/erb
%{_bindir}/gem
%{_bindir}/irb
@@ -208,7 +210,7 @@ make check V=1 ||:
%{_bindir}/testrb
%{_libdir}/libruby.so.1.9*
%{_libdir}/ruby/
-%{_libdir}/rpm/gem_install_wrapper.sh
+/usr/lib/rpm/gem_install_wrapper.sh
%{_mandir}/man1/ri.1*
%{_mandir}/man1/irb.1*
%{_mandir}/man1/erb.1*