rubygem-kramdown/rubygem-kramdown.spec

92 lines
2.7 KiB
RPMSpec
Raw Normal View History

2020-03-13 20:58:58 +08:00
%global gem_name kramdown
2020-12-18 18:05:55 +08:00
Name: rubygem-%{gem_name}
Version: 2.1.0
Release: 1
Summary: A fast pure Ruby yet-another-markdown-parser
License: MIT
URL: http://kramdown.rubyforge.org
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
BuildRequires: ruby(release) rubygems-devel rubygem(minitest) >= 5 rubygem(rouge)
BuildRequires: rubygem(test-unit) tidy tex tex(acronym.sty) tex(amssymb.sty)
BuildRequires: tex(amsmath.sty) tex(amsthm.sty) tex(amsfonts.sty) tex(utf8x.def) tex-ec
Requires: ruby(release) ruby(rubygems)
BuildArch: noarch
Provides: rubygem(%{gem_name}) = %{version}-%{release}
2020-03-13 20:58:58 +08:00
%description
2020-12-18 18:05:55 +08:00
kramdown is yet-another-markdown-parser but fast, pure Ruby,
2020-03-13 20:58:58 +08:00
using a strict syntax definition and supporting several common extensions.
2020-12-18 18:05:55 +08:00
%package help
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
Provides: %{name}-doc = %{version}-%{release}
Obsoletes: %{name}-doc < %{version}-%{release}
BuildArch: noarch
2020-03-13 20:58:58 +08:00
2020-12-18 18:05:55 +08:00
%description help
Documentation for %{name}
2020-03-13 20:58:58 +08:00
%prep
gem unpack %{SOURCE0}
2020-12-18 18:05:55 +08:00
%autosetup -D -T -n kramdown-%{version}
2020-03-13 20:58:58 +08:00
gem spec %{SOURCE0} -l --ruby > kramdown.gemspec
%build
gem build kramdown.gemspec
%gem_install
%install
2020-12-18 18:05:55 +08:00
mkdir -p %{buildroot}%{gem_dir}
cp -pa .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
mkdir -p %{buildroot}%{_bindir}
cp -pa .%{_bindir}/* \
%{buildroot}%{_bindir}/
2020-03-13 20:58:58 +08:00
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
2020-12-18 18:05:55 +08:00
mkdir -p %{buildroot}%{_mandir}/man1
mv %{buildroot}%{gem_instdir}/man/man1/kramdown.1 \
%{buildroot}%{_mandir}/man1
pushd %{buildroot}%{gem_instdir}
rm -rf \
test/
2020-03-13 20:58:58 +08:00
%check
2020-12-18 18:05:55 +08:00
LANG=C.UTF-8
pushd .%{gem_instdir}
STRINGEX_STATUS="$(ruby -e "begin ; require 'stringex' ; puts 1 ; rescue LoadError ; puts 0 ; end")"
if [ $STRINGEX_STATUS == 0 ] ; then
sed -i test/testcases/block/04_header/with_auto_ids.options \
-e '\@transliterated_header_ids@s|true|false|'
sed -i \
test/testcases/block/04_header/with_auto_ids.* \
-e '\@[Tr]ransliterated@d'
fi
ruby -Ilib -e 'Dir.glob "./test/test_*.rb", &method(:require)'
popd
2020-03-13 20:58:58 +08:00
%files
2020-12-18 18:05:55 +08:00
%dir %{gem_instdir}
%license %{gem_instdir}/COPYING
%doc %{gem_instdir}/AUTHORS
%doc %{gem_instdir}/CONTRIBUTERS
%doc %{gem_instdir}/README.md
%doc %{gem_instdir}/VERSION
2020-03-13 20:58:58 +08:00
%{_bindir}/kramdown
%{gem_instdir}/bin
2020-12-18 18:05:55 +08:00
%{_mandir}/man1/kramdown.1*
2020-03-13 20:58:58 +08:00
%{gem_libdir}/
%{gem_instdir}/data/
2020-12-18 18:05:55 +08:00
%exclude %{gem_cache}
2020-03-13 20:58:58 +08:00
%{gem_spec}
%files help
2020-12-18 18:05:55 +08:00
%doc %{gem_docdir}
2020-03-13 20:58:58 +08:00
%changelog
2020-12-18 18:05:55 +08:00
* Tue Dec 15 2020 chengzihan <chengzihan2@huawei.com> - 2.1.0-1
- update to 2.1.0
2020-03-13 20:58:58 +08:00
* Thu Mar 12 2020 zhujunhao <zhujunhao5@huawei.com> - 1.17.0-3
- Package init
2020-12-18 18:05:55 +08:00