[package]
name = "sniffnet"
version = "1.4.2"
authors = ["Giuliano Bellini <gyulyvgc99@gmail.com>"]
edition = "2024"
description = "Application to comfortably monitor your network traffic"
readme = "README.md"
homepage = "https://sniffnet.net"
repository = "https://github.com/GyulyVGC/sniffnet"
documentation = "https://github.com/GyulyVGC/sniffnet/wiki"
license = "MIT OR Apache-2.0"
keywords = ["filter", "network", "packet", "sniffer", "gui"]
categories = ["visualization", "gui", "network-programming"]
include = [
    "/src/**/*.rs",
    "/LICENSE-MIT",
    "/LICENSE-APACHE",
    "/README.md",
    "/CHANGELOG.md",
    "/resources/countries_flags/**/*.svg",
    "/resources/DB/*.mmdb",
    "/resources/fonts/subset/*.ttf",
    "/resources/logos/raw/icon.png",
    "/resources/packaging/windows/graphics/sniffnet.ico",
    "/resources/sounds/*.mp3",
    "/services.txt",
    "/build.rs",
]

#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════

[profile.release]
opt-level = 3
lto = true
strip = true

#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════

[dependencies]
pcap = "2.4.0"
etherparse = "0.19.0"
chrono = { version = "0.4.42", default-features = false, features = ["clock"] }
plotters = { version = "0.3.7", default-features = false, features = ["area_series", "line_series"] }
iced = { version = "0.13.1", features = ["tokio", "svg", "advanced", "lazy", "image"] }
plotters-iced = "0.11.0"
maxminddb = "0.27.0"
confy = "2.0.0"
serde = { version = "1.0.228", default-features = false, features = ["derive"] }
serde_json = { version = "1.0.145", features = ["preserve_order"] }
rodio = { version = "0.21.1", default-features = false, features = ["mp3", "playback"] }
dns-lookup = "3.0.1"
toml = "0.9.8"
ctrlc = { version = "3.5.1", features = ["termination"] }
rfd = "0.16.0"
phf = "0.13.1"
phf_shared = "0.13.1"
splines = "5.0.0"
clap = { version = "4.5.53", features = ["derive"] }
tokio = { version = "1.48.0", features = ["macros"] }
async-channel = "2.5.0"
semver = "1.0.27"

[target.'cfg(windows)'.dependencies]
gag = "1.0.0"

[target.'cfg(not(target_arch = "powerpc64"))'.dependencies]
reqwest = { version = "0.12.24", default-features = false, features = ["json", "rustls-tls"] }

[target.'cfg(target_arch = "powerpc64")'.dependencies]
reqwest = { version = "0.12.24", features = ["json"] }

#───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

[dev-dependencies]
serde_test = "1.0.177"
rstest = "0.26.1"
serial_test = { version = "3.2.0", default-features = false }

#───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

[build-dependencies]
phf_codegen = "0.13.1"
phf_shared = "0.13.1"
rustrict = { version = "0.7.37", default-features = false, features = ["censor"] }

[target."cfg(windows)".build-dependencies]
winres = "0.1.12"

#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════

[badges]
maintenance = { status = "actively-developed" }

#═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════

[package.metadata.deb]
section = "Network"
license-file = "resources/packaging/LICENSE"
extended-description-file = "resources/packaging/linux/description.txt"
maintainer-scripts = "resources/packaging/linux/scripts/"
depends = "libasound2, libpcap0.8, libfontconfig1"
assets = [
    ["target/release/sniffnet", "/usr/bin/", "755"],
    ["resources/packaging/linux/sniffnet.desktop", "/usr/share/applications/", "644"],
    ["resources/packaging/linux/graphics/sniffnet_8x8.png", "/usr/share/icons/hicolor/8x8/apps/sniffnet.png", "644"],
    ["resources/packaging/linux/graphics/sniffnet_16x16.png", "/usr/share/icons/hicolor/16x16/apps/sniffnet.png", "644"],
    ["resources/packaging/linux/graphics/sniffnet_22x22.png", "/usr/share/icons/hicolor/22x22/apps/sniffnet.png", "644"],
    ["resources/packaging/linux/graphics/sniffnet_24x24.png", "/usr/share/icons/hicolor/24x24/apps/sniffnet.png", "644"],
    ["resources/packaging/linux/graphics/sniffnet_32x32.png", "/usr/share/icons/hicolor/32x32/apps/sniffnet.png", "644"],
    ["resources/packaging/linux/graphics/sniffnet_36x36.png", "/usr/share/icons/hicolor/36x36/apps/sniffnet.png", "644"],
    ["resources/packaging/linux/graphics/sniffnet_42x42.png", "/usr/share/icons/hicolor/42x42/apps/sniffnet.png", "644"],
    ["resources/packaging/linux/graphics/sniffnet_48x48.png", "/usr/share/icons/hicolor/48x48/apps/sniffnet.png", "644"],
    ["resources/packaging/linux/graphics/sniffnet_64x64.png", "/usr/share/icons/hicolor/64x64/apps/sniffnet.png", "644"],
    ["resources/packaging/linux/graphics/sniffnet_72x72.png", "/usr/share/icons/hicolor/72x72/apps/sniffnet.png", "644"],
    ["resources/packaging/linux/graphics/sniffnet_96x96.png", "/usr/share/icons/hicolor/96x96/apps/sniffnet.png", "644"],
    ["resources/packaging/linux/graphics/sniffnet_128x128.png", "/usr/share/icons/hicolor/128x128/apps/sniffnet.png", "644"],
    ["resources/packaging/linux/graphics/sniffnet_160x160.png", "/usr/share/icons/hicolor/160x160/apps/sniffnet.png", "644"],
    ["resources/packaging/linux/graphics/sniffnet_192x192.png", "/usr/share/icons/hicolor/192x192/apps/sniffnet.png", "644"],
    ["resources/packaging/linux/graphics/sniffnet_256x256.png", "/usr/share/icons/hicolor/256x256/apps/sniffnet.png", "644"],
    ["resources/packaging/linux/graphics/sniffnet_384x384.png", "/usr/share/icons/hicolor/384x384/apps/sniffnet.png", "644"],
    ["resources/packaging/linux/graphics/sniffnet_512x512.png", "/usr/share/icons/hicolor/512x512/apps/sniffnet.png", "644"],
    ["resources/packaging/linux/graphics/sniffnet_1024x1024.png", "/usr/share/icons/hicolor/1024x1024/apps/sniffnet.png", "644"]
]

#───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

[package.metadata.generate-rpm]
post_install_script = "setcap cap_net_raw,cap_net_admin=eip /usr/bin/sniffnet"
assets = [
    { source = "target/release/sniffnet", dest = "/usr/bin/", mode = "755" },
    { source = "resources/packaging/linux/sniffnet.desktop", dest = "/usr/share/applications/", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_8x8.png", dest = "/usr/share/icons/hicolor/8x8/apps/sniffnet.png", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_16x16.png", dest = "/usr/share/icons/hicolor/16x16/apps/sniffnet.png", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_22x22.png", dest = "/usr/share/icons/hicolor/22x22/apps/sniffnet.png", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_24x24.png", dest = "/usr/share/icons/hicolor/24x24/apps/sniffnet.png", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_32x32.png", dest = "/usr/share/icons/hicolor/32x32/apps/sniffnet.png", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_36x36.png", dest = "/usr/share/icons/hicolor/36x36/apps/sniffnet.png", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_42x42.png", dest = "/usr/share/icons/hicolor/42x42/apps/sniffnet.png", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_48x48.png", dest = "/usr/share/icons/hicolor/48x48/apps/sniffnet.png", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_64x64.png", dest = "/usr/share/icons/hicolor/64x64/apps/sniffnet.png", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_72x72.png", dest = "/usr/share/icons/hicolor/72x72/apps/sniffnet.png", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_96x96.png", dest = "/usr/share/icons/hicolor/96x96/apps/sniffnet.png", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_128x128.png", dest = "/usr/share/icons/hicolor/128x128/apps/sniffnet.png", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_160x160.png", dest = "/usr/share/icons/hicolor/160x160/apps/sniffnet.png", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_192x192.png", dest = "/usr/share/icons/hicolor/192x192/apps/sniffnet.png", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_256x256.png", dest = "/usr/share/icons/hicolor/256x256/apps/sniffnet.png", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_384x384.png", dest = "/usr/share/icons/hicolor/384x384/apps/sniffnet.png", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_512x512.png", dest = "/usr/share/icons/hicolor/512x512/apps/sniffnet.png", mode = "644" },
    { source = "resources/packaging/linux/graphics/sniffnet_1024x1024.png", dest = "/usr/share/icons/hicolor/1024x1024/apps/sniffnet.png", mode = "644" }
]

[package.metadata.generate-rpm.requires]
alsa-lib = "*"
libpcap = "*"
fontconfig = "*"

#───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

[package.metadata.wix]
include = [".\\resources\\packaging\\windows\\setup.wxs"]
