summaryrefslogtreecommitdiffstats
path: root/README.md
blob: 5fdffede6c3ae82def6b780787c046b471016c04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Pandoc static packages

This builds a statically-linked standalone pandoc and
pandoc-citeproc binary rpm packages on Enterprise Linux 5
which should work across current Linux platforms.

Note that since the binaries are completely statically-linked
(down to libc) they may need to be rebuilt periodically
for security updates to the linked libraries.

## Download

The binaries can either be:

a) downloaded from <http://petersen.fedorapeople.org/pandoc-static/>

or

b) if you prefer you can add the yum repo
<http://petersen.fedorapeople.org/pandoc-static/pandoc-static.repo>
to /etc/yum.repos.d/ and then installed with:

    yum install pandoc pandoc-citeproc

## Build requirements

- ghc-7.4 (pandoc-1.12 needs ghc-7.2 or later to build)
- haskell-platform
- cabal-dev
- hsb2hs (to embed data files)
- pcre-devel
- libffi.a

The current packages were built using ghc-7.4.2
and haskell-platform-2012.4.0.0 with cabal-dev-0.9.1
packages from the repo
<http://repos.fedorapeople.org/repos/petersen/ghc-7.4.2/>
and additionally hsb2hs-0.1 and a rebuilt libffi-3.0.5
(for libffi.a) from the
<http://petersen.fedorapeople.org/pandoc-static/> repo.

The build from a single spec file needs a network
connection for cabal to download the Haskell libraries dependencies
otherwise they need to be downloaded in advance using
{cabal fetch pandoc-citeproc}.

## Build steps

Here are the general steps to package the packages on RHEL or Fedora.

### RHEL 5, 6 or older Fedora

    $ pushd /etc/yum.repos.d
    $ su
    # wget http://repos.fedorapeople.org/repos/petersen/ghc-7.4.2/epel-ghc-7.4.2.repo
    # wget http://petersen.fedorapeople.org/pandoc-static/pandoc-static.repo
    # popd
    # yum install haskell-platform cabal-dev hsb2hs pcre-devel libffi-devel rpm-build
    # 
    $ cabal update    # skip if run recently
    $ rpm -iv http://petersen.fedorapeople.org/pandoc-static/SRPMS/pandoc-1.12.3.1-3.src.rpm
    $ rpmbuild -bb ~/rpmbuild/SPECS/pandoc.spec

### Fedora 19+

    $ rpm -iv http://petersen.fedorapeople.org/pandoc-static/SRPMS/hsb2hs-0.1-1.src.rpm
    $ cabal update    # skip if run recently
    $ rpmbuild -bb ~/rpmbuild/SPECS/hsb2hs.spec
    $ sudo rpm -ivh ~/rpmbuild/RPMS/$(arch)/hsb2hs-0*
    $ rpm -iv http://petersen.fedorapeople.org/pandoc-static/SRPMS/pandoc-1.12.3.1-3.src.rpm
    $ sudo yum install yum-utils      # if you don't have yum-builddep
    $ sudo yum-builddep ~/rpmbuild/SPECS/pandoc.spec
    $ rpmbuild -bb ~/rpmbuild/SPECS/pandoc.spec
    $ sudo rpm -Uvh ~/rpmbuild/RPMS/$(arch)/pandoc-*

or in the dir with pandoc.spec just run:

    $ cabal install hsb2hs
    $ # comment out "Requires: hsb2hs" in pandoc.spec
    $ sudo yum install cabal-rpm
    $ cblrpm rpm pandoc
    $ sudo rpm -Uvh ~/rpmbuild/RPMS/$(arch)/pandoc-*