chore(docs): Use man pages

Also update CI, README and Makefile
main
earnest ma 2021-10-07 14:27:21 -04:00
parent 627fc026d1
commit d5b93744a2
Signed by: earnest ma
GPG Key ID: A343F43342EB6E2A
6 changed files with 129 additions and 11 deletions

View File

@ -2,6 +2,7 @@ image: ubuntu/next
packages:
- dpkg
- dpkg-dev
- scdoc
- shellcheck
sources:

View File

@ -1,28 +1,52 @@
.POSIX:
.SUFFIXES:
.SUFFIXES: .1 .5 .1.scd .5.scd
PREFIX?=/usr/local
BINDIR?=$(PREFIX)/bin
MANDIR?=$(PREFIX)/share/man
# Exists in GNUMake but not in NetBSD make and others.
RM?=rm -f
RMDIR_IF_EMPTY:=sh -c '\
if test -d $$0 && ! ls -1qA $$0 | grep -q . ; then \
rmdir $$0; \
fi'
all: docs ## Build and generate files
docs: docs/aptpkg.1 docs/aptpkg.5 ## Generate docs
.1.scd.1:
scdoc < $< > $@
.5.scd.5:
scdoc < $< > $@
.PHONY: clean
clean: ## Remove generated files
$(RM) docs/aptpkg.1 docs/aptpkg.5
.PHONY: help
help: ## Show this help
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: install
install: ## Install aptpkg
mkdir -m755 -p $(DESTDIR)$(BINDIR)
mkdir -m755 -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1 $(DESTDIR)$(MANDIR)/man5
install -m755 aptpkg $(DESTDIR)$(BINDIR)/aptpkg
install -m644 docs/aptpkg.1 $(DESTDIR)$(MANDIR)/man1/aptpkg.1
install -m644 docs/aptpkg.5 $(DESTDIR)$(MANDIR)/man1/aptpkg.5
.PHONY: test
test: ## Run shellcheck tests
shellcheck aptpkg
RMDIR_IF_EMPTY:=sh -c '\
if test -d $$0 && ! ls -1qA $$0 | grep -q . ; then \
rmdir $$0; \
fi'
.PHONY: uninstall
uninstall: ## Uninstall aptpkg
$(RM) $(DESTDIR)$(BINDIR)/aptpkg
$(RM) $(DESTDIR)$(MANDIR)/man1/aptpkg.1
$(RM) $(DESTDIR)$(MANDIR)/man5/aptpkg.5
${RMDIR_IF_EMPTY} $(DESTDIR)$(BINDIR)
${RMDIR_IF_EMPTY} $(DESTDIR)$(MANDIR)

View File

@ -11,14 +11,14 @@ Easily create/ get debian packages.
## Prerequisites
- ubuntu-dev-tools
- scdoc (build)
- dpkg, dpkg-dev
- git, wget, bash
- unzip, tar, ar, etc.
- unzip, tar, etc.
## Usage
See the [wiki](https://man.sr.ht/~earnestma/aptpkg) or run `./aptpkg --help` for
more information.
Run `aptpkg --help` or `man aptpkg` for more information.
## Contribute

2
aptpkg
View File

@ -11,7 +11,7 @@ aptpkg v$APTPKG_VERSION
Easily create debian packages.
Documentation: https://man.sr.ht/~earnestma/aptpkg
For more documentation, run man aptpkg
Usage:
aptpkg [directory]

31
docs/aptpkg.1.scd Normal file
View File

@ -0,0 +1,31 @@
aptpkg(1)
# NAME
aptpkg - easily create/ get debian packages
# SYNOPSIS
*aptpkg* _path_
*aptpkg* --auto [git commit hash]
*aptpkg* --help
# DESCRIPTION
aptpkg can be used to easily create/ get debian packages, and can be used with
a tool such as *reprepro*(1).
Provide aptpkg with a path to a folder containing an *aptpkg*(5) build file.
The --auto option can also be used to build modified packages based on a git
commit hash, using _HEAD_ if one is not provided.
# SEE ALSO
*aptpkg*(5)
# AUTHORS
Sources, maintainers list, and how to submit bugs/ patches can be done at
https://sr.ht/~earnestma/aptpkg.

62
docs/aptpkg.5.scd Normal file
View File

@ -0,0 +1,62 @@
aptpkg(5)
# NAME
aptpkg - file format reference
# SYNTAX
The file must be named _build_ and placed in a directory named the program.
## MAINTAINERS
The first line should start like so:
```
# Maintainer: Name <email@example.org>
```
More maintainers can be listed after.
## COMMON
- name: Name of the package
- version: Version number
- rev: Revision number (often 0, only useful if type=file)
- type
- type=deb: Debian package that will be downloaded and checked
- type=file: Download file(s), check, and execute the _steps_ function
- url: Homepage of upstream
- description: Description similar to what upstream says
## SOURCE
Provide a URL pointing to the file to download
## SHA512SUMS
The output of `sha512sum filename` that will be used to verify
## STEPS
Steps to extract and "install" the package
- $builddir: The root directory
- cin-bin: Install an executable file (with permissions 755)
- cin-file: Install a file (with permissions 644)
## MAINTAINER SCRIPTS
Maintainer scripts can be placed along _build_: examples include preinst,
postinst, prerm, and postrm
# SEE ALSO
*aptpkg*(1)
Files that aptpkg.earne.link uses: https://git.sr.ht/~earnestma/aptpkg-pkgs
# AUTHORS
Sources, maintainers list, and how to submit bugs/ patches can be done at
https://sr.ht/~earnestma/aptpkg.