# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2021"
rust-version = "1.74"
name = "srunc"
version = "0.4.3"
authors = ["Yihang Wang <wangyihanger@gmail.com>"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Generic, auto-configuring srun (深澜) captive-portal auth client (CLI + library). Static musl binary suitable for OpenWrt routers; library API for embedding in Rust apps."
homepage = "https://github.com/WangYihang/srunc"
readme = "README.md"
keywords = [
    "srun",
    "captive-portal",
    "campus-network",
    "auth",
    "cli",
]
categories = [
    "command-line-utilities",
    "network-programming",
    "authentication",
]
license = "MIT"
repository = "https://github.com/WangYihang/srunc"

[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-suffix }"
bin-dir = "{ name }-{ target }/{ bin }{ binary-ext }"
pkg-fmt = "tgz"

[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-fmt = "zip"

[package.metadata.deb]
name = "srunc"
maintainer = "Yihang Wang <wangyihanger@gmail.com>"
copyright = "2026, Yihang Wang <wangyihanger@gmail.com>"
license-file = [
    "LICENSE",
    "0",
]
extended-description = "Generic, auto-configuring srun (深澜) captive-portal auth client. Host and ac_id are auto-discovered from the captive redirect — most setups only need username + password."
section = "net"
priority = "optional"
depends = "$auto"
assets = [
    [
    "target/release/srunc",
    "usr/bin/",
    "755",
],
    [
    "docs/config.example.toml",
    "usr/share/doc/srunc/",
    "644",
],
    [
    "docs/systemd/system/srunc.service",
    "lib/systemd/system/",
    "644",
],
    [
    "docs/systemd/system/srunc@.service",
    "lib/systemd/system/",
    "644",
],
    [
    "docs/systemd/user/srunc.service",
    "usr/lib/systemd/user/",
    "644",
],
    [
    "README.md",
    "usr/share/doc/srunc/README.md",
    "644",
],
]

[features]
cli = [
    "dep:clap",
    "dep:anstream",
    "dep:anstyle",
    "dep:env_logger",
    "dep:rpassword",
    "dep:ctrlc",
    "dep:basic-toml",
    "dep:anyhow",
]
default = ["cli"]

[lib]
name = "srunc"
path = "src/lib.rs"

[[bin]]
name = "srunc"
path = "src/main.rs"
required-features = ["cli"]

[[test]]
name = "cli"
path = "tests/cli.rs"

[[test]]
name = "portal_mock"
path = "tests/portal_mock.rs"

[[test]]
name = "protocol_vectors"
path = "tests/protocol_vectors.rs"

[dependencies.anstream]
version = "0.6"
optional = true

[dependencies.anstyle]
version = "1"
optional = true

[dependencies.anyhow]
version = "1"
optional = true

[dependencies.basic-toml]
version = "0.1"
optional = true

[dependencies.clap]
version = "4"
features = [
    "std",
    "derive",
    "help",
    "usage",
    "color",
    "suggestions",
    "error-context",
    "wrap_help",
]
optional = true
default-features = false

[dependencies.ctrlc]
version = "3"
features = ["termination"]
optional = true

[dependencies.env_logger]
version = "0.11"
features = ["auto-color"]
optional = true
default-features = false

[dependencies.log]
version = "0.4"

[dependencies.md-5]
version = "0.10"
default-features = false

[dependencies.rpassword]
version = "7"
optional = true

[dependencies.serde]
version = "1"
features = ["derive"]

[dependencies.serde_json]
version = "1"

[dependencies.sha1]
version = "0.10"
default-features = false

[dependencies.thiserror]
version = "2"

[dependencies.ureq]
version = "2"

[dev-dependencies.assert_cmd]
version = "2"

[dev-dependencies.httpmock]
version = "0.8"

[dev-dependencies.predicates]
version = "3"

[dev-dependencies.tempfile]
version = "3"

[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = true
