# Makefile for scipfire
# $Revision: 1.2 $

#
# the location of the sources
SRC      = .

#
# where the firewall should be installed to.
# if you change this, then you also need to
# edit the PREFIX velue in the scipfire script!!!
DEST     = /etc/scipfire.d

#
# the actual firewall script
SCRIPT   = $DEST/bin/scipfire

#
# where your startup scripts resides
RCDIR    = /etc/init.d

#
# add or remove the runlevels from which
# the firewall should be started
RUNLEVEL = /etc/rc2.d /etc/rc3.d

#
# add or remove the runlevels fro which
# the firewall should be stopped
STLEVEL  = /etc/rc0.d /etc/rc1.d /etc/rc2.d /etc/rc3.d

#
# the location of the install utility
INSTALL  = /usr/bin/install


#
# not for u
DIST     = Makefile  README  VERSION  bin  chains  conf  configure  dns  doc  lids  rc.d  syslog


all:
	@echo "Type \"make install\""


install:
	$(INSTALL) -g root -o root -m 0700 -d $(DEST)
	$(INSTALL) -g root -o root -m 0700 $(SRC)* $(DEST)/
	ln -s $(SCRIPT) $(RCDIR)
	for start in $(RUNLEVEL); do ln -s $(RCDIR)/scipfire $(start)/S90scipfire; done
	for stop  in $(STLEVEL);  do ln -s $(RCDIR)/scipfire $(stop)/S90scipfire;  done


clean:
	rm -f *~
	rm -f */*~
	rm -f */*/*~



dist:
	@echo "Making distribution tarball scipfire-`cat VERSION`.tar.gz"
	rm -rf .dist; mkdir .dist
	cd .dist; mkdir scipfire
	cp -prd $(DIST) .dist/scipfire/
	cd .dist; rm -rf scipfire/etc/scipfire.conf scipfire/CVS scipfire/*/CVS scipfire/*/*/CVS
	cd .dist; mv scipfire scipfire-`cat ../VERSION`
	cd .dist; tar cpzf scipfire-`cat ../VERSION`.tar.gz scipfire-`cat ../VERSION`
	cd .dist; mv scipfire-`cat ../VERSION`.tar.gz ../../; rm -rf *
