File: Makefile

package info (click to toggle)
mason 0.13.0.92-2
  • links: PTS
  • area: main
  • in suites: potato, woody
  • size: 780 kB
  • ctags: 86
  • sloc: sh: 1,342; makefile: 119
file content (114 lines) | stat: -rw-r--r-- 4,707 bytes parent folder | download
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
#
# Makefile for the Mason firewall builder
#
#Copyleft:
#    Mason interactively creates a Linux packet filtering firewall.
#    Copyright (C) 1998 William Stearns <wstearns@pobox.com>
#
#    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:  wstearns@pobox.com              (preferred)
#web:    http://www.pobox.com/~wstearns
#snail:  544 Winchester Place
#        Colchester VT, 05446, USA
#

# Modified for Debian GNU/Linux.
#Jeff - can we set this in the call to make (for example,  make DESTDIR=`pwd`/debian/tmp install )?
#DESTDIR = $(shell pwd)/debian/tmp
DESTDIR =

##Make sure mason has MASONVER updated when this changes
MASONVER = 0.13.0.92

#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=masonlib baserules.sample moreservices nmap-services regression-test
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
#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: docs
	@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 "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'

distribs: docs
	@echo This should only need to be used by the author in 
	@echo packing up the mason package.
	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 --target noarch -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/