Contents

Installing pandoc on Fedora 10

Contents

I’ve been using pandoc to convert stuff - mostly Restructured Text - to Markdown as part of a wiki migration. The pandoc site has instructions for installing on a bunch of operating systems but none RHEL/CentOS/Fedora- like. This is a quick set of instructions for Fedora that should work for similar distros. First, install the Haskell compiler and Cabal (yet another pear/cpan/rubygems like plug-in loader/manager):

$ sudo yum install ghc cabal-install

Update the Cabal data store and install the plug-ins pandoc requires, utf8-string and zip-archive.

$ sudo cabal update
$ sudo cabal install zip-archive utf8-string

Now you can either use Cabal to install pandoc itself:

$ sudo cabal install pandoc

Or you can download the source and compile it yourself.

$ cd /tmp
$ wget http://pandoc.googlecode.com/files/pandoc-1.2.tar.gz
$ tar -zxf pandoc-1.2.tar.gz
$ cd pandoc-1.2

Now you need to edit the pandoc.cabal file and remove:

Executable hsmarkdown
Hs-Source-Dirs: src
Main-Is: hsmarkdown.hs
Ghc-Options: -Wall -threaded
Ghc-Prof-Options: -auto-all
Extensions: CPP, TemplateHaskell
if flag(wrappers)
  Buildable: True
else
  Buildable: False

From the bottom of the pandoc.cabal file. Next, run make.

$ CABALOPTS=--user make

And finally, if the make works, install the tool:

$ sudo make install