BINDIR=		${PREFIX}/bin
ETCDIR=		${PREFIX}/etc
MANDIR=		${PREFIX}/man
MANEXT=		8

all:
	/bin/sh build fb2
	@ echo 'Use the "build" command (shell script) to make ftpd.'
	@ echo 'You can say "build help" for details on how it works.'

install: bin/ftpd bin/ftpcount bin/ftpshut
	-mv -f ${ETCDIR}/ftpd ${ETCDIR}/ftpd-old
	@echo Installing binaries.
	install -c -o bin -g bin -m 755 bin/ftpd ${ETCDIR}/ftpd
	install -c -o bin -g bin -m 755 bin/ftpshut ${BINDIR}/ftpshut
	install -c -o bin -g bin -m 755 bin/ftpcount ${BINDIR}/ftpcount
	install -c -o bin -g bin -m 755 bin/ftpwho ${BINDIR}/ftpwho
	@echo Installing manpages.
	install -c -o bin -g bin -m 755 doc/ftpd.8 ${MANDIR}/man8/ftpd.8
	install -c -o bin -g bin -m 755 doc/ftpcount.1 ${MANDIR}/man1/ftpcount.1
	install -c -o bin -g bin -m 755 doc/ftpwho.1 ${MANDIR}/man1/ftpwho.1
	install -c -o bin -g bin -m 755 doc/ftpshut.8 ${MANDIR}/man8/ftpshut.8
	install -c -o bin -g bin -m 755 doc/ftpaccess.5 ${MANDIR}/man5/ftpaccess.5
	install -c -o bin -g bin -m 755 doc/ftphosts.5 ${MANDIR}/man5/ftphosts.5
	install -c -o bin -g bin -m 755 doc/ftpconversions.5 ${MANDIR}/man5/ftpconversions.5
	install -c -o bin -g bin -m 755 doc/xferlog.5 ${MANDIR}/man5/xferlog.5
	@echo Compressing manpages
	gzip -f -9 ${MANDIR}/man8/ftpd.8
	gzip -f -9 ${MANDIR}/man1/ftpcount.1
	gzip -f -9 ${MANDIR}/man1/ftpwho.1
	gzip -f -9 ${MANDIR}/man8/ftpshut.8
	gzip -f -9 ${MANDIR}/man5/ftpaccess.5
	gzip -f -9 ${MANDIR}/man5/ftphosts.5
	gzip -f -9 ${MANDIR}/man5/ftpconversions.5
	gzip -f -9 ${MANDIR}/man5/xferlog.5
