summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/libmicrohttpd/package.py
blob: 152afe0e6f9d499c6fd26cf7e7105f21d3791827 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Copyright 2013-2021 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 *


class Libmicrohttpd(AutotoolsPackage):
    """GNU libmicrohttpd is a small C library that is supposed to make
       it easy to run an HTTP server as part of another application.
    """

    homepage = "https://www.gnu.org/software/libmicrohttpd/"
    url      = "https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.71.tar.gz"

    maintainers = ['hainest']

    version('0.9.71', 'e8f445e85faf727b89e9f9590daea4473ae00ead38b237cf1eda55172b89b182')
    version('0.9.70', '90d0a3d396f96f9bc41eb0f7e8187796049285fabef82604acd4879590977307')

    variant('https',
            default=False,
            description="HTTPS support with GnuTLS")

    depends_on('gettext')
    depends_on('gnutls', when='+https')
    depends_on('libgcrypt', when='+https')

    def configure_args(self):
        options = [
            '--enable-static=no',   # don't build static libs
            '--enable-shared=yes',  # always build shared libs
            '--with-pic',           # always build PIC libs
            '--disable-rpath',      # let spack handle the RPATH
            '--disable-doc',        # don't build the docs
            '--disable-examples',   # don't build the examples
            '--disable-curl'		# disable cURL-based testcases
        ]

        if self.spec.satisfies('+https'):
            options.append('--enable-https')
            prefix = self.spec['gnutls'].prefix
            options.append('--with-gnutls={0}'.format(prefix))
            prefix = self.spec['libgcrypt'].prefix
            options.append('--with-libgcrypt-prefix={0}'.format(prefix))

        return options