Blob Blame History Raw
%global gem_name newgem


Summary:        Bundle Ruby libraries into a RubyGem
Name:           rubygem-%{gem_name}
Version:        1.5.3
Release:        10%{?dist}
Group:          Development/Languages
License:        MIT or LGPLv2+
URL:            http://newgem.rubyforge.org
Source0:        http://gems.rubyforge.org/gems/%{gem_name}-%{version}.gem
# Upstream wants a specific version of activesupport that's only required by
# rubigen. Unclear why this is being done.
# Filed at http://github.com/drnic/newgem/issues/issue/8
Patch0:         rubygem-newgem-1.5.3-gemspec.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires:       ruby(rubygems)
Requires:       ruby(release)
Requires:       rubygem(rubigen) >= 1.5.3
Requires:       rubygem(hoe)
Requires:       rubygem(RedCloth)
Requires:       rubygem(syntax)
Requires:       rubygem(cucumber)
BuildRequires: rubygems-devel
BuildRequires: ruby-devel
BuildRequires:  ruby(release)
BuildRequires:  rubygem(rubigen)
BuildRequires:  rubygem(hoe)
BuildRequires:  rubygem(RedCloth)
BuildRequires:  rubygem(syntax)
BuildRequires:  rubygem(cucumber)
BuildRequires:  rubygem(minitest)
BuildArch:      noarch
Provides:       rubygem(%{gem_name}) = %{version}

%description
Within this gem, you get one thing - newgem - an executable to create your own
gems. Your new gems will include designated folders for Ruby code, test files,
executables, and even a default website page for you to explain your project,
and which instantly uploads to RubyForge website (which looks just like this
one by default).


%prep
%setup -q -c -T

%gem_install -n %{SOURCE0}

pushd .%{gem_dir}
%patch0 -p0
test -f specifications/%{gem_name}-%{version}.gemspec.orig && \
     rm specifications/%{gem_name}-%{version}.gemspec.orig

%build

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* %{buildroot}%{gem_dir}/

mkdir -p %{buildroot}/%{_bindir}
mv .%{_bindir}/* %{buildroot}/%{_bindir}

# Kill crlf
sed -s 's/\r//g' -i %{buildroot}%{gem_instdir}/README.rdoc \
        %{buildroot}%{gem_instdir}/website/version.js \
        %{buildroot}%{gem_instdir}/website/version-raw.txt \
        %{buildroot}%{gem_instdir}/test/test_helper.rb

# Don't search environment - we leave the generators alone as someone may want
# the env searching.
find %{buildroot}%{gem_instdir}/{bin,script} -type f | \
  xargs -n 1 sed -i -e 's"^#!/usr/bin/env ruby"#!/usr/bin/ruby"'

# Only one minor test fails, reported here
# http://github.com/drnic/newgem/issues/#issue/7
# Disable the assert for now
sed -i '/assert_directory_exists "tasks"/d' \
  %{buildroot}%{gem_instdir}/test/test_newgem_generator.rb

%clean
rm -rf %{buildroot}


%check
pushd %{buildroot}%{gem_instdir}
testrb test
popd


# CAUTION: rpmlint currently generates 8 errors and 2 warnings on this package
# due to the templating in the generators. Check the output carefully.
%files
%defattr(-,root,root,-)
%{_bindir}/newgem
%dir %{gem_instdir}
%{gem_instdir}/*_generators
%{gem_instdir}/bin
%{gem_instdir}/config
%{gem_instdir}/features
%{gem_libdir}
%{gem_instdir}/script
%{gem_instdir}/website
%{gem_instdir}/Rakefile
%doc %{gem_instdir}/TODO.markdown
%doc %{gem_instdir}/test
%doc %{gem_instdir}/History.txt
%doc %{gem_instdir}/Manifest.txt
%doc %{gem_instdir}/PostInstall.txt
%doc %{gem_instdir}/README.rdoc
%doc %{gem_docdir}
%{gem_cache}
%{gem_spec}


%changelog
* Tue Mar 19 2013 Bohuslav Kabrda <bkabrda@redhat.com> - 1.5.3-10
- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.3-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.3-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri Feb 03 2012 Vít Ondruch <vondruch@redhat.com> - 1.5.3-7
- Rebuilt for Ruby 1.9.3.

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Aug 08 2011 Mo Morsi <mmorsi@redhat.com> - 1.5.3-5
- replace BR(check) with BR

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org>
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Jun 09 2010 Matthew Kent <mkent@magoazul.com> - 1.5.3-3
- New spec patch due to rubygems update.

* Wed May 05 2010 Matthew Kent <mkent@magoazul.com> - 1.5.3-2
- Version the rubigen dependency.

* Tue May 04 2010 Matthew Kent <mkent@magoazul.com> - 1.5.3-1
- New upstream version - minor changes.
- Drop activesupport - only required by rubigen which already pulls it in.
  Upstream added a strict dependency - patched this out.

* Mon Feb 01 2010 Matthew Kent <mkent@magoazul.com> - 1.5.2-3
- Fix License (#504476).
- Disable activesupport Requires for now (#504476).

* Fri Jan 01 2010 Matthew Kent <mkent@magoazul.com> - 1.5.2-2
- Drop versioning on requirements as this is a new package.
- Drop unused ruby_sitelib macro.
- Add a rubyabi macro.
- RPM_BUILD_ROOT -> buildroot - use one style of macros.
- Fix bin/env ruby searching in bin/newgem.
- Remove duplicate hoe dependency.
- Add check phase.
- Fix another crlf (#504476).
- Add note about rpmlint complaints (#504476).

* Mon Oct 12 2009 Lubomir Rintel (Good Data) <lubo.rintel@gooddata.com> - 1.5.2-1
- Newer release

* Fri Jun 26 2009 Lubomir Rintel (Good Data) <lubo.rintel@gooddata.com> - 1.4.1-3
- Get rid of duplicate files (thanks to Mamoru Tasaka)

* Mon Jun 08 2009 Lubomir Rintel (Good Data) <lubo.rintel@gooddata.com> - 1.4.1-2
- Bring tests back
- Depend on ruby(abi)
- Replace defines with globals
- Don't drop the empty USAGE files

* Fri Jun 05 2009 Lubomir Rintel (Good Data) <lubo.rintel@gooddata.com> - 1.4.1-1
- Package generated by gem2rpm
- Don't ship tests
- Fix end of line encodings
- Remove empty files
- Fix up License