# ~jhs/public_html/src/bsd/jhs/bin/local/mail/Makefile by Julian H. Stacey

FLAGS += -e
# -e	Don''t complain about files that are in the file hierarchy, but not
#	in the specification.
FLAGS += -U
# -U	Modify the owner, group and permissions of existing files to match
#	the specification and create any missing directories or symbolic
#	links.	User, group and permissions must all be specified for miss-
#	ing directories to be created.	Corrected mismatches are not con-
#	sidered errors.
FLAGS += -L
#	Follow all symbolic links in the file hierarchy.

DESTDIR ?= /

beforeinstall: mtree bin_daemon bin_bin

mtree:	# cd ~jhs/public_html/src/bsd/jhs/bin/local/mail ; xs make mtree -f ./ctms.mtree
	-cd ${DESTDIR} && mtree ${FLAGS} -f ${.CURDIR}/ctms.mtree

obj:
	true else install calling bin_daemon doesnt find ctm-freebsd-cvs-incoming

bin_daemon:
	@# till 2019-05-03 ${INSTALL} -c -o daemon -g daemon
	${INSTALL} -c -o mailnull -g mailnull -m 6755 \
		ctm-freebsd-common		\
		ctm-freebsd-git-incoming	\
		ctm-freebsd-svn-incoming	\
		ctm-freebsd-ports-incoming	\
		ctm-freebsd-src-cur-incoming	\
		ctm-freebsd-src-4-incoming	\
		ctm-freebsd-src-5-incoming	\
		ctm-freebsd-src-6-incoming	\
		ctm-freebsd-src-7-incoming	\
		ctm-freebsd-src-8-incoming	\
		ctm-freebsd-src-9-incoming	\
		ctm-freebsd-src-10-incoming	\
		ctm-freebsd-src-11-incoming	\
		ctm-freebsd-src-12-incoming	\
		ctm-freebsd-src-13-incoming	\
		ctm-freebsd-src-14-incoming	\
		ctm-freebsd-src-14r-incoming	\
		${DESTDIR}${BINDIR}
	@#	ctm-freebsd-cvs-incoming	\
	@# ${BINOWN}=root ${BINGRP}=wheel

bin_bin:
	${INSTALL} -c -o bin -g bin -m 755 null_src ${DESTDIR}${BINDIR}/null
	@# I got weird error messages till I moved null to null_src.
	${INSTALL} -c -o jhs -g staff -m 755 procmail.sh ${DESTDIR}${BINDIR}
	${INSTALL} -c -o jhs -g staff -m 755 header_add ${DESTDIR}${BINDIR}
	${INSTALL} -c -o jhs -g staff -m 755 header_add /site${BINDIR}
	@echo "JJLATER demime+emil+delatt is installed from ~jhs/bin/.sh/demime+emil+delatt"
	${INSTALL} -c -o jhs -g staff -m 755 vix ${DESTDIR}${BINDIR}
	@# vix source belongs somewhere else as nothing to do with mail,
	@#	but I have nowhere else to put it.
	@# No longer installed:		archive-bim archive-incoming

.include <bsd.prog.mk>
.include <berklix.mk>	# Needed to support recursive make html from above.
