Compare commits

..

No commits in common. "rawhide" and "f25" have entirely different histories.

5 changed files with 259 additions and 159 deletions

11
.gitignore vendored
View file

@ -1,5 +1,6 @@
/*.rpm
/*.tar.gz
/.build*.log
/asciidoctor-*/
/results_*/
/asciidoctor-1.5.2.gem
/asciidoctor-1.5.3.gem
/asciidoctor-1.5.4.gem
/asciidoctor-1.5.5.gem
/asciidoctor-1.5.5-tests.tgz
/asciidoctor-1.5.6.1.gem

220
README.adoc Normal file
View file

@ -0,0 +1,220 @@
= rubygem-asciidoctor: Asciidoctor RPM package spec
Dan Allen
:idprefix:
:idseparator: -
:compat-mode!:
:gem_title: Asciidoctor
:gem_name: asciidoctor
:gem_version: 1.5.2
:gem_gem: {gem_name}-{gem_version}.gem
:gem_url: https://github.com/asciidoctor/asciidoctor
:rpm_name: rubygem-{gem_name}
:rpm_rpm: {rpm_name}-{gem_version}.rpm
:rpm_repo: git://github.com/asciidoctor/rubygem-asciidoctor-rpm.git
This repository is the official host of the build materials to create the Fedora RPM package for the https://github.com/asciidoctor/asciidoctor[Asciidoctor] Ruby Gem.
The RPM package is named `rubygem-asciidoctor`.
While this RPM spec was developed specifically for Fedora 18 and above, it may be useful for other RPM-based systems.
== Build the Asciidoctor RPM
If you want to build the RPM on your own machine, follow the instructions in this section.
If you want to test a pre-built package, skip to the next section on <<test-the-asciidoctor-rpm-and-report-feedback,testing the RPM>>.
=== Preparing your environment
You first need to install the packages necessary to build the RPM.
Begin by installing the `@fedora-packager` group (as root or using sudo):
yum install -y @fedora-packager wget
Next, clone this repository and switch to it:
git clone git://github.com/asciidoctor/rubygem-asciidoctor-rpm.git
cd rubygem-asciidoctor-rpm
Finally, install the packages that this build requires (as root or using sudo):
yum-builddep rubygem-asciidoctor.spec
Next, we need to put the package source and patches in place.
=== Preparing the sources
You can build RPMs as a non-privileged user, though you need to prepare the directories first.
Let's use the directory rpmbuild in our `$HOME` directory:
echo "%_topdir %(echo $HOME)/rpmbuild" > $HOME/.rpmmacros
You'll also need to create all the required folders:
mkdir -p $HOME/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
Next, grab the Asciidoctor gem (the sources) and put it into the `$HOME/rpmbuild/SOURCES` directory:
wget -O $HOME/rpmbuild/SOURCES/asciidoctor-1.5.2.gem http://rubygems.org/gems/asciidoctor-1.5.2.gem
Finally, copy the `.patch` files from this repository to the same directory:
cp *.patch $HOME/rpmbuild/SOURCES/
You're now ready to build the RPM.
=== Building the RPM
With everything in place, building the RPM is easy!
rpmbuild -ba rubygem-asciidoctor.spec
If all goes well, both the binary and source RPMs will emerge in the `$HOME/rpmbuild/RPMS/noarch` and `$HOME/rpmbuild/SRPMS` directories, respectively.
Alternatively, you can build directly from the SRPM.
wget -P srpms http://kojipkgs.fedoraproject.org/packages/rubygem-asciidoctor/1.5.2/1.fc21/src/rubygem-asciidoctor-1.5.2-1.fc21.src.rpm
rpmbuild --rebuild srpms/rubygem-asciidoctor-1.5.2-1.fc21.src.rpm
The SPRMs are stored with the builds in the http://koji.fedoraproject.org/koji/packageinfo?packageID=15660[koji build system].
=== Installing the RPM
There's nothing special about installing this RPM.
I recommend using `yum` because it will install any dependencies that the package requires (though you should already have them if you built the RPM).
yum install -y $HOME/rpmbuild/RPMS/noarch/rubygem-asciidoctor-1.5.2.rpm
Now, it's time to start using Asciidoctor!
== Test the Asciidoctor RPM and report feedback
Before the Asciidoctor package (`rubygem-asciidoctor`) can be included in the Fedora distribution, it must be tested by users and receive karma via the http://admin.fedoraproject.org/updates[Bohdi system].
One way to provide this feedback is to use the http://admin.fedoraproject.org/pkgdb/acls/name/fedora-easy-karma[fedora-easy-karma] tool.
=== Enable the updates-testing repository temporarily
In a terminal, type:
yum install -y rubygem-asciidoctor --enablerepo=updates-testing
This command will download and install the asciidoctor package.
=== Test the Asciidoctor API
First, let's test using Asciidoctor as a Ruby library.
. On your computer, create a new file and name it `asciidoctor-test.rb`
. Copy and paste the following code into the file:
+
[source,ruby]
----
require 'asciidoctor'
content = "= My First Document\n\nRender me some **HTML**!"
puts Asciidoctor.render content, :header_footer => true
----
. Save the file.
. In a terminal, navigate to the directory where you saved `asciidoctor-test.rb` and type the following command to execute the file with Ruby:
ruby asciidoctor-test.rb
+
You should see this output in your terminal.
+
[source,html]
----
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="Asciidoctor 1.5.2">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First Document</title>
<link rel="stylesheet" href="./asciidoctor.css">
</head>
<body class="article">
<div id="header">
<h1>My First Document</h1>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Render me some <strong>HTML</strong>!</p>
</div>
</div>
</div>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2013-09-22 17:35:41 MDT
</div>
</div>
</body>
</html>
----
. You can render the output as HTML using:
ruby asciidoctor-test.rb > asciidoctor-test.html
. Open your browser to see the result.
. Alternatively, if you're using Gnome, type:
gnome-open asciidoctor-test.html
+
A new tab should open in your current browser session.
=== Test the Asciidoctor CLI
Now let's test using the Asciidoctor executable (i.e., CLI).
. On your computer, create a new file and name it [path]_test.adoc_
. Copy and paste the following markup into the file:
+
----
= My Second Document
Your Name
AsciiDoc is _rockin'_ docs.
----
. Save the file
. In a terminal, navigate to the directory where you saved [path]_test.adoc_ and type the following command to run it through the Asciidoctor processor:
asciidoctor test.adoc
+
You shouldn't see any output in your terminal.
That's because it writes the output to the file `test.html`.
. Open your browser to see the result.
. Alternatively, if you're using Gnome, type:
gnome-open test.html
+
A new tab should open in your current browser session.
=== Provide feedback with fedora-easy-karma
. If you don't have fedora-easy-karma installed on your computer, type the following command in a terminal.
yum install -y fedora-easy-karma
. Once fedora-easy-karma is installed, run it in the terminal.
fedora-easy-karma --fas-username <yourFASaccount> *asciidoctor
+
--
To be on the safe side, include the flag for your FAS account when you start fedora-easy-karma.
Once fedora-easy-karma runs, you will not be able to switch accounts.
NOTE: It may take fedora-easy-karma several minutes to fetch the list of packages in updates-testing.
When fedora-easy-karma finds `rubygem-asciidoctor`, it will display a summary of the package and prompt you to give -1 (negative), 0 (neutral), or 1 (postive) karma to the package.
For more information about providing karma for packages and how to comment on packages, review the http://fedoraproject.org/wiki/QA:Update_feedback_guidelines[Fedora feedback guidelines].
--
. Enter your karma rating.
. Next, you will be asked to provide additional, detailed feedback.
Please comment whether the package worked as expected and you successfully used it, if you think you may have encountered an error, but aren't sure, or if you definitely encountered a bug.
. When prompted, enter your FAS password.
. W00t! The feedback process is complete.
. You can verify your feedback was recorded by visiting the https://admin.fedoraproject.org/updates[Bodhi updates page].

View file

@ -1,7 +0,0 @@
from Config import *
# the dictionary is a bit limited
addFilter("rubygem-asciidoctor\..*: W: spelling-error %description -l en_US toolchain")
# the asciidoctor-safe command is removed upstream for the next major release
addFilter("rubygem-asciidoctor\..*: W: no-manual-page-for-binary asciidoctor-safe")

View file

@ -2,42 +2,49 @@
%global mandir %{_mandir}/man1
%define pre %nil
%global gittag v%{version}%{pre}
Summary: A fast, open source AsciiDoc implementation in Ruby
Name: rubygem-%{gem_name}
Version: 2.0.26
Version: 1.5.6.1
Release: 1%{?dist}
Group: Development/Languages
License: MIT
URL: https://asciidoctor.org
Source0: https://github.com/asciidoctor/asciidoctor/archive/%{gittag}/%{gem_name}-%{version}%{pre}.tar.gz
URL: https://github.com/asciidoctor/asciidoctor
Source0: https://rubygems.org/gems/%{gem_name}-%{version}%{pre}.gem
# Parts of the test suite are missing from the package by accident.
# https://github.com/asciidoctor/asciidoctor/pull/1952
# git clone https://github.com/asciidoctor/asciidoctor.git && cd asciidoctor
# git checkout v1.5.5 && tar czvf asciidoctor-1.5.5-tests.tgz test/fixtures test/test_helper.rb
%if 0%{?el7}
Requires: ruby(release)
BuildRequires: ruby(release)
%endif
%if 0%{?el6}
Requires: ruby(rubygems)
Requires: ruby(abi) = 1.8
BuildRequires: ruby(abi) = 1.8
%endif
BuildRequires: rubygems-devel
BuildRequires: ruby(rubygems)
%if ! 0%{?rhel}
%if 0%{?el6} || 0%{?el7}
# Dependencies aren't available on EPEL
%else
BuildRequires: rubygem(coderay)
BuildRequires: rubygem(concurrent-ruby)
BuildRequires: rubygem(erubi)
BuildRequires: rubygem(erubis)
BuildRequires: rubygem(haml)
BuildRequires: rubygem(logger)
BuildRequires: rubygem(minitest)
BuildRequires: rubygem(nokogiri)
BuildRequires: rubygem(rouge)
BuildRequires: rubygem(slim)
BuildRequires: rubygem(tilt)
%endif
BuildArch: noarch
Provides: asciidoctor = %{version}
%if 0%{?el7}
%if 0%{?el6} || 0%{?el7}
Provides: rubygem(%{gem_name}) = %{version}
%endif
%if %{?pre:1}
%global gem_instdir() %{gem_dir}/gems/%{gem_name}-%{version}%{pre}
%global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version}%{pre}
%global gem_cache %{gem_dir}/cache/%{gem_name}-%{version}%{pre}.gem
%global gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}%{pre}.gemspec
%global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version}%{pre}
@ -52,6 +59,7 @@ collection of templates written in a template language supported by Tilt.
%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
@ -59,18 +67,13 @@ BuildArch: noarch
Documentation for %{name}
%prep
%autosetup -n %{gem_name}-%{version}%{pre} -p1
# Include tests in the gem, they're disabled by default
sed -i -e 's/#\(s\.test_files\)/\1/' %{gem_name}.gemspec
gem unpack -V %{SOURCE0}
%setup -q -D -T -n %{gem_name}-%{version}%{pre}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
# Fix shebang (avoid Requires: /usr/bin/env)
sed -i -e 's|#!/usr/bin/env ruby|#!/usr/bin/ruby|' bin/%{gem_name}
# ref: https://github.com/asciidoctor/asciidoctor/issues/4684
# the upstream plans to remove logger dep, but for now
# add logger dep explicitly for ruby3_5
%gemspec_add_dep -g logger -s ./%{gem_name}.gemspec
sed -i -e 's|#!/usr/bin/env ruby|#!/usr/bin/ruby|' \
bin/%{gem_name} bin/%{gem_name}-safe
%build
gem build %{gem_name}.gemspec
@ -79,13 +82,10 @@ gem build %{gem_name}.gemspec
%check
pushd .%{gem_instdir}
%if ! 0%{?rhel}
%if 0%{?el6} || 0%{?el7}
# Asciidoctor tests require Minitest 5, so we can't run them on EPEL
#
# disable tests which require open-uri-cached gem
sed -Ei "/test 'should cache remote (SVG|image) when allow-uri-read, cache-uri, and (inline option|data-uri) are set' do/a \\
skip('open-uri-cached gem is not avaiable on Fedora')" test/blocks_test.rb
LANG=C.UTF-8 ruby -I"lib:test" -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
%else
LANG=en_US.utf8 ruby -I"lib:test" test/*_test.rb
%endif
popd
@ -103,16 +103,19 @@ cp -a .%{gem_instdir}/man/*.1 \
%{buildroot}%{mandir}/
%files
%{!?_licensedir:%global license %%doc}
%dir %{gem_instdir}
%exclude %{gem_cache}
%exclude %{gem_instdir}/asciidoctor.gemspec
%exclude %{gem_instdir}/man
%exclude %{gem_instdir}/test
%exclude %{gem_instdir}/features
%license %{gem_instdir}/LICENSE
%exclude %{gem_instdir}/Gemfile
%exclude %{gem_instdir}/Rakefile
%license %{gem_instdir}/LICENSE.adoc
%doc %{gem_instdir}/CHANGELOG.adoc
%doc %{gem_instdir}/CONTRIBUTING.adoc
%doc %{gem_instdir}/README.*
%lang(de) %doc %{gem_instdir}/README-de.*
%lang(fr) %doc %{gem_instdir}/README-fr.*
%lang(ja) %doc %{gem_instdir}/README-jp.*
%lang(zh_CN) %doc %{gem_instdir}/README-zh_CN.*
@ -127,123 +130,6 @@ cp -a .%{gem_instdir}/man/*.1 \
%doc %{gem_docdir}
%changelog
* Mon Dec 15 2025 Dominik Mierzejewski <dominik@greysector.net> - 2.0.26-1
- updated to 2.0.26 (resolves rhbz#2265214)
- droped upstreamed patches
* Wed Nov 05 2025 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.0.20-11
- Add logger dep for ruby3_5
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.20-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Sat Jan 18 2025 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.20-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Thu Nov 14 2024 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.0.20-8
- Backport upstream PR to remove base64 dependency
- Backport upstream fix for ruby34 formatting change
* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.20-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.20-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.20-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Sep 29 2023 Mamoru TASAKA <mtasaka@fedoraproject.org> - 2.0.20-4
- Apply the upstream PR to support ruby 3.3 Logger
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.20-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Thu May 25 2023 Todd Zullinger <tmz@pobox.com> - 2.0.20-2
- improve ruby-2.5 compatibility (epel8)
* Thu May 18 2023 Todd Zullinger <tmz@pobox.com> - 2.0.20-1
- update to asciidoctor 2.0.20 (rhbz#2208089)
* Wed May 17 2023 Todd Zullinger <tmz@pobox.com> - 2.0.19-1
- update to asciidoctor 2.0.19 (rhbz#2208089)
* Mon Feb 20 2023 Todd Zullinger <tmz@pobox.com> - 2.0.18-3
- fixes for ruby-3.2.x and rouge-4.1.0 (rhbz#2171711)
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.18-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Oct 15 2022 Todd Zullinger <tmz@pobox.com> - 2.0.18-1
- update to asciidoctor 2.0.18 (rhbz#1989716)
* Tue Aug 02 2022 Todd Zullinger <tmz@pobox.com> - 2.0.17-1
- update to asciidoctor 2.0.17 (rhbz#2113688)
- disable tests which require open-uri-cached gem
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.15-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Fri Jan 21 2022 Neal Gompa <ngompa@fedoraproject.org> - 2.0.15-3
- Simplify RHEL conditionals
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.15-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Apr 27 2021 Todd Zullinger <tmz@pobox.com> - 2.0.15-1
- update to asciidoctor 2.0.15
Resolves: rhbz#1954314
- remove el6 conditionals
* Mon Apr 19 2021 Todd Zullinger <tmz@pobox.com> - 2.0.14-1
- Update to asciidoctor 2.0.14
Resolves: rhbz#1950947
* Sat Apr 10 2021 Todd Zullinger <tmz@pobox.com> - 2.0.13-1
- Update to asciidoctor 2.0.13
Resolves: rhbz#1948231
* Wed Jan 27 2021 Pavel Valena <pvalena@redhat.com> - 2.0.12-1
- Update to asciidoctor 2.0.12.
Resolves: rhbz#1893940
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.10-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Aug 19 2020 Vít Ondruch <vondruch@redhat.com> - 2.0.10-4
- Replace build time Erubis dependency by Erubi.
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.10-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.10-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sun Sep 22 2019 Todd Zullinger <tmz@pobox.com> - 2.0.10-1
- Update to Asciidoctor 2.0.10
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.8-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Tue Mar 19 2019 Todd Zullinger <tmz@pobox.com> - 1.5.8-1
- Update to Asciidoctor 1.5.8 (resolves CVE-2018-18385)
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.6.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sun Nov 18 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.5.6.1-5
- Use C.UTF-8 locale
See https://fedoraproject.org/wiki/Changes/Remove_glibc-langpacks-all_from_buildroot
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.6.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed May 23 2018 Vít Ondruch <vondruch@redhat.com> - 1.5.6.1-3
- Enable entire test suite.
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.6.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 24 2017 Fabio Alessandro Locati <fale@fedoraproject.org> - 1.5.6.1-1
- Update to Asciidoctor 1.5.6.1

View file

@ -1 +1 @@
SHA512 (asciidoctor-2.0.26.tar.gz) = 5e42079374fb1767dd0fd6767fd1e718d2c1c673e131ef1ae401c7b17e5b413168de3b25889eda35d2021ded55855b83b78f6110729e1a7765f757b37bbf5858
SHA512 (asciidoctor-1.5.6.1.gem) = cb23ab539b16b064e4a21575420abdaab34e20b7650a43b47df68ded1a424d1ab265c88102d4f3d3422bd30952fd93db7de254d61fdc253d17ffd93f1345bcdf