# fast-shlibdeps
A fast ELF shared library dependency analyzer for Debian-based systems. This tool analyzes ELF binaries to determine their shared library dependencies and maps them to Debian packages, providing output suitable for generating package dependencies.
This all happens in-process, allowing you to scan a massive directory tree without any subprocess overhead.
This tool was built to speed up my cursed Debian package building project, where I'm looking to build some packages without exactly adhering to Policy.
## Installation
```bash
cargo install --locked fast-shlibdeps
```
## Usage
```bash
# Analyze a single binary
fast-shlibdeps /usr/bin/ls
# Analyze multiple binaries
fast-shlibdeps /usr/bin/ls /usr/bin/cat
# Analyze all binaries in a directory recursively
fast-shlibdeps /usr/local/bin/
```
## Output
The tool outputs a comma-separated list of package dependencies with minimum version requirements:
```
libc6 (>=2.39-0ubuntu8.3), libssl3t64 (>=3.0.13-0ubuntu3.4), zlib1g (>=1:1.3.dfsg+really1.3.1-1ubuntu0.1)
```
## Performance
`fast-shlibdeps` is optimized for speed:
- Direct ELF parsing instead of using `ldd` or `objdump`
- Direct dpkg database reading instead of subprocess calls to `dpkg-query`
- Efficient batch processing of multiple files
## License
This project is licensed under the CC0 License - see the `LICENSE.md` file for details.
## AI Disclaimer
This tool was built with the help of Claude Code. This README was significantly written by Claude. I wanted to get this quickly built, so I took a shortcut.