Google Site SearchFN Site Search FN Blog Login FN Blog Login
Site Navigation:
 
 

How to build HTMLDOC RPM package for Fedora Core

by Thomas Chung on Feb 24, 2005 (Updated 2006-06-18)

UPDATE 2006-06-18
See Create RPM for Fedora Core 5 by Sean Carlos

UPDATE 2005-10-24
Here is htmldoc 1.8.24 rpm for FC4


HTMLDOC converts Hyper-Text Markup Language ("HTML") input files into indexed HTML, Adobe(R) PostScript(R), or Adobe Portable Document Format ("PDF") files.

HTMLDOC supports most HTML 3.2 elements, some HTML 4.0 elements, and can generate title and table of contents pages. It does not currently support stylesheets. HTMLDOC can be used as a standalone application, in a batch document processing environment, or as a web-based report generation application. No restrictions are placed upon the output produced by HTMLDOC.

HTMLDOC is available both as open source software under the terms of the GNU General Public License and as commercial software under the terms of a traditional commercial End-User License Agreement. See this FAQ page for an additional Licensing information.

In this article, I'll be using HTMLDOC version 1.8.24 source code on Fedora Core 3 to build binary RPM package as an example but you will also find pre-built binary RPM packages and source RPM packages for FC1, FC2 ad FC3 at the bottom this article.

To build the RPM package, you'll need:
Tarball - htmldoc-1.8.24-source.tar.gz
Spec File - htmldoc.spec

Let's begin:
(Make sure you have created rpmbuild directory in your own home.)

[tchung@tchung-fc3 1.8.24]$ ls *.gz *.spec
htmldoc-1.8.24-source.tar.gz  htmldoc.spec
[tchung@tchung-fc3 1.8.24]$ cp *.gz ~/rpmbuild/SOURCES/
[tchung@tchung-fc3 1.8.24]$ cp *.spec ~/rpmbuild/SPECS/
[tchung@tchung-fc3 1.8.24]$ rpmbuild -ba ~/rpmbuild/SPECS/htmldoc.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.12431
+ umask 022
+ cd /home/tchung/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ rm -rf /var/tmp/htmldoc-1.8.24-buildroot
+ cd /home/tchung/rpmbuild/BUILD
+ rm -rf htmldoc-1.8.24
+ /usr/bin/gzip -dc /home/tchung/rpmbuild/SOURCES/htmldoc-1.8.24-source.tar.gz
+ tar -xf -

..omitted..

Wrote: /home/tchung/rpmbuild/SRPMS/htmldoc-1.8.24-0.FC3.src.rpm
Wrote: /home/tchung/rpmbuild/RPMS/i386/htmldoc-1.8.24-0.FC3.i386.rpm
Wrote: /home/tchung/rpmbuild/RPMS/i386/htmldoc-debuginfo-1.8.24-0.FC3.i386.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.83310
+ umask 022
+ cd /home/tchung/rpmbuild/BUILD
+ cd htmldoc-1.8.24
+ rm -rf /var/tmp/htmldoc-1.8.24-buildroot
+ exit 0
[tchung@tchung-fc3 1.8.24]$

To install the binary RPM package,

[tchung@tchung-fc3 1.8.24]$ cp /home/tchung/rpmbuild/RPMS/i386/*.rpm .
[tchung@tchung-fc3 1.8.24]$ sudo rpm -Uvh htmldoc-1.8.24-0.FC3.i386.rpm
Password:
Preparing...                ########################################### [100%]
   1:htmldoc                ########################################### [100%]
[tchung@tchung-fc3 1.8.24]$

Now, let's convert an HTML file called "help.html" which is included in the binary RPM package to a PDF file.

[tchung@tchung-fc3 1.8.24]$ rpm -ql htmldoc | grep help
/usr/share/doc/htmldoc-1.8.24/doc/help.html
/usr/share/doc/htmldoc/help.html
[tchung@tchung-fc3 1.8.24]$ cp /usr/share/doc/htmldoc/help.html .
[tchung@tchung-fc3 1.8.24]$ htmldoc -f help.pdf help.html
PAGES: 20
BYTES: 383079
[tchung@tchung-fc3 1.8.24]$ ls -l help.pdf
-rw-rw-r--  1 tchung tchung 383079 Feb 22 14:14 help.pdf
[tchung@tchung-fc3 1.8.24]$
Here is the original help.html and newly created help.pdf using HTMLDOC.

Here are the binary RPM packages for HTMLDOC version 1.8.24 for FC1, FC2 and FC3.

For my last note, I've been meaning to offer our readers a choice of HTML or PDF for our FedoraNEWS.ORG articles. Now you can have both format!

# htmldoc -f fedoranews-htmldoc.pdf index.shtml --webpage
Enjoy our first article in pdf! -