From 449339bfc85a84087651b348913f102534d6ce4f Mon Sep 17 00:00:00 2001 From: Vít Ondruch Date: Feb 01 2011 08:14:13 +0000 Subject: Initial import (#646836). --- diff --git a/.gitignore b/.gitignore index e69de29..4c4c6e0 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/bundler-1.0.9.gem diff --git a/bundler-rspec13-compatibility.patch b/bundler-rspec13-compatibility.patch new file mode 100644 index 0000000..255c4a9 --- /dev/null +++ b/bundler-rspec13-compatibility.patch @@ -0,0 +1,248 @@ +diff -u --recursive --new-file spec.orig/install/gems/sudo_spec.rb spec/install/gems/sudo_spec.rb +--- spec.orig/install/gems/sudo_spec.rb 2011-01-27 13:55:13.000000000 +0100 ++++ spec/install/gems/sudo_spec.rb 1970-01-01 01:00:00.000000000 +0100 +@@ -1,73 +0,0 @@ +-require "spec_helper" +- +-describe "when using sudo", :sudo => true do +- describe "and GEM_HOME is owned by root" do +- before :each do +- chown_system_gems_to_root +- end +- +- it "installs" do +- install_gemfile <<-G +- source "file://#{gem_repo1}" +- gem "rack", '1.0' +- G +- +- system_gem_path("gems/rack-1.0.0").should exist +- check system_gem_path("gems/rack-1.0.0").stat.uid.should == 0 +- should_be_installed "rack 1.0" +- end +- +- it "installs when BUNDLE_PATH is owned by root" do +- bundle_path = tmp("owned_by_root") +- FileUtils.mkdir_p bundle_path +- sudo "chown -R root #{bundle_path}" +- +- ENV['BUNDLE_PATH'] = bundle_path.to_s +- install_gemfile <<-G +- source "file://#{gem_repo1}" +- gem "rack", '1.0' +- G +- +- bundle_path.join("gems/rack-1.0.0").should exist +- check bundle_path.join("gems/rack-1.0.0").stat.uid.should == 0 +- should_be_installed "rack 1.0" +- end +- +- it "installs when BUNDLE_PATH does not exist" +- end +- +- describe "and BUNDLE_PATH is not writable" do +- it "installs" do +- sudo "chmod ugo-w #{default_bundle_path}" +- install_gemfile <<-G +- source "file://#{gem_repo1}" +- gem "rack", '1.0' +- G +- +- default_bundle_path("gems/rack-1.0.0").should exist +- should_be_installed "rack 1.0" +- end +- end +- +- describe "and BUNDLE_PATH is not writable" do +- it "installs" do +- begin +- gem_home = tmp('sudo_gem_home') +- +- sudo "mkdir -p #{gem_home}" +- sudo "chmod ugo-w #{gem_home}" +- ENV['GEM_HOME'] = gem_home.to_s +- ENV['GEM_PATH'] = nil +- +- install_gemfile <<-G +- source "file://#{gem_repo1}" +- gem "rack", '1.0' +- G +- +- gem_home.join('bin/rackup').should exist +- should_be_installed "rack 1.0" +- end +- end +- end +- +-end +diff -u --recursive --new-file spec.orig/other/exec_spec.rb spec/other/exec_spec.rb +--- spec.orig/other/exec_spec.rb 2011-01-27 13:55:13.000000000 +0100 ++++ spec/other/exec_spec.rb 2011-01-27 11:30:38.591196282 +0100 +@@ -83,7 +83,7 @@ + gem "rack" + G + +- rubyopt = "-I#{bundler_path} -rbundler/setup" ++ rubyopt = "#{ENV['RUBYOPT']} -I#{bundler_path} -rbundler/setup" + + bundle "exec 'echo $RUBYOPT'" + out.should have_rubyopts(rubyopt) +diff -u --recursive --new-file spec.orig/quality_spec.rb spec/quality_spec.rb +--- spec.orig/quality_spec.rb 2011-01-27 13:55:13.000000000 +0100 ++++ spec/quality_spec.rb 1970-01-01 01:00:00.000000000 +0100 +@@ -1,58 +0,0 @@ +-require "spec_helper" +- +-describe "The library itself" do +- def check_for_tab_characters(filename) +- failing_lines = [] +- File.readlines(filename).each_with_index do |line,number| +- failing_lines << number + 1 if line =~ /\t/ +- end +- +- unless failing_lines.empty? +- "#{filename} has tab characters on lines #{failing_lines.join(', ')}" +- end +- end +- +- def check_for_extra_spaces(filename) +- failing_lines = [] +- File.readlines(filename).each_with_index do |line,number| +- next if line =~ /^\s+#.*\s+\n$/ +- failing_lines << number + 1 if line =~ /\s+\n$/ +- end +- +- unless failing_lines.empty? +- "#{filename} has spaces on the EOL on lines #{failing_lines.join(', ')}" +- end +- end +- +- RSpec::Matchers.define :be_well_formed do +- failure_message_for_should do |actual| +- actual.join("\n") +- end +- +- match do |actual| +- actual.empty? +- end +- end +- +- it "has no malformed whitespace" do +- error_messages = [] +- Dir.chdir(File.expand_path("../..", __FILE__)) do +- `git ls-files`.split("\n").each do |filename| +- next if filename =~ /\.gitmodules|fixtures/ +- error_messages << check_for_tab_characters(filename) +- error_messages << check_for_extra_spaces(filename) +- end +- end +- error_messages.compact.should be_well_formed +- end +- +- it "can still be built" do +- Dir.chdir(root) do +- `gem build bundler.gemspec` +- check $?.should == 0 +- +- # clean up the .gem generated +- system("rm bundler-#{Bundler::VERSION}.gem") +- end +- end +-end +diff -u --recursive --new-file spec.orig/runtime/setup_spec.rb spec/runtime/setup_spec.rb +--- spec.orig/runtime/setup_spec.rb 2011-01-27 13:55:13.000000000 +0100 ++++ spec/runtime/setup_spec.rb 2011-01-27 12:37:05.731384044 +0100 +@@ -242,13 +242,14 @@ + out.should == "bundler-#{Bundler::VERSION}\nyard-1.0" + end + +- context "when the ruby stdlib is a substring of Gem.path" do +- it "does not reject the stdlib from $LOAD_PATH" do +- substring = "/" + $LOAD_PATH.find{|p| p =~ /vendor_ruby/ }.split("/")[2] +- run "puts 'worked!'", :env => {"GEM_PATH" => substring} +- out.should == "worked!" +- end +- end ++# Seems to be Mac issue: https://github.com/carlhuda/bundler/issues/issue/986 ++# context "when the ruby stdlib is a substring of Gem.path" do ++# it "does not reject the stdlib from $LOAD_PATH" do ++# substring = "/" + $LOAD_PATH.find{|p| p =~ /vendor_ruby/ }.split("/")[2] ++# run "puts 'worked!'", :env => {"GEM_PATH" => substring} ++# out.should == "worked!" ++# end ++# end + end + end + +diff -u --recursive --new-file spec.orig/spec_helper.rb spec/spec_helper.rb +--- spec.orig/spec_helper.rb 2011-01-27 13:55:13.000000000 +0100 ++++ spec/spec_helper.rb 2011-01-27 11:31:33.342202891 +0100 +@@ -4,7 +4,7 @@ + require 'fileutils' + require 'rubygems' + require 'bundler' +-require 'rspec' ++require 'spec' + + # Require the correct version of popen for the current platform + if RbConfig::CONFIG['host_os'] =~ /mingw|mswin/ +@@ -29,7 +29,7 @@ + ENV['RUBYOPT'] = "#{ENV['RUBYOPT']} -r#{Spec::Path.root}/spec/support/rubygems_hax/platform.rb" + ENV['BUNDLE_SPEC_RUN'] = "true" + +-RSpec.configure do |config| ++Spec::Runner.configure do |config| + config.include Spec::Builders + config.include Spec::Helpers + config.include Spec::Indexes +@@ -39,10 +39,10 @@ + config.include Spec::Platforms + config.include Spec::Sudo + +- config.filter_run :focused => true unless ENV['CI'] +- config.filter_run_excluding :sudo => true unless Spec::Sudo.test_sudo? +- config.run_all_when_everything_filtered = true +- config.alias_example_to :fit, :focused => true ++# config.filter_run :focused => true unless ENV['CI'] ++# config.filter_run_excluding :sudo => true unless Spec::Sudo.test_sudo? ++# config.run_all_when_everything_filtered = true ++# config.alias_example_to :fit, :focused => true + + original_wd = Dir.pwd + original_path = ENV['PATH'] +diff -u --recursive --new-file spec.orig/support/matchers.rb spec/support/matchers.rb +--- spec.orig/support/matchers.rb 2011-01-27 13:55:13.000000000 +0100 ++++ spec/support/matchers.rb 2011-01-26 16:39:02.410425708 +0100 +@@ -1,6 +1,6 @@ + module Spec + module Matchers +- RSpec::Matchers.define :have_dep do |*args| ++ Spec::Matchers.define :have_dep do |*args| + dep = Bundler::Dependency.new(*args) + + match do |actual| +@@ -8,13 +8,13 @@ + end + end + +- RSpec::Matchers.define :have_gem do |*args| ++ Spec::Matchers.define :have_gem do |*args| + match do |actual| + actual.length == args.length && actual.all? { |a| args.include?(a.full_name) } + end + end + +- RSpec::Matchers.define :have_rubyopts do |*args| ++ Spec::Matchers.define :have_rubyopts do |*args| + args = args.flatten + args = args.first.split(/\s+/) if args.size == 1 + +@@ -67,7 +67,7 @@ + bundled_app("Gemfile.lock").should exist + end + +- RSpec::Matchers.define :be_with_diff do |expected| ++ Spec::Matchers.define :be_with_diff do |expected| + spaces = expected[/\A\s+/, 0] || "" + expected.gsub!(/^#{spaces}/, '') + diff --git a/rubygem-bundler.spec b/rubygem-bundler.spec new file mode 100644 index 0000000..f053d37 --- /dev/null +++ b/rubygem-bundler.spec @@ -0,0 +1,141 @@ +%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) +%global gemname bundler +%global geminstdir %{gemdir}/gems/%{gemname}-%{version} + +%global thorversion 0.14.6 + +Summary: Library and utilities to manage a Ruby application's gem dependencies +Name: rubygem-%{gemname} +Version: 1.0.9 +Release: 2%{?dist} +Group: Development/Languages +License: MIT +URL: http://gembundler.com +Source0: http://rubygems.org/gems/%{gemname}-%{version}.gem +# Bundler is using RSpec 2 but we are not that far yet. +Patch0: bundler-rspec13-compatibility.patch +Requires: rubygems +Requires: ruby(abi) = 1.8 +Requires: rubygem(thor) = %{thorversion} +BuildRequires: rubygems +# Not necessary as long as specs are not executed. +# BuildRequires: rubygem(rake) +# BuildRequires: rubygem(thor) = %{thorversion} +# BuildRequires: rubygem(fakeweb) = 1.3.0 +# BuildRequires: rubygem(builder) = 2.1.2 +# BuildRequires: rubygem(rspec) +# BuildRequires: git +BuildArch: noarch +Provides: rubygem(%{gemname}) = %{version} + +%description +Bundler manages an application's dependencies through its entire life, across +many machines, systematically and repeatably + +%package doc +Summary: Documentation for %{name} +Group: Documentation +Requires:%{name} = %{version}-%{release} + +%description doc +Documentation for %{name} + + +%prep +%setup -q -c -T +mkdir -p .%{gemdir} +gem install --local --install-dir .%{gemdir} \ + --force --rdoc %{SOURCE0} + +pushd .%{geminstdir} +%patch0 -p0 + +%build + +%install +mkdir -p %{buildroot}%{gemdir} +cp -a .%{gemdir}/* \ + %{buildroot}%{gemdir}/ + +mkdir -p %{buildroot}/%{_bindir} +mv %{buildroot}%{gemdir}/bin/* %{buildroot}/%{_bindir} +rmdir %{buildroot}%{gemdir}/bin +find %{buildroot}%{geminstdir}/bin -type f | xargs chmod a+x +rm %{buildroot}/%{geminstdir}/.gitignore + +# Remove bundled Thor +rm -rf %{buildroot}/%{geminstdir}/lib/bundler/vendor + +# Man pages are used by Bundler internally, do not remove them! +mkdir -p %{buildroot}%{_mandir}/man5 +cp -a %{buildroot}%{geminstdir}/lib/bundler/man/gemfile.5 %{buildroot}%{_mandir}/man5 +mkdir -p %{buildroot}%{_mandir}/man1 +for i in bundle bundle-config bundle-exec bundle-install bundle-package bundle-update +do + cp -a %{buildroot}%{geminstdir}/lib/bundler/man/$i %{buildroot}%{_mandir}/man1/`echo $i.1` +done + +# Remove the man pages sources +rm -r %{buildroot}%{geminstdir}/man/ + +# Specs are still not passing. There are several reasons: +# 1) Depency on git, git needs modified global configuration settings, this +# would mess with developer computer, requires sudo etc. +# 2) Test needs local copy of rake, fakeweb and builder gems, otherwise they +# are installed during runtime. +# There might be other issues I am not aware of ATM. +# +# Nevertheless, specs should be possible to execute after installation. +# +# %check +# pushd %{buildroot}%{geminstdir} +# RUBYOPT="$RUBYOPT I%{gemdir}/gems/thor-%{thorversion}/lib" spec spec/ +# rm -rf %{buildroot}%{geminstdir}/tmp/ + +%clean +rm -rf %{buildroot} + +%files +%defattr(-, root, root, -) +%dir %{geminstdir} +%{geminstdir}/lib +%doc %{geminstdir}/LICENSE +%doc %{geminstdir}/CHANGELOG.md +%doc %{geminstdir}/README.md +%{_bindir}/bundle +%{geminstdir}/bin +%{gemdir}/cache/%{gemname}-%{version}.gem +%{gemdir}/specifications/%{gemname}-%{version}.gemspec +%doc %{_mandir}/man1/* +%doc %{_mandir}/man5/* + +%files doc +%defattr(-,root, root, -) +%doc %{geminstdir}/ISSUES.md +%doc %{geminstdir}/UPGRADING.md +%{geminstdir}/Rakefile +%{geminstdir}/spec +%{geminstdir}/%{gemname}.gemspec +%doc %{gemdir}/doc/%{gemname}-%{version} + +%changelog +* Thu Jan 27 2011 Vít Ondruch - 1.0.9-2 +- More concise summary +- Do not remove manpages, they are used internally +- Added buildroot cleanup in clean section + +* Mon Jan 24 2011 Vít Ondruch - 1.0.9-1 +- Bumped to Bundler 1.0.9 +- Installed manual pages +- Removed obsolete buildroot cleanup + +* Mon Nov 1 2010 Jozef Zigmund - 1.0.3-2 +- Add ruby(abi) dependency +- Add using macro %{geminstdir} in files section +- Add subpackage doc for doc files +- Removed .gitignore file +- Removed rubygem-thor from vendor folder +- Add dependency rubygem(thor) + +* Mon Oct 18 2010 Jozef Zigmund - 1.0.3-1 +- Initial package diff --git a/sources b/sources index e69de29..5330814 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +2e5748b79c573d06b0401c119312b38a bundler-1.0.9.gem