diff --git a/.gitignore b/.gitignore index e69de29..41689da 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/kramdown-1.2.0.gem diff --git a/rubygem-kramdown.spec b/rubygem-kramdown.spec new file mode 100644 index 0000000..9ab697b --- /dev/null +++ b/rubygem-kramdown.spec @@ -0,0 +1,94 @@ +# Generated from kramdown-1.2.0.gem by gem2rpm -*- rpm-spec -*- +%global gem_name kramdown + +Name: rubygem-%{gem_name} +Version: 1.2.0 +Release: 1%{?dist} +Summary: Fast, pure-Ruby Markdown-superset converter + +License: MIT +URL: http://kramdown.rubyforge.org +Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +BuildRequires: ruby(release) +BuildRequires: rubygems-devel +BuildRequires: rubygem(minitest) +Requires: ruby(release) +Requires: ruby(rubygems) +BuildArch: noarch + +Provides: rubygem(%{gem_name}) = %{version}-%{release} + +%description +kramdown is yet-another-markdown-parser but fast, pure Ruby, +using a strict syntax definition and supporting several common extensions. + +%package doc +Summary: Documentation for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +Documentation for %{name} + +%prep +gem unpack %{SOURCE0} +%setup -q -D -T -n %{gem_name}-%{version} +gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec + +%build +gem build %{gem_name}.gemspec +%gem_install + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -pa .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ + +mkdir -p %{buildroot}%{_bindir} +cp -pa .%{_bindir}/* \ + %{buildroot}%{_bindir}/ + +find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x + +# Move man pages +mkdir -p %{buildroot}%{_mandir}/man1 +mv %{buildroot}%{gem_instdir}/man/man1/kramdown.1 \ + %{buildroot}%{_mandir}/man1 + +# Cleanup +pushd %{buildroot}%{gem_instdir} +rm -rf \ + setup.rb Rakefile \ + benchmark/ \ + test/ + +%check +LANG=en_US.utf8 + +pushd .%{gem_instdir} +# Some tests seem to be failing, need investigating +ruby -Ilib:test:. --verbose test/run_tests.rb 2>&1 | tee test-result.log +cat test-result.log | grep -q FAILED && echo "Please investigate this" || true +popd + +%files +%dir %{gem_instdir} +%doc %{gem_instdir}/[A-Z]* + +%{_bindir}/kramdown +%{gem_instdir}/bin +%{_mandir}/man1/kramdown.1* + +%{gem_libdir}/ +%{gem_instdir}/data/ + +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%doc %{gem_docdir} +%doc %{gem_instdir}/doc/ + +%changelog +* Fri Nov 15 2013 Mamoru TASAKA - 1.2.0-1 +- Initial package diff --git a/sources b/sources index e69de29..ecd7fdd 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +ec168d4cd6cc7a73996c0d5b6b12ff3c kramdown-1.2.0.gem