From bda20bd13f8bf2063f915a3619db2292b38b6d88 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Sat, 11 Jul 2015 14:23:44 -0500 Subject: Improve automatic handling of OPENSSLDIR Install a default cert.pem, openssl.cnf, x509v3.cnf in OPENSSLDIR, which is derived by default from sysconfdir and the prefix setting. --- apps/Makefile.am | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/Makefile.am b/apps/Makefile.am index 3604349..d756e10 100644 --- a/apps/Makefile.am +++ b/apps/Makefile.am @@ -84,4 +84,24 @@ noinst_HEADERS += s_apps.h noinst_HEADERS += testdsa.h noinst_HEADERS += testrsa.h noinst_HEADERS += timeouts.h -noinst_HEADERS += openssl.cnf + +EXTRA_DIST = cert.pem +EXTRA_DIST += openssl.cnf +EXTRA_DIST += x509v3.cnf + +install-exec-hook: + @mkdir -p "$(DESTDIR)/$(OPENSSLDIR)" + @for i in cert.pem openssl.cnf x509v3.cnf; do \ + if [ ! -f "$(DESTDIR)/$(OPENSSLDIR)/$i" ]; then \ + $(INSTALL) -m 644 "$(srcdir)/$$i" "$(DESTDIR)/$(OPENSSLDIR)/$$i"; \ + else \ + echo " $(DESTDIR)/$(OPENSSLDIR)/$$i already exists, install will not overwrite"; \ + fi \ + done + +uninstall-local: + @for i in cert.pem openssl.cnf x509v3.cnf; do \ + if cmp -s "$(DESTDIR)/$(OPENSSLDIR)/$$i" "$(srcdir)/$$i"; then \ + rm -f "$(DESTDIR)/$(OPENSSLDIR)/$$i"; \ + fi \ + done -- cgit v1.2.3-55-g6feb