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.
This commit is contained in:
Brent Cook
2015-07-11 14:23:44 -05:00
parent 83d07710b5
commit bda20bd13f
3 changed files with 27 additions and 2 deletions

View File

@@ -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