Makefile.am 1.17 KB
Newer Older
1
confdir = $(sysconfdir)/mapi
2
conf_DATA = mapi.conf 
3 4 5 6

# override the default conf install to check for mapi.conf overwrite
install-confDATA: $(conf_DATA)
	@$(NORMAL_INSTALL)
7
	test -z "$(confdir)" || mkdir -p "$(DESTDIR)$(confdir)"
8 9 10 11 12 13 14 15 16 17
	@list='$(conf_DATA)'; for p in $$list; do \
	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -e "$(DESTDIR)$(confdir)/$$p"; then \
  echo -e "\nConfig file $$p already exists in $(DESTDIR)$(confdir) - not overwriting...\n"; \
else \
	  f=$(am__strip_dir) \
	  echo " $(confDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(confdir)/$$f'"; \
	  $(confDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(confdir)/$$f"; \
fi \
	done
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

# ssl stuff
if SSL_IS_ENABLED
install-data-local:
	echo Generating SSL keys
	openssl genrsa -out mapicommd_key.pem 1024 2> /dev/null
	openssl req -new -x509 -days 30000 -key mapicommd_key.pem -out mapicommd_cert.pem -config mapicommd_cert.cnf
	${INSTALL} -m 600 mapicommd_key.pem $(DESTDIR)$(confdir)/mapicommd_key.pem
	${INSTALL} -m 600 mapicommd_cert.pem $(DESTDIR)$(confdir)/mapicommd_cert.pem
	rm mapicommd_key.pem mapicommd_cert.pem

uninstall-local:
	rm -f $(DESTDIR)$(confdir)/mapicommd_key.pem
	rm -f $(DESTDIR)$(confdir)/mapicommd_cert.pem
endif