[package]
name = "nss_kanidm"
description = "Kanidm NSS module"

version = { workspace = true }
authors = { workspace = true }
rust-version = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
homepage = { workspace = true }
repository = { workspace = true }

[lib]
name = "nss_kanidm"
crate-type = ["cdylib"]
path = "src/lib.rs"

[dependencies]
kanidm_unix_common = { workspace = true }

[target.'cfg(not(target_family = "windows"))'.dependencies]
libnss = { workspace = true }
libc = { workspace = true }
lazy_static = { workspace = true }

[target."cfg(target_os = \"freebsd\")".build-dependencies]
cc = "^1.2.10"

## Debian packaging
# The base metadata does **not** work to build a functioning package!
# A target specific variant must be used to get the right multiarch path.
[package.metadata.deb]
name = "libnss-kanidm"
maintainer = "James Hodgkinson <james@terminaloutcomes.com>"
depends = ""
section = "network"
priority = "optional"
assets = [
    # Empty on purpose
]

[package.metadata.deb.variants.aarch64-unknown-linux-gnu]
merge-assets.append = [
    [
        "target/release/libnss_kanidm.so",
        "usr/lib/aarch64-linux-gnu/libnss_kanidm.so.2",
        "644",
    ],
]

[package.metadata.deb.variants.x86_64-unknown-linux-gnu]
merge-assets.append = [
    [
        "target/release/libnss_kanidm.so",
        "usr/lib/x86_64-linux-gnu/libnss_kanidm.so.2",
        "644",
    ],
]


[package.metadata.cargo-machete]
ignored = ["cc", "lazy_static"]
