summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2020-06-09 12:40:24 +0200
committerPhil Sutter <phil@nwl.cc>2020-06-09 19:36:37 +0200
commit848b4889274edb2ec6ef6218f3d8b55288dc4151 (patch)
tree66693c314df04685f9afb953e08ba64f64d6fb4f /utils
parentb40b7d976fe144d14421bb441f55ffdc11a4b442 (diff)
build: Fix for failing 'make uninstall'
Support for uninstalling is severely broken: - extensions/GNUmakefile.in defines an 'install' target but lacks a respective 'uninstall' one, causing 'make uninstall' abort with an error message. - iptables/Makefile.am defines an 'install-exec-hook' to create the binary symlinks which are left in place after 'make uninstall'. Fix these problems by defining respective targets containing code copied from automake-generated uninstall targets. While being at it, add a few more uninstall-hooks removing custom directories created by 'make install' if they are empty afterwards. Reported-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: Phil Sutter <phil@nwl.cc> Tested-by: Richard Guy Briggs <rgb@redhat.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/Makefile.am5
1 files changed, 5 insertions, 0 deletions
diff --git a/utils/Makefile.am b/utils/Makefile.am
index d09a6974..42bd9737 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -14,6 +14,11 @@ sbin_PROGRAMS += nfnl_osf
pkgdata_DATA += pf.os
nfnl_osf_LDADD = ${libnfnetlink_LIBS}
+
+uninstall-hook:
+ dir=${DESTDIR}${pkgdatadir}; { \
+ test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; \
+ } || rmdir -p --ignore-fail-on-non-empty "$$dir"
endif
if ENABLE_BPFC