Add a man page

Include a man page for arch-rebuild-order including a Makefile to build
and install the man page and binary.

Closes: #4
This commit is contained in:
Jelle van der Waa 2021-01-08 00:08:55 +01:00
parent a23d5275f7
commit cd8484e7e4
No known key found for this signature in database
GPG Key ID: C06086337C50773E
3 changed files with 64 additions and 0 deletions

3
.gitignore vendored
View File

@ -10,3 +10,6 @@
# Backup files generated by rustfmt
**/*.rs.bk
# man pages
doc/*.1

27
Makefile Normal file
View File

@ -0,0 +1,27 @@
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man
# Tools
CARGO ?= cargo
MANDOWN ?= mandown
BIN=arch-rebuild-order
MANPAGE=arch-rebuild-order.1
DOCDIR=doc
all: build doc
doc: $(DOCDIR)/$(MANPAGE)
%.1: %.md
$(MANDOWN) $< > $@
build:
$(CARGO) build --release --locked
.PHONY: install
install: doc
install -Dm755 target/release/$(BIN) $(DESTDIR)$(BINDIR)/$(BIN)
install -Dm644 $(DOCDIR)/$(MANPAGE) $(DESTDIR)$(MANDIR)/man1/$(MANPAGE)

34
doc/arch-rebuild-order.md Normal file
View File

@ -0,0 +1,34 @@
# NAME
arch-rebuild-order - Rebuild order generation script
# SYNOPSIS
**arch-rebuild-order** [OPTION]... [PACKAGES]...
# DESCRIPTION
Generate a rebuild order for given packages using pacman's local syncdb's.
**--d=FILE, --dotfile=FILE** Generate a .dot graph file with the rebuild order of the gives packages
**--dbpath=PATH** the path to pacman's database path
**--repos=REPOS** the repositories to retrieve the package information from
**-V, --version** prints version information
**-h, --help** prints help information
# EXAMPLES
Generating an image of the rebuild order of provided package(s):
$ **arch-rebuild-order** -d linux-rebuild-order.dot linux
$ dot -Tpng linux-rebuild-order.dot > linux-rebuild-order.pn
# BUGS
[Bug tracker](https://gitlab.archlinux.org/archlinux/arch-rebuild-order/-/issues)