#:ts=8
#
#    $Id: Makefile,v 1.31 1992/12/28 17:29:45 mj Exp $
#
#    Makefile for fidogate software, lib directory
#
#
SHELL		=	/bin/sh

#
# ----- Start configuration defines ------------------------------------------
#
BINDIR		= /usr/local/bin
LIBDIR		= /usr/local/lib/fidonet
SPOOLDIR	= /usr/spool/fidonet

OWNER		= news
GROUP		= news

PERM_PROG	= 755
PERM_DATA	= 644
PERM_SETUID	= 4755
PERM_DIR	= 755

INSTALL_PROG	= install -g $(GROUP) -o $(OWNER) -m $(PERM_PROG)
INSTALL_DATA	= install -g $(GROUP) -o $(OWNER) -m $(PERM_DATA)
INSTALL_SETUID	= install -g $(GROUP) -o $(OWNER) -m $(PERM_SETUID)
INSTALL_DIR	= install -g $(GROUP) -o $(OWNER) -m $(PERM_DIR) -d

# File area for USENET.BBS
PUBLICDIR	= /u1/dos/doc/fido_de

#
# ----- End configuration defines --------------------------------------------
#
# Normally it should not be necessary to change anything below this line
#

AREAS		=	areas.local areas.gated areas.ger areas.oecher\
			areas.sysop areas.restr areas.intl areas.usenet\
			areas.de areas.misc

LIBFILES	=	config aliases hosts areas maus\
			bounce.restricted bounce.noto bounce.unsecure

LIBBINS		=	mailz242 mailz254 mailz2



all:	areas  usenet.bbs mailz242 mailz254 mailz2



install-dirs:
	$(INSTALL_DIR)    $(LIBDIR)

install:
	$(INSTALL_DATA) $(LIBFILES) $(LIBDIR)
	$(INSTALL_PROG) $(LIBBINS) $(LIBDIR)

areas:		$(AREAS)
	cat $(AREAS) >areas

usenet.bbs:	areas
	./mk-bbs.pl areas.usenet areas.de >usenet.bbs
	./mk-hatch.pl FIDO_DE USENET.BBS "Fido.DE Usenet areas list" >h.bat
	cp usenet.bbs $(PUBLICDIR)
	
admin-hosts:
	cp hosts.head hosts
	admin -l hosts >>hosts

mailz254:	mailz254.sh
	sed -e 's+??SPOOL??+$(SPOOLDIR)+g' \
		-e 's+??LIB??+$(LIBDIR)+g' mailz254.sh >mailz254
	chmod +x mailz254

mailz242:	mailz242.sh
	sed -e 's+??SPOOL??+$(SPOOLDIR)+g' \
		-e 's+??LIB??+$(LIBDIR)+g' mailz242.sh >mailz242
	chmod +x mailz242

mailz2:		mailz2.sh
	sed -e 's+??SPOOL??+$(SPOOLDIR)+g' \
		-e 's+??LIB??+$(LIBDIR)+g' mailz2.sh >mailz2
	chmod +x mailz2


clean:
	rm -f areas usenet.bbs h.bat
	rm -f mailz254 mailz242 mailz2
	rm -f core *~ *.bak *.o tags TAGS
