ptools 0.2.16

Utilities for inspecting Linux processes
[package]
name = "ptools"
version = "0.2.16"
edition = "2021"
description = "Utilities for inspecting Linux processes"
readme = "README.md"
homepage = "https://github.com/basil/ptools"
repository = "https://github.com/basil/ptools"
license = "Apache-2.0"
keywords = ["linux", "process", "procfs", "debugging", "cli"]
categories = ["command-line-utilities", "development-tools::debugging"]

[dependencies]
cpp_demangle = "0.5"
foreign-types = "0.5"
lexopt = "0.3"
libc = "0.2"
nix = { version = "0.30", features = ["event", "feature", "fs", "process", "resource", "sched", "signal", "socket", "time"] }
rustc-demangle = "0.1"
zstd = "0.13"

[build-dependencies]
pkg-config = "0.3"
roff = "1.0"

[profile.release]
opt-level = "s" # Optimize for binary size.
lto = true # Tends to produce the smallest binaries (tradeoff: slower builds).
codegen-units = 1 # Tends to produce the smallest binaries (tradeoff: slower builds).
panic = "abort" # Save size. We don't need unwinding anyway.
debug = "limited" # Debug info without type or variable-level information, making backtraces meaningful without the full size hit.
strip = "symbols" # Strips symbol table to reduce size, while still leaving enough info for backtraces.
# TODO is there any way to remove the ability to display backtraces? This would
# likely shave another 50K or so off the binary size, and may not be necessary
# if systems are typically configured to dump core on SIGABRT

[package.metadata.deb]
maintainer = "Basil Crow"
section = "debug"
copyright = "2026 Basil Crow"
depends = "$auto"

extended-description = """\
A collection of utilities for inspecting the state of processes, modeled \
after the tools by the same name which exist on Solaris/illumos."""

assets = [
  # List files we want explicitly so that we don't get the binaries intended for
  # testing.
  ["target/release/pargs", "usr/bin/", "755"],
  ["target/release/pauxv", "usr/bin/", "755"],
  ["target/release/pcred", "usr/bin/", "755"],
  ["target/release/penv", "usr/bin/", "755"],
  ["target/release/pfiles", "usr/bin/", "755"],
  ["target/release/plgrp", "usr/bin/", "755"],
  ["target/release/prun", "usr/bin/", "755"],
  ["target/release/psig", "usr/bin/", "755"],
  ["target/release/pstack", "usr/bin/", "755"],
  ["target/release/pstop", "usr/bin/", "755"],
  ["target/release/ptime", "usr/bin/", "755"],
  ["target/release/ptree", "usr/bin/", "755"],
  ["target/release/pwait", "usr/bin/", "755"],
  ["target/man/pargs.1", "usr/share/man/man1/pargs.1", "644"],
  ["target/man/pauxv.1", "usr/share/man/man1/pauxv.1", "644"],
  ["target/man/pcred.1", "usr/share/man/man1/pcred.1", "644"],
  ["target/man/penv.1", "usr/share/man/man1/penv.1", "644"],
  ["target/man/pfiles.1", "usr/share/man/man1/pfiles.1", "644"],
  ["target/man/plgrp.1", "usr/share/man/man1/plgrp.1", "644"],
  ["target/man/prun.1", "usr/share/man/man1/prun.1", "644"],
  ["target/man/psig.1", "usr/share/man/man1/psig.1", "644"],
  ["target/man/pstack.1", "usr/share/man/man1/pstack.1", "644"],
  ["target/man/pstop.1", "usr/share/man/man1/pstop.1", "644"],
  ["target/man/ptime.1", "usr/share/man/man1/ptime.1", "644"],
  ["target/man/ptree.1", "usr/share/man/man1/ptree.1", "644"],
  ["target/man/pwait.1", "usr/share/man/man1/pwait.1", "644"],
]

[package.metadata.generate-rpm]
vendor = "Basil Crow"
packager = "Basil Crow"
requires = { elfutils-libs = "*", systemd-libs = "*" }
assets = [
  { source = "target/release/pargs", dest = "/usr/bin/pargs", mode = "755" },
  { source = "target/release/pauxv", dest = "/usr/bin/pauxv", mode = "755" },
  { source = "target/release/pcred", dest = "/usr/bin/pcred", mode = "755" },
  { source = "target/release/penv", dest = "/usr/bin/penv", mode = "755" },
  { source = "target/release/pfiles", dest = "/usr/bin/pfiles", mode = "755" },
  { source = "target/release/plgrp", dest = "/usr/bin/plgrp", mode = "755" },
  { source = "target/release/prun", dest = "/usr/bin/prun", mode = "755" },
  { source = "target/release/psig", dest = "/usr/bin/psig", mode = "755" },
  { source = "target/release/pstack", dest = "/usr/bin/pstack", mode = "755" },
  { source = "target/release/pstop", dest = "/usr/bin/pstop", mode = "755" },
  { source = "target/release/ptime", dest = "/usr/bin/ptime", mode = "755" },
  { source = "target/release/ptree", dest = "/usr/bin/ptree", mode = "755" },
  { source = "target/release/pwait", dest = "/usr/bin/pwait", mode = "755" },
  { source = "target/man/pargs.1", dest = "/usr/share/man/man1/pargs.1", mode = "644" },
  { source = "target/man/pauxv.1", dest = "/usr/share/man/man1/pauxv.1", mode = "644" },
  { source = "target/man/pcred.1", dest = "/usr/share/man/man1/pcred.1", mode = "644" },
  { source = "target/man/penv.1", dest = "/usr/share/man/man1/penv.1", mode = "644" },
  { source = "target/man/pfiles.1", dest = "/usr/share/man/man1/pfiles.1", mode = "644" },
  { source = "target/man/plgrp.1", dest = "/usr/share/man/man1/plgrp.1", mode = "644" },
  { source = "target/man/prun.1", dest = "/usr/share/man/man1/prun.1", mode = "644" },
  { source = "target/man/psig.1", dest = "/usr/share/man/man1/psig.1", mode = "644" },
  { source = "target/man/pstack.1", dest = "/usr/share/man/man1/pstack.1", mode = "644" },
  { source = "target/man/pstop.1", dest = "/usr/share/man/man1/pstop.1", mode = "644" },
  { source = "target/man/ptime.1", dest = "/usr/share/man/man1/ptime.1", mode = "644" },
  { source = "target/man/ptree.1", dest = "/usr/share/man/man1/ptree.1", mode = "644" },
  { source = "target/man/pwait.1", dest = "/usr/share/man/man1/pwait.1", mode = "644" },
]