Compare commits
13 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7dc4c9d9ee | ||
|
|
3de8728619 | ||
|
|
86e9d39281 | ||
|
|
402553e6c1 | ||
|
|
36b0982caf | ||
|
|
d01a35c8a6 | ||
|
|
1f702101b0 | ||
|
|
08f9fd1dea | ||
|
|
7cc1b8f1f1 | ||
|
|
c9266154eb | ||
|
|
7175355138 | ||
|
|
86924bd67f | ||
|
|
42b0d1c0c4 |
8 changed files with 3 additions and 334 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +0,0 @@
|
|||
/asciidoctor-0.1.3.gem
|
||||
197
README.adoc
197
README.adoc
|
|
@ -1,197 +0,0 @@
|
|||
= rubygem-asciidoctor: Asciidoctor RPM package spec
|
||||
Dan Allen
|
||||
:idprefix:
|
||||
:gem_title: Asciidoctor
|
||||
:gem_name: asciidoctor
|
||||
:gem_version: 0.1.3
|
||||
: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] RubyGem.
|
||||
The package is named +rubygem-asciidoctor+.
|
||||
|
||||
While this RPM spec was developed specifically for Fedora 17 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 @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-0.1.3.gem http://rubygems.org/gems/asciidoctor-0.1.3.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.
|
||||
|
||||
=== 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 localinstall $HOME/rpmbuild/RPMS/noarch/rubygem-asciidoctor-0.1.3.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:
|
||||
|
||||
sudo yum install rubygem-asciidoctor --enablerepo=updates-testing
|
||||
|
||||
This command will download and install the asciidoctor package.
|
||||
|
||||
=== Test the Asciidoctor package: +rubygem-asciidoctor+
|
||||
|
||||
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:
|
||||
|
||||
require 'asciidoctor'
|
||||
content = "= My First Document\n\nRender me some **HTML**!"
|
||||
puts Asciidoctor.render(content, :header_footer => true, :compact => 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.
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="generator" content="Asciidoctor 0.1.3">
|
||||
<title>My First Document</title>
|
||||
</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-03-12 10:43:15 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.
|
||||
|
||||
Now let's test using the Asciidoctor executable.
|
||||
|
||||
. On your computer, create a new file and name it +test.ad+
|
||||
. 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 +test.ad+ and type the following command to run it through the Asciidoctor processor:
|
||||
|
||||
asciidoctor test.ad
|
||||
+
|
||||
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.
|
||||
|
||||
sudo yum install 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].
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# disables use of pending statement in the test suite The required gem,
|
||||
# pending, is not packaged in Fedora and since the statement is merely a task
|
||||
# note, it's safe to disable it's usage for the purpose of packaging.
|
||||
diff --git a/test/test_helper.rb b/test/test_helper.rb
|
||||
index 3b27218..964ff59 100644
|
||||
--- a/test/test_helper.rb
|
||||
+++ b/test/test_helper.rb
|
||||
@@ -5,7 +5,7 @@ require 'test/unit'
|
||||
require "#{File.expand_path(File.dirname(__FILE__))}/../lib/asciidoctor.rb"
|
||||
|
||||
require 'nokogiri'
|
||||
-require 'pending'
|
||||
+#require 'pending'
|
||||
|
||||
ENV['SUPPRESS_DEBUG'] ||= 'true'
|
||||
|
||||
3
dead.package
Normal file
3
dead.package
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
2016-11-20: Retired because it depends on rubygem-abstract, which was
|
||||
retired, because it was orphaned for more than six weeks.
|
||||
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
%global gem_name asciidoctor
|
||||
%global mandir %{_mandir}/man1
|
||||
|
||||
Summary: AsciiDoc implementation in Ruby
|
||||
Name: rubygem-%{gem_name}
|
||||
Version: 0.1.3
|
||||
Release: 1%{?dist}
|
||||
Group: Development/Languages
|
||||
License: MIT
|
||||
URL: http://github.com/asciidoctor/asciidoctor
|
||||
Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
|
||||
# Patch0: disables use of pending statement in the test suite The required gem,
|
||||
# pending, is not packaged in Fedora and since the statement is merely a task
|
||||
# note, it's safe to disable it's usage for the purpose of packaging.
|
||||
Patch0: asciidoctor-disable-use-of-pending.patch
|
||||
%if 0%{?rhel} > 6 || 0%{?fedora} > 18
|
||||
Requires: ruby(release)
|
||||
BuildRequires: ruby(release)
|
||||
%else
|
||||
Requires: ruby(abi) = 1.9.1
|
||||
BuildRequires: ruby(abi) = 1.9.1
|
||||
%endif
|
||||
Requires: ruby(rubygems)
|
||||
BuildRequires: rubygems-devel
|
||||
BuildRequires: ruby(rubygems)
|
||||
BuildRequires: rubygem(coderay)
|
||||
BuildRequires: rubygem(erubis)
|
||||
BuildRequires: rubygem(minitest)
|
||||
BuildRequires: rubygem(nokogiri)
|
||||
BuildArch: noarch
|
||||
Provides: rubygem(%{gem_name}) = %{version}
|
||||
|
||||
%description
|
||||
An open source text processor and publishing toolchain written in Ruby for
|
||||
converting AsciiDoc markup into HTML 5, DocBook 4.5 and custom formats. Export
|
||||
to custom formats is performed by running the nodes of the parsed tree through
|
||||
a collection of Tilt-supported templates.
|
||||
|
||||
%package doc
|
||||
Summary: Documentation for %{name}
|
||||
Group: Documentation
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
BuildArch: noarch
|
||||
|
||||
%description doc
|
||||
Documentation for %{name}
|
||||
|
||||
%prep
|
||||
gem unpack -V %{SOURCE0}
|
||||
%setup -q -D -T -n %{gem_name}-%{version}
|
||||
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
|
||||
%patch0 -p1
|
||||
|
||||
%build
|
||||
gem build %{gem_name}.gemspec
|
||||
%gem_install
|
||||
|
||||
%check
|
||||
LANG=en_US.utf8 testrb -Ilib test/*_test.rb
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}%{gem_dir}
|
||||
cp -pa .%{gem_dir}/* \
|
||||
%{buildroot}%{gem_dir}/
|
||||
|
||||
mkdir -p %{buildroot}%{_bindir}
|
||||
cp -pa .%{_bindir}/* \
|
||||
%{buildroot}%{_bindir}/
|
||||
|
||||
mkdir -p %{buildroot}%{mandir}
|
||||
cp -pa .%{gem_instdir}/man/*.1 \
|
||||
%{buildroot}%{mandir}/
|
||||
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/%{gem_name}
|
||||
cp -pa .%{gem_instdir}/compat/* \
|
||||
%{buildroot}%{_sysconfdir}/%{gem_name}/
|
||||
|
||||
%files
|
||||
%dir %{gem_instdir}
|
||||
%exclude %{gem_cache}
|
||||
%exclude %{gem_instdir}/%{gem_name}.gemspec
|
||||
%exclude %{gem_instdir}/Gemfile
|
||||
%exclude %{gem_instdir}/Guardfile
|
||||
%exclude %{gem_instdir}/Rakefile
|
||||
%exclude %{gem_instdir}/compat
|
||||
%exclude %{gem_instdir}/man
|
||||
%exclude %{gem_instdir}/test
|
||||
%{gem_instdir}/LICENSE
|
||||
%{gem_instdir}/README.*
|
||||
%{_bindir}/*
|
||||
%{gem_instdir}/bin
|
||||
%{gem_libdir}
|
||||
%{mandir}/*
|
||||
%{_sysconfdir}/%{gem_name}/*
|
||||
%{gem_spec}
|
||||
|
||||
%files doc
|
||||
%doc %{gem_docdir}
|
||||
|
||||
%changelog
|
||||
* Sat Jun 08 2013 Dan Allen <dan.j.allen@gmail.com> - 0.1.3-1
|
||||
- Update to Asciidoctor 0.1.3
|
||||
* Fri Mar 01 2013 Dan Allen <dan.j.allen@gmail.com> - 0.1.1-1
|
||||
- Initial package
|
||||
1
sources
1
sources
|
|
@ -1 +0,0 @@
|
|||
e5a9d0015ea477589d5da1765df0d834 asciidoctor-0.1.1.gem
|
||||
Binary file not shown.
15
test-install
15
test-install
|
|
@ -1,15 +0,0 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
# A sanity check to ensure that gem is functional after installing the package.
|
||||
|
||||
require 'asciidoctor'
|
||||
|
||||
source = <<EOS
|
||||
= Asciidoctor
|
||||
Author Name
|
||||
|
||||
http://asciidoctor.org[Asciidoctor] is an _open source_ implementation of
|
||||
http://asciidoc.org[AsciiDoc] in [red]*Ruby*.
|
||||
EOS
|
||||
|
||||
puts Asciidoctor.render(source, :backend => :html5, :header_footer => true, :compact => true, :safe => :safe, :attributes => 'linkcss!')
|
||||
Loading…
Add table
Add a link
Reference in a new issue