Makefile: check dependencies before installation.

So that the packager will know what are dependencied when they are
making a new package.
This commit is contained in:
spacewander 2019-06-27 15:12:30 +08:00
parent 85248595e3
commit 58d13f88d4
3 changed files with 21 additions and 2 deletions

View file

@ -1,6 +1,10 @@
os:
- linux
- osx
addons:
apt:
packages:
- bsdmainutils
script:
- ./check_integrity.sh $(find bin | cut -b 5- | xargs)
# Test for the brew release

View file

@ -25,7 +25,12 @@ default: install
docs: $(MAN_HTML) $(MAN_PAGES)
install:
check:
@echo "Check dependencies before installation"
@./check_dependencies.sh
@echo
install: check
@if [ "$(INSTALL_VIA)" = brew ]; then \
git apply brew-release.patch || { echo "Can't apply brew release patch"; exit 1; } \
fi
@ -120,4 +125,4 @@ docclean:
rm -f man/*.1
rm -f man/*.html
.PHONY: default docs clean docclean install uninstall
.PHONY: default docs clean docclean check install uninstall

10
check_dependencies.sh Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env bash
err() {
echo >&2 "$1"
exit 1
}
if ! test "$(which column)"; then
err "Need to install dependency 'column' before installation"
fi