summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/bib2xhtml/package.py
blob: 0a50a18004a9ee4bd1253ade1f39de3721e65cd8 (plain) (blame)
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
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack import *
from glob import glob


class Bib2xhtml(Package):
    """bib2xhtml is a program that converts BibTeX files into HTML."""
    homepage = "http://www.spinellis.gr/sw/textproc/bib2xhtml/"
    url = 'http://www.spinellis.gr/sw/textproc/bib2xhtml/bib2xhtml-v3.0-15-gf506.tar.gz'

    version('3.0-15-gf506', 'a26ba02fe0053bbbf2277bdf0acf8645')

    def install(self, spec, prefix):
        # Add the bst include files to the install directory
        bst_include = join_path(prefix.share, 'bib2xhtml')
        mkdirp(bst_include)
        for bstfile in glob('html-*bst'):
            install(bstfile, bst_include)

        # Install the script and point it at the user's favorite perl
        # and the bst include directory.
        mkdirp(prefix.bin)
        install('bib2xhtml', prefix.bin)
        filter_file(r'#!/usr/bin/perl',
                    '#!/usr/bin/env BSTINPUTS=%s perl' % bst_include,
                    join_path(prefix.bin, 'bib2xhtml'))