summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/pcsclite/package.py
blob: d07814a6d0bce6c726055a7e4f9c831b66a60dc3 (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
49
50
51
52
# Copyright 2013-2023 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.package import *


class Pcsclite(AutotoolsPackage):
    """PCSC lite project

    Middleware to access a smart card using SCard API (PC/SC)."""

    homepage = "https://pcsclite.apdu.fr"
    url = "https://pcsclite.apdu.fr/files/pcsc-lite-1.9.8.tar.bz2"
    git = "https://salsa.debian.org/rousseau/PCSC.git"

    maintainers("cessenat")

    license("GPL-3.0-or-later")

    version("master", branch="master")
    version("1.9.8", sha256="502d80c557ecbee285eb99fe8703eeb667bcfe067577467b50efe3420d1b2289")

    # no libudev/systemd package currently in spack
    variant("libudev", default=False, description="Build with libudev")

    depends_on("flex", type="build")
    depends_on("libusb")

    depends_on("autoconf", type="build")
    depends_on("autoconf-archive", type="build")
    depends_on("automake", type="build")
    depends_on("libtool", type="build")
    depends_on("m4", type="build")
    depends_on("pkgconfig", type="build")

    def autoreconf(self, spec, prefix):
        pass

    @when("@master")
    def autoreconf(self, spec, prefix):
        bootstrap = Executable("./bootstrap")
        bootstrap()

    def configure_args(self):
        args = []
        # no libudev/systemd package currently in spack
        args.append("--disable-libsystemd")
        args.extend(self.enable_or_disable("libudev"))
        args.append("--with-systemdsystemunitdir=no")
        return args