diff --git a/rubygem-redcarpet-libxml2-2.8-fix.patch b/rubygem-redcarpet-libxml2-2.8-fix.patch new file mode 100644 index 0000000..5ba5296 --- /dev/null +++ b/rubygem-redcarpet-libxml2-2.8-fix.patch @@ -0,0 +1,127 @@ +diff --git a/test/redcarpet_test.rb b/test/redcarpet_test.rb +index 70e40ea..67bea67 100644 +--- a/test/redcarpet_test.rb ++++ b/test/redcarpet_test.rb +@@ -83,8 +83,7 @@ EOS + +

<script>BAD</script>

+ +-

<img src="/favicon.ico" /> +- ++

<img src="/favicon.ico" />

+ EOE + + markdown = render_with(@rndr[:escape_html], source) +@@ -93,7 +92,7 @@ EOE + + def test_that_filter_html_works + markdown = render_with(@rndr[:no_html], 'Through NO ') +- html_equal "

Through NO DOUBLE NO

", markdown ++ html_equal "

Through NO DOUBLE NO

\n", markdown + end + + def test_filter_html_doesnt_break_two_space_hard_break +@@ -141,21 +140,21 @@ class MarkdownTest < Test::Unit::TestCase + + def test_that_simple_one_liner_goes_to_html + assert_respond_to @markdown, :render +- html_equal "

Hello World.

", @markdown.render("Hello World.") ++ html_equal "

Hello World.

\n", @markdown.render("Hello World.") + end + + def test_that_inline_markdown_goes_to_html + markdown = @markdown.render('_Hello World_!') +- html_equal "

Hello World!

", markdown ++ html_equal "

Hello World!

\n", markdown + end + + def test_that_inline_markdown_starts_and_ends_correctly + markdown = render_with({:no_intra_emphasis => true}, '_start _ foo_bar bar_baz _ end_ *italic* **bold** _blah_') + +- html_equal "

start _ foo_bar bar_baz _ end italic bold blah

", markdown ++ html_equal "

start _ foo_bar bar_baz _ end italic bold blah

\n", markdown + + markdown = @markdown.render("Run 'rake radiant:extensions:rbac_base:migrate'") +- html_equal "

Run 'rake radiant:extensions:rbac_base:migrate'

", markdown ++ html_equal "

Run 'rake radiant:extensions:rbac_base:migrate'

\n", markdown + end + + def test_that_urls_are_not_doubly_escaped +@@ -249,7 +248,7 @@ class MarkdownTest < Test::Unit::TestCase + + def test_whitespace_after_urls + rd = render_with({:autolink => true}, "Japan: http://www.abc.net.au/news/events/japan-quake-2011/beforeafter.htm (yes, japan)") +- exp = %{

Japan: http://www.abc.net.au/news/events/japan-quake-2011/beforeafter.htm (yes, japan)

} ++ exp = %{

Japan: http://www.abc.net.au/news/events/japan-quake-2011/beforeafter.htm (yes, japan)

\n} + html_equal exp, rd + end + +@@ -269,7 +268,7 @@ class MarkdownTest < Test::Unit::TestCase + end + + def test_infinite_loop_in_header +- html_equal @markdown.render(<<-header), "

Body

" ++ html_equal @markdown.render(<<-header), "

Body

\n" + ###### + #Body# + ###### +@@ -313,7 +312,7 @@ fenced + + def test_that_headers_are_linkable + markdown = @markdown.render('### Hello [GitHub](http://github.com)') +- html_equal "

Hello GitHub

", markdown ++ html_equal "

Hello GitHub

\n", markdown + end + + def test_autolinking_with_ent_chars +@@ -338,7 +337,7 @@ class CustomRenderTest < Test::Unit::TestCase + + def test_simple_overload + md = Redcarpet::Markdown.new(SimpleRender) +- html_equal "

This is just a test

", ++ html_equal "

This is just a test

\n", + md.render("This is *just* a test") + end + +@@ -358,36 +357,36 @@ end + class RedcarpetCompatTest < Test::Unit::TestCase + def test_simple_compat_api + html = RedcarpetCompat.new("This is_just_a test").to_html +- html_equal "

This isjusta test

", html ++ html_equal "

This isjusta test

\n", html + end + + def test_compat_api_enables_extensions + html = RedcarpetCompat.new("This is_just_a test", :no_intra_emphasis).to_html +- html_equal "

This is_just_a test

", html ++ html_equal "

This is_just_a test

\n", html + end + + def test_compat_api_knows_fenced_code_extension + text = "```ruby\nx = 'foo'\n```" + html = RedcarpetCompat.new(text, :fenced_code).to_html +- html_equal "
x = 'foo'\n
", html ++ html_equal "
x = 'foo'\n
\n", html + end + + def test_compat_api_ignores_gh_blockcode_extension + text = "```ruby\nx = 'foo'\n```" + html = RedcarpetCompat.new(text, :fenced_code, :gh_blockcode).to_html +- html_equal "
x = 'foo'\n
", html ++ html_equal "
x = 'foo'\n
\n", html + end + + def test_compat_api_knows_no_intraemphasis_extension + html = RedcarpetCompat.new("This is_just_a test", :no_intraemphasis).to_html +- html_equal "

This is_just_a test

", html ++ html_equal "

This is_just_a test

\n", html + end + + def test_translate_outdated_extensions + # these extensions are no longer used + exts = [:gh_blockcode, :no_tables, :smart, :strict] + html = RedcarpetCompat.new('"TEST"', *exts).to_html +- html_equal "

"TEST"

", html ++ html_equal "

"TEST"

\n", html + end + end diff --git a/rubygem-redcarpet.spec b/rubygem-redcarpet.spec index 908e6d7..8e4ac32 100644 --- a/rubygem-redcarpet.spec +++ b/rubygem-redcarpet.spec @@ -1,17 +1,16 @@ %global gem_name redcarpet -%global rubyabi 1.9.1 -%global gem_extinstdir %{gem_extdir}/lib +%global gem_extinstdir %{gem_extdir_mri}/lib Summary: A fast, safe and extensible Markdown to (X)HTML parser Name: rubygem-%{gem_name} Version: 2.1.1 -Release: 6%{?dist} +Release: 7%{?dist} Group: Development/Languages License: ISC URL: http://github.com/tanoku/redcarpet Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem -Requires: ruby(abi) = %{rubyabi} - +Patch0: rubygem-redcarpet-libxml2-2.8-fix.patch +Requires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby-devel BuildRequires: rubygem(minitest) @@ -37,24 +36,14 @@ BuildArch: noarch Documentation for %{name} %prep +%setup -q -c -T +%gem_install -n %{SOURCE0} -%build -export CONFIGURE_ARGS="--with-cflags='%{optflags}'" - -# gem install compiles any C extensions and installs into a directory -# We set that to be a local directory so that we can move it into the -# buildroot in the install section -gem install -V \ - --local \ - --install-dir ./%{gem_dir} \ - --bindir ./%{_bindir} \ - --force \ - --rdoc \ - %{SOURCE0} +pushd .%{gem_instdir} +%patch0 -p1 +popd -# Fix permissions -chmod 644 ./%{gem_dir}/gems/%{gem_name}-%{version}/COPYING -chmod 644 ./%{gem_dir}/gems/%{gem_name}-%{version}/ext/redcarpet/* +%build %install mkdir -p %{buildroot}%{gem_dir} @@ -67,9 +56,8 @@ chmod 755 %{buildroot}%{_bindir}/redcarpet mkdir -p %{buildroot}%{gem_extinstdir} mv %{buildroot}%{gem_instdir}/lib/redcarpet.so %{buildroot}%{gem_extinstdir} -# Clean up ext artifacts -rm %{buildroot}%{gem_instdir}/ext/redcarpet/*.o -rm %{buildroot}%{gem_instdir}/ext/redcarpet/*.so +# Fix permissions +chmod 644 ./%{gem_instdir}/COPYING %check pushd .%{gem_instdir} @@ -80,7 +68,7 @@ popd %dir %{gem_instdir} %{_bindir}/redcarpet %{gem_instdir}/bin -%{gem_instdir}/ext +%exclude %{gem_instdir}/ext %{gem_libdir} %{gem_extinstdir} %{gem_cache} @@ -96,6 +84,9 @@ popd %changelog +* Thu Mar 14 2013 Josef Stribny - 2.1.1-7 +- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0 + * Thu Feb 14 2013 Fedora Release Engineering - 2.1.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild