From 44bf77a12ffd86294054c6e92077ea31f3613360 Mon Sep 17 00:00:00 2001 From: Stefan Kreutz Date: Sun, 26 May 2024 22:41:56 +0200 Subject: Port to Arch Linux --- .gitignore | 1 + Makefile | 10 +++++++++- README.md | 4 ++++ configure | 20 +++++++++++++++----- temp-postgres.sh | 2 +- 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index aee2e4c..77f2ae4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ config.mk +temp-postgres.1.gz diff --git a/Makefile b/Makefile index f4d88d4..ede21d6 100644 --- a/Makefile +++ b/Makefile @@ -10,12 +10,15 @@ MANDIR = man/man MANOWN = root MANGRP = root MANMODE = 444 +MANGZ = 0 include config.mk all: + gzip -c temp-postgres.1 >temp-postgres.1.gz clean: + rm temp-postgres.1.gz lint: shellcheck -a temp-postgres.sh @@ -24,8 +27,13 @@ lint: install: ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} temp-postgres.sh ${DESTDIR}${PREFIX}/${BINDIR}/temp-postgres - ${INSTALL} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} temp-postgres.1 ${DESTDIR}${PREFIX}/${MANDIR}1/temp-postgres.1 + if [ ${MANGZ} -eq 1 ] ; then \ + ${INSTALL} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} temp-postgres.1.gz ${DESTDIR}${PREFIX}/${MANDIR}1/temp-postgres.1.gz ; \ + else \ + ${INSTALL} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} temp-postgres.1 ${DESTDIR}${PREFIX}/${MANDIR}1/temp-postgres.1 ; \ + fi uninstall: rm -f ${DESTDIR}${PREFIX}/${BINDIR}/temp-postgres rm -f ${DESTDIR}${PREFIX}/${MANDIR}1/temp-postgres.1 + rm -f ${DESTDIR}${PREFIX}/${MANDIR}1/temp-postgres.1.gz diff --git a/README.md b/README.md index 2fabd4f..146a3fa 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,10 @@ On Void Linux you can install the dependencies using `xbps-install(1)`: $ sudo xbps-install -S dash postgresql postgresql-client +On Arch Linux you can install the dependencies using `pacman(8)`: + + $ sudo pacman -Syu postgresql + ## Installation $ ./configure diff --git a/configure b/configure index c9b0f50..d5df8c0 100755 --- a/configure +++ b/configure @@ -1,7 +1,6 @@ #! /bin/sh -set -o errexit -set -o nounset +set -eu exec 3>config.mk @@ -16,8 +15,19 @@ case "$( uname )" in echo 'MANGRP = wheel' 1>&3 ;; Linux) - echo 'BINMODE = 755' 1>&3 - echo 'MANMODE = 644' 1>&3 - echo 'MANDIR = share/man/man' 1>&3 + case "$( sed -n 's/^ID=//p' /etc/os-release )" in + void) + echo 'BINMODE = 755' 1>&3 + echo 'MANMODE = 644' 1>&3 + echo 'MANDIR = share/man/man' 1>&3 + ;; + arch) + echo 'PREFIX = /usr' 1>&3 + echo 'BINMODE = 755' 1>&3 + echo 'MANDIR = share/man/man' 1>&3 + echo 'MANMODE = 644' 1>&3 + echo 'MANGZ = 1' 1>&3 + ;; + esac ;; esac diff --git a/temp-postgres.sh b/temp-postgres.sh index 48bb9e8..15e169b 100755 --- a/temp-postgres.sh +++ b/temp-postgres.sh @@ -14,7 +14,7 @@ # OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -set -o nounset +set -u # Remove the temporary directory before exiting. trap 'quit' INT -- cgit v1.2.3