diff options
author | Stefan Kreutz <mail@skreutz.com> | 2022-11-09 09:49:02 +0100 |
---|---|---|
committer | Stefan Kreutz <mail@skreutz.com> | 2022-11-09 09:49:02 +0100 |
commit | 9a08dec095725012546ea93ac07142a570d1b220 (patch) | |
tree | b33557ad90ae94adb7d2e24dad1c45387910c18b | |
parent | c39913911b6c357ca9882d37b54db8daa23a5383 (diff) | |
download | jotpass-c0b035a339e971595bd70dfd884fa8b6c7b8f5ca.tar |
Port to GNU/Linuxjotpass-0.2.0
Tested on Void Linux x86_64 glibc.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 36 | ||||
-rw-r--r-- | README.md | 21 | ||||
-rwxr-xr-x | configure | 18 |
4 files changed, 66 insertions, 10 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aee2e4c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +config.mk @@ -1,9 +1,31 @@ -MAN= jotpass.1 -BINDIR= /usr/local/bin -MANDIR= /usr/local/man/man +# Portable makefile supporting OpenBSD and GNU/Linux. -beforeinstall: - ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ - ${.CURDIR}/jotpass.ksh ${DESTDIR}${BINDIR}/jotpass +PREFIX = /usr/local +INSTALL = install +BINDIR = bin +BINOWN = root +BINGRP = root +BINMODE = 555 +MANDIR = man/man +MANOWN = root +MANGRP = root +MANMODE = 444 -.include <bsd.prog.mk> +include config.mk + +all: + +clean: + +lint: + shellcheck -a jotpass.ksh + mandoc -T lint -W warning jotpass.1 + -mandoc -T lint -W all jotpass.1 + +install: + ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} jotpass.ksh ${DESTDIR}${PREFIX}/${BINDIR}/jotpass + ${INSTALL} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} jotpass.1 ${DESTDIR}${PREFIX}/${MANDIR}1/jotpass.1 + +uninstall: + rm -f ${DESTDIR}${PREFIX}/${BINDIR}/jotpass + rm -f ${DESTDIR}${PREFIX}/${MANDIR}1/jotpass.1 @@ -1,7 +1,7 @@ # Jotpass -Jotpass is a BSD utility that facilitates generating random passwords suitable -for handwriting. See [this][intro] blog post for an introduction. +The `jotpass` utility facilitates generating random passwords suitable for +handwriting. See [this][intro] blog post for an introduction. [intro]: https://www.skreutz.com/posts/readable-random-passwords-with-jot/ @@ -14,6 +14,21 @@ Print a random password: See the manual page for details. +## Dependencies + +The `jotpass` utility depends on `ksh(1)`, `jot(1)`, and some base utilities +like `sed(1)`. + +On OpenBSD these are included in the default base installation. + +On Void Linux you can install the dependencies using `xbps-install(1)`: +follows: + + $ sudo xbps-install -S oksh outils coreutils bc sed + ## Installation -Run `make install` as root to install the `jotpass` utility and man page. + $ ./configure + $ make + $ sudo make install + diff --git a/configure b/configure new file mode 100755 index 0000000..9a1e936 --- /dev/null +++ b/configure @@ -0,0 +1,18 @@ +#! /bin/sh + +set -o errexit +set -o nounset + +exec 3>config.mk + +case "$( uname )" in + OpenBSD) + echo 'BINGRP = bin' 1>&3 + echo 'MANGRP = bin' 1>&3 + ;; + Linux) + echo 'BINMODE = 755' 1>&3 + echo 'MANMODE = 644' 1>&3 + echo 'MANDIR = share/man/man' 1>&3 + ;; +esac |