summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kreutz <mail@skreutz.com>2022-11-09 09:49:02 +0100
committerStefan Kreutz <mail@skreutz.com>2022-11-09 09:49:02 +0100
commit9a08dec095725012546ea93ac07142a570d1b220 (patch)
treeb33557ad90ae94adb7d2e24dad1c45387910c18b
parentc39913911b6c357ca9882d37b54db8daa23a5383 (diff)
downloadjotpass-9a08dec095725012546ea93ac07142a570d1b220.tar
Port to GNU/Linuxjotpass-0.2.0
Tested on Void Linux x86_64 glibc.
-rw-r--r--.gitignore1
-rw-r--r--Makefile36
-rw-r--r--README.md21
-rwxr-xr-xconfigure18
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
diff --git a/Makefile b/Makefile
index 552ebda..8f06eeb 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/README.md b/README.md
index 866beac..70341df 100644
--- a/README.md
+++ b/README.md
@@ -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
Generated by cgit. See skreutz.com for my tech blog and contact information.