1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
|
#
# Makefile for the Mason firewall builder
#
#Copyleft:
# Mason interactively creates a Linux packet filtering firewall.
# Copyright (C) 1998-2000 William Stearns <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# The author can also be reached at:
# William Stearns
#email: [email protected] (preferred)
#web: http://www.pobox.com/~wstearns
#snail: 6 Manchester Dr.
# Lebanon NH, 03766, USA
#
# Modified for Debian GNU/Linux.
DESTDIR =
##Make sure mason has MASONVER updated when this changes
MASONVER = 1.0.0
#No quotes around multi file specs.
BINDIR=$(DESTDIR)/usr/bin/
BINFILES=mason mason-gui-text
CONFDIR=$(DESTDIR)/etc/
CONFFILE=masonrc
LIBDIR=$(DESTDIR)/var/lib/mason/
LIBFILES=baserules.sample graffiti-services moreservices nmap-services portsdb-services regression-test all-ip-numbers.txt
LIBSCRIPTDIR=$(DESTDIR)/var/lib/mason/
LIBSCRIPTFILES=masonlib mason-decide
DOCDIR=$(DESTDIR)/usr/doc/mason-${MASONVER}/
DOCFILES=COPYING index.html mason.sgml mason.txt mason.html mason-1.html mason-2.html mason-3.html mason-4.html mason-5.html mason-6.html mason-7.html mason-8.html mason-9.html mason-10.html mason-11.html toc.gif prev.gif next.gif mason-banner.gif
#DOCDIR=$(DESTDIR)/usr/doc/mason/
#DOCFILES=index.html mason.sgml mason.txt mason.html mason-1.html mason-2.html mason-3.html mason-4.html mason-5.html mason-6.html mason-7.html mason-8.html mason-9.html mason-10.html mason-11.html toc.gif prev.gif next.gif
MANDIR=$(DESTDIR)/usr/man/man1/
MANFILES=mason.1 mason-gui-text.1
SYSVDIR=$(DESTDIR)/etc/rc.d/init.d/
SYSVFILES=firewall
# SYSVDIR=/etc/rc.d/init.d/
# SYSVFILES=firewall
install:
@echo -n "Installing files... "
@echo -n "${BINFILES}... "
@install -o root -g root -m 0755 ${BINFILES} ${BINDIR}
@echo -n "lib directory... "
@install -o root -g root -m 0755 -d ${LIBDIR}
@echo -n "${LIBFILES}... "
@install -o root -g root -m 0644 ${LIBFILES} ${LIBDIR}
@echo -n "${LIBSCRIPTFILES}... "
@install -o root -g root -m 0755 ${LIBSCRIPTFILES} ${LIBSCRIPTDIR}
@echo -n "doc directory... "
@install -o root -g root -m 0755 -d ${DOCDIR}
@echo -n "${DOCFILES}... "
@install -o root -g root -m 0644 ${DOCFILES} ${DOCDIR}
@echo -n "${MANFILES}... "
@install -o root -g root -m 0644 ${MANFILES} ${MANDIR}
@echo -n "${SYSVFILES}... "
@install -o root -g root -m 0755 ${SYSVFILES} ${SYSVDIR}
@if [ ! -f ${LIBDIR}baserules ] ; then \
install -o root -g root -m 0600 ${LIBDIR}baserules.sample ${LIBDIR}baserules ; \
echo -n "baserules... " ; \
else \
echo -n "${LIBDIR}baserules already exists, not overwriting... " ; \
fi
@if [ ! -f ${CONFDIR}${CONFFILE} ] ; then \
install -o root -g root -m 0600 ${CONFFILE} ${CONFDIR}${CONFFILE} ; \
echo -n "${CONFFILE}... " ; \
else \
rm -f ${CONFDIR}${CONFFILE}.old ; \
mv -f ${CONFDIR}${CONFFILE} ${CONFDIR}${CONFFILE}.old ; \
install -o root -g root -m 0600 ${CONFFILE} ${CONFDIR}${CONFFILE} ; \
echo "" >>${CONFDIR}${CONFFILE} ; \
echo "#Your previous settings, if any:" >>${CONFDIR}${CONFFILE} ; \
cat ${CONFDIR}${CONFFILE}.old | grep -v "^#" | grep -v "^$$" >>${CONFDIR}${CONFFILE} ; \
echo -n "${CONFDIR}${CONFFILE} already exists, appending your settings to the new ${CONFFILE}... " ; \
fi
@echo done!
docs:
sgml2html --imagebuttons mason.sgml \
&& sgml2txt -f mason.sgml \
# && makedoc mason.txt mason.pdb 'The Mason HOWTO'
regress:
@if ./regression-test ; then \
echo Regression test succeeded. ; \
else \
echo Regression test failed, exiting. ; \
exit 1 ; \
fi
distribs: regress docs
@echo This should only need to be used by the author in
@echo packing up the mason package.
@cat /etc/services | grep -v PRIVATE >moreservices
cd .. \
&& tar cf - mason-${MASONVER}/ | \
gzip -9 > mason-${MASONVER}.tar.gz \
&& rm -f mason-current \
&& ln -sf mason-${MASONVER} mason-current \
&& tar cf - mason-current/* | \
gzip -9 > mason-current.tar.gz \
&& cp mason-${MASONVER}.tar.gz /usr/src/redhat/SOURCES/ \
&& cd mason-${MASONVER} \
&& cp -f redhat/mason.spec /usr/src/redhat/SPECS/ \
&& rpm --sign -ba /usr/src/redhat/SPECS/mason.spec \
&& mv -f /usr/src/mason-*.tar.gz /usr/src/mysource/ \
&& mv -f /usr/src/redhat/RPMS/noarch/mason-*.noarch.rpm /usr/src/mysource/ \
&& mv -f /usr/src/redhat/SRPMS/mason-*.src.rpm /usr/src/mysource/
mini-install:
cp -pf mason mason-decide mason-gui-text /usr/bin ; cp -pf masonlib baserules.sample /var/lib/mason
|