52 lines
962 B
Markdown
52 lines
962 B
Markdown
# Packaging
|
|
|
|
Build `.deb` and `.rpm` packages for tcptop. Packaging must be done on Linux since the binary targets Linux.
|
|
|
|
## Prerequisites
|
|
|
|
```bash
|
|
cargo install cargo-deb cargo-generate-rpm
|
|
```
|
|
|
|
## Build .deb
|
|
|
|
```bash
|
|
cargo deb -p tcptop
|
|
```
|
|
|
|
Output: `target/debian/tcptop_<version>_<arch>.deb`
|
|
|
|
## Build .rpm
|
|
|
|
The RPM tool requires a pre-built release binary:
|
|
|
|
```bash
|
|
cargo build --release -p tcptop
|
|
cargo generate-rpm -p tcptop
|
|
```
|
|
|
|
Output: `target/generate-rpm/tcptop-<version>-<release>.<arch>.rpm`
|
|
|
|
## Verify package contents
|
|
|
|
```bash
|
|
# .deb
|
|
dpkg-deb -c target/debian/tcptop_*.deb
|
|
|
|
# .rpm (requires: sudo apt install rpm)
|
|
rpm -qlp target/generate-rpm/tcptop-*.rpm
|
|
```
|
|
|
|
Both packages should contain:
|
|
- `usr/bin/tcptop` (binary)
|
|
- `usr/share/man/man1/tcptop.1` (man page)
|
|
|
|
## Test-install .deb
|
|
|
|
```bash
|
|
sudo dpkg -i target/debian/tcptop_*.deb
|
|
which tcptop # /usr/bin/tcptop
|
|
man tcptop # renders man page
|
|
sudo dpkg -r tcptop # uninstall
|
|
```
|