Skip to content

Instantly share code, notes, and snippets.

@pvalena
Created November 30, 2021 16:48
Show Gist options
  • Save pvalena/a19eef009f12c3bdf16b6342b1788d2a to your computer and use it in GitHub Desktop.
Save pvalena/a19eef009f12c3bdf16b6342b1788d2a to your computer and use it in GitHub Desktop.
--- rubygem-haml/.generated.spec 2021-11-30 17:45:53.455058120 +0100
+++ rubygem-haml/rubygem-haml.spec 2021-11-30 17:34:40.004690556 +0100
@@ -1,34 +1,33 @@
-Downloaded haml-5.2.2
-# Generated from haml-5.2.2.gem by gem2rpm -*- rpm-spec -*-
+# Generated from haml-2.2.14.gem by gem2rpm -*- rpm-spec -*-
%global gem_name haml
Name: rubygem-%{gem_name}
Version: 5.2.2
Release: 1%{?dist}
Summary: An elegant, structured (X)HTML/XML templating engine
-License: MIT
+License: MIT and WTFPL
URL: http://haml.info/
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
+# git clone --no-checkout https://github.com/haml/haml.git
+# git -C haml archive -v -o haml-5.2.2-tests.txz v5.2.2 test/
+Source1: %{gem_name}-%{version}-tests.txz
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
-BuildRequires: ruby >= 2.0.0
-# BuildRequires: rubygem(rails) >= 4.0.0
-# BuildRequires: rubygem(rbench)
-# BuildRequires: rubygem(minitest) >= 4.0
-# BuildRequires: rubygem(nokogiri)
-# BuildRequires: rubygem(simplecov)
+BuildRequires: ruby
+BuildRequires: rubygem(activemodel)
+BuildRequires: rubygem(minitest)
+BuildRequires: rubygem(railties)
+BuildRequires: rubygem(temple)
+BuildRequires: rubygem(tilt)
BuildArch: noarch
%description
Haml (HTML Abstraction Markup Language) is a layer on top of HTML or XML
-that's
-designed to express the structure of documents in a non-repetitive, elegant,
-and
-easy way by using indentation rather than closing tags and allowing Ruby to be
-embedded with ease. It was originally envisioned as a plugin for Ruby on
-Rails,
-but it can function as a stand-alone templating engine.
-
+that's designed to express the structure documents in a non-repetitive,
+elegant, easy way by using indentation rather than closing
+tags and allowing Ruby to be embedded with ease.
+It was originally envisioned as a plugin for Ruby on Rails, but it can
+function as a stand-alone templating engine.
%package doc
Summary: Documentation for %{name}
@@ -39,14 +38,11 @@
Documentation for %{name}.
%prep
-%setup -q -n %{gem_name}-%{version}
+%setup -q -n %{gem_name}-%{version} -b 1
%build
-# Create the gem as gem install only works on a gem file
gem build ../%{gem_name}-%{version}.gemspec
-# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
-# by default, so that we can move it into the buildroot in %%install
%gem_install
%install
@@ -63,35 +59,193 @@
%check
pushd .%{gem_instdir}
-# ruby -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
+# Link test suite into the place.
+ln -s %{_builddir}/test .
+
+# Get rid of Bundler.
+sed -i '/[bB]undler/ s/^/#/' test/test_helper.rb
+
+# We don't care about code coverage
+sed -i '/[Ss]imple[Cc]ov/ s/^/#/g' test/test_helper.rb
+
+# Disable test_annotated_template_names that's not working (removed in next release)
+mv test/template_test.rb{,.disable}
+
+# options_test.rb must be executed in isolation in order to prevent load
+# order issues.
+# https://github.com/haml/haml/issues/943
+ruby -Ilib:test -e '(Dir.glob("./test/*_test.rb") - %w[./test/options_test.rb]).each {|f| require f }'
+ruby -Ilib:test -e 'require "./test/options_test.rb"'
popd
%files
%dir %{gem_instdir}
%{_bindir}/haml
-%{gem_instdir}/.github
-%exclude %{gem_instdir}/.gitignore
-%{gem_instdir}/.gitmodules
-%exclude %{gem_instdir}/.yardopts
-%{gem_instdir}/FAQ.md
+%exclude %{gem_instdir}/.*
%license %{gem_instdir}/MIT-LICENSE
-%{gem_instdir}/REFERENCE.md
-%{gem_instdir}/TODO
-%{gem_instdir}/benchmark.rb
%{gem_instdir}/bin
%{gem_libdir}
-%{gem_instdir}/yard
+%exclude %{gem_libdir}/haml/.gitattributes
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/CHANGELOG.md
+%doc %{gem_instdir}/FAQ.md
%{gem_instdir}/Gemfile
%doc %{gem_instdir}/README.md
+%doc %{gem_instdir}/REFERENCE.md
%{gem_instdir}/Rakefile
+%doc %{gem_instdir}/TODO
+%{gem_instdir}/benchmark.rb
%{gem_instdir}/haml.gemspec
+%{gem_instdir}/yard
+%exclude %{gem_instdir}/yard/default/.gitignore
%changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment