#-----------------------------------------------------------------------------
#
# NcFTP binary distribution makefile 
#
#-----------------------------------------------------------------------------

SHELL=/bin/sh
prefix=@prefix@
mandir=@mandir@

all:
	-@echo "Try \"make install\" to install the package into the $(prefix) hierarchy."

install:
	-@echo '..... Installing the programs .....'
	-mkdir $(prefix)/bin $(mandir) $(mandir)/man1 2>/dev/null
	-for f in ncftp ncftpget ncftpput ncftpbatch ncftpspooler ncftpls ; do \
		/bin/rm -f $(prefix)/bin/$$f ; \
		cp bin/$$f $(prefix)/bin/$$f ; \
		chmod 755 $(prefix)/bin/$$f ; \
		chown bin $(prefix)/bin/$$f 2>/dev/null ; \
		chgrp bin $(prefix)/bin/$$f 2>/dev/null ; \
		: ; \
	done
	-@/bin/rm -f $(prefix)/bin/ncftpspooler
	-ln $(prefix)/bin/ncftpbatch $(prefix)/bin/ncftpspooler
	-@cp bin/ncftpbookmarks $(prefix)/bin/ncftpbookmarks 2>/dev/null
	-@chmod 755 $(prefix)/bin/ncftpbookmarks 2>/dev/null
	-@chown bin $(prefix)/bin/ncftpbookmarks 2>/dev/null
	-@chgrp bin $(prefix)/bin/ncftpbookmarks 2>/dev/null
	-@/bin/ls -l $(prefix)/bin/ncftp $(prefix)/bin/ncftpget $(prefix)/bin/ncftpput $(prefix)/bin/ncftpbatch $(prefix)/bin/ncftpspooler $(prefix)/bin/ncftpls $(prefix)/bin/ncftpbookmarks
	-@echo '..... Installing the manual pages .....'
	for f in ncftp.1 ncftpget.1 ncftpput.1 ncftpbatch.1 ncftpspooler.1  ncftpls.1 ; do \
		/bin/rm -f $(mandir)/man1/$$f ; \
		cp doc/man/$$f $(mandir)/man1/$$f ; \
		chmod 644 $(mandir)/man1/$$f ; \
	done
	-@echo 'Done installing NcFTP.'
