head     1.9;
branch   ;
access   ;
symbols  apple:1.1;
locks    romig:1.9; strict;
comment  @# @;


1.9
date     93.06.12.00.56.34;  author romig;  state Exp;
branches ;
next     1.8;

1.8
date     93.01.07.13.03.21;  author romig;  state Exp;
branches ;
next     1.7;

1.7
date     92.04.14.17.16.41;  author romig;  state Exp;
branches ;
next     1.6;

1.6
date     91.11.16.11.36.15;  author romig;  state Exp;
branches ;
next     1.5;

1.5
date     91.10.15.13.34.10;  author romig;  state Exp;
branches ;
next     1.4;

1.4
date     91.10.15.13.12.21;  author romig;  state Exp;
branches ;
next     1.3;

1.3
date     91.08.22.23.11.58;  author romig;  state Exp;
branches ;
next     1.2;

1.2
date     91.05.28.17.27.09;  author romig;  state Exp;
branches ;
next     1.1;

1.1
date     90.12.17.11.33.52;  author romig;  state Exp;
branches ;
next     ;


desc
@Makefile for sources.
@


1.9
log
@various changes for 2.6pre
@
text
@#
# Makefile for the backup system.  Since it isn't wise (or possible)
# to run setuid or setgid perl scripts, we use a C wrapper program
# that is setgid which runs perl on the script.  So installation
# consists of putting a bunch of scripts somewhere and in putting the
# compiled wrappers somewhere.  
#
# This Makefile provides several entries:
#	all		compiles the wrappers
#	install		copies the wrappers and scripts as needed to
#			the suitable places.
#	clean		removes junk from this directory
#	print		prints everything
#
# There are several variables here at the beginning that you might
# want to hack on.
#

#
# PERL is the pathname of perl as installed on your systems.
#
PERL =	/usr/local/bin/dperl

#
# SDIR is the directory in which all scripts should be placed.
#
SDIR =	/usr/local/utils/nbu/scripts

#
# BDIR is the directory in which all binaries should be placed.
# MDIR is where the man pages are put.
#
BDIR =	/usr/local/utils/nbu
MDIR = /usr/local/man

#
# PRINTER is the name of the printer to print things to.  Note that
# the print: entry below uses 'enscript' and 'up' - you may need to
# change it to suit your environment (or get enscript and up!)
#
PRINTER =	np

#
# BACKUP is the name of the group that owns and can access the backup
# database files.  The backup programs run setgid to backup in the hopes
# that they will be able to write them.
#
BACKUP =	backup

#
# You might need to change these also...
#
RM =	/bin/rm
LN =	/bin/ln
CC =	cc
CP =	/bin/cp
CHGRP =	/bin/chgrp
CHMOD =	/bin/chmod
#
# What strrchr to use - strrchr or rindex.
#
STRRCHR = strrchr			# Suns, Encore, HP, BBN Butterfly
#STRRCHR = rindex			# Pyramid
#
# What setreuid to use - define SETRESUID if this system uses it rather than
# setreuid.
#
#SETRESUID = 				# Sun, Encore, Pyramid, Butterfly
#SETRESUID = -DSETRESUID		# HP
SETRESUID = -DSETUID			# Solaris

#
#----------------------------------------------------------------------
# The rest of the stuff shouldn't be changed in general.
#

#
# list of the executable programs we will generate from the wrapper.
#
EXEC =				\
	add-tape		\
	all-backups		\
	backup-dump		\
	backup-null		\
	backup-report		\
	backup-gtar		\
	check-backups		\
	clean-db		\
	db-edit			\
	do-backups		\
	getback			\
	getdata			\
	list-backups		\
	move-tape		\
	offsite			\
	pmt			\
	restore-dump		\
	restore-gtar		\
	reuse			\
	run-clean-db		\
	show			\
	single-begin		\
	single-end		\
	sybase-helper		\
	tape-check		\
	unlock-dumpdates

#
# list of the Perl scripts that are used in the backup system 
#
SCRIPTS = 			\
	add-tape.perl		\
	all-backups.perl	\
	backup-dump.perl	\
	backup-null.perl	\
	backup-report.perl	\
	backup-gtar.perl	\
	backuplib.perl		\
	check-backups.perl	\
	clean-db.perl		\
	db-edit.perl		\
	do-backups.perl		\
	getback.perl		\
	getdata.perl		\
	lib-db.perl		\
	lib-deadman.perl	\
	lib-lock.perl		\
	lib-log.perl		\
	lib-misc.perl		\
	lib-unctime.perl	\
	lib-tape.perl		\
	list-backups.perl	\
	move-tape.perl		\
	offsite.perl		\
	pmt.perl		\
	restore-dump.perl	\
	restore-gtar.perl	\
	reuse.perl		\
	run-clean-db.perl	\
	show.perl		\
	single-begin.perl	\
	single-end.perl		\
	sybase-helper.perl	\
	tape-check.perl		\
	unlock-dumpdates.perl

#
# other miscellaneous stuff
#
OTHER =	global.defs local.defs

#
# Man pages
#
MAN8 =	add-tape.8		\
	all-backups.8		\
	backup-report.8		\
	check-backups.8		\
	clean-db.8		\
	db-edit.8		\
	do-backups.8		\
	getback.8		\
	getdata.8		\
	list-backups.8		\
	move-tape.8		\
	offsite.8		\
	pmt.8			\
	reuse.8			\
	run-clean-db.8		\
	show.8			\
	single-begin.8		\
	single-end.8		\
	unlock-dumpdates.8

MAN5 =	backup.config.5		\
	backups.5

#
#----------------------------------------------------------------------
# The entry points...
#
# all: compiles everything, places it in the current directory.
#
all:	wrapper

#
# For all the things that use the wrapper, here's how to make them...
#	-DSETSAME tells wrapper to set the uid = euid and gid = egid
#	-DPERL is the path to perl
#	-DSCRIPT is the path to the script directory $SDIR
#
wrapper:	wrapper.c
	$(CC) -o wrapper -DSETSAME -DPERL=\"$(PERL)\" -DSCRIPT=\"$(SDIR)\" -DSTRRCHR=$(STRRCHR) $(SETRESUID) wrapper.c

#
# install: copy to SDIR and BDIR
#
install:	install-scripts install-other install-progs install-links

install-scripts:	maketime.scripts

install-progs:		maketime.progs

install-other:		maketime.other

install-links:		maketime.links

install-man:		maketime.man

maketime.other:		$(OTHER)
	@@for NAME in $? ; \
		do echo Installing $$NAME ; \
		$(CP) $$NAME $(SDIR) ; \
		$(CHMOD) 0644 $(SDIR)/$$NAME ; \
	done
	-touch maketime.other

maketime.scripts:	$(SCRIPTS)
	@@for NAME in $? ; \
		do echo Installing $$NAME ; \
		$(CP) $$NAME $(SDIR) ; \
		$(CHMOD) 0644 $(SDIR)/$$NAME ; \
	done
	-touch maketime.scripts

maketime.progs:		wrapper
	@@for NAME in $? ; \
		do echo Installing $$NAME ; \
		$(CP) $$NAME $(BDIR) ; \
		$(CHGRP) $(BACKUP) $(BDIR)/$$NAME ; \
		$(CHMOD) g+s $(BDIR)/$$NAME ; \
	done
	-touch maketime.progs

maketime.links:			
	@@for NAME in $(EXEC) ; \
		do echo Remake $$NAME link ; \
		$(RM) -f $(BDIR)/$$NAME ; \
		$(LN) -s $(BDIR)/wrapper $(BDIR)/$$NAME ; \
	done
	-touch maketime.links

maketime.man:		
	@@for NAME in $(MAN8) ; \
		do echo Install $$NAME ; \
		$(CP) ../man/$$NAME $(MDIR)/man8 ; \
	done
	@@for NAME in $(MAN5) ; \
		do echo Install $$NAME ; \
		$(CP) ../man/$$NAME $(MDIR)/man5 ; \
	done
	-touch maketime.man
	
#
# clean: clean up this messy directory
#
clean:
	$(RM) -i -f *~ *.o wrapper *.unknown maketime.*

#
# syntax: check perl syntax
#
syntax:
	@@for NAME in $(SCRIPTS) global.defs local.defs ; \
		do perl -c $$NAME ; \
	done

#
# variables: check for unknown variables
#
variables:
	-@@for NAME in $(SCRIPTS) ; \
		do echo $$NAME ; \
		NNAME=`basename $$NAME .perl` ; \
		perl -w -c $$NAME > $$NNAME.unknown 2>&1 ; \
	done

#
# print: print everything in a nice way
#
print:
	enscript -G -p - $(SCRIPTS) $(OTHER) wrapper.c | up -n 4up | lpr -P $(PRINTER)

@


1.8
log
@final version for 2.6beta
@
text
@d68 1
a68 1
SETRESUID = 				# Sun, Encore, Pyramid, Butterfly
d70 1
d104 1
d126 1
d143 1
@


1.7
log
@Misc. changes.
@
text
@d22 1
a22 1
PERL =	/usr/local/bin/perl
d31 1
d34 1
d83 2
d93 3
d97 1
d101 2
d113 2
d130 3
d134 1
d138 2
d149 26
d204 2
d222 1
a222 1
maketime.progs:		wrapper backup-init backup-cleanup
d231 1
a231 1
maketime.links:		
d239 11
d254 1
a254 1
	$(RM) -i -f *~ *.o wrapper *.unknown
@


1.6
log
@misc. fixes and neating
@
text
@d84 1
a84 1
	count-free		\
d87 1
a87 1
	hack			\
a88 1
	report			\
d91 1
d93 1
d107 1
a107 1
	count-free.perl		\
a108 1
	dumplib.perl		\
d110 7
a116 1
	hack.perl		\
a117 1
	report.perl		\
d120 1
d122 1
a122 1
	unctime.perl		\
d128 1
a128 1
OTHER =	backup.defs
d136 1
a136 1
all:	wrapper lock
a146 3
lock:		lock.c
	$(CC) -o lock -DSTRRCHR=$(STRRCHR) lock.c

d176 1
a176 1
maketime.progs:		wrapper lock backup-init backup-cleanup
d197 1
a197 1
	$(RM) -i -f *~ *.o wrapper lock 
d200 18
d221 1
a221 1
	enscript -G -p - $(SCRIPTS) $(OTHER) wrapper.c lock.c | up -n 4up | lpr -P $(PRINTER)
@


1.5
log
@Oops, added .perl where it was missing in the list of scripts.
@
text
@d77 17
a93 6
EXEC =	add-tape	reuse		clean-db	hack		\
	list-run-db	check-backups					\
	all-backups	do-backups					\
	backup-dump	backup-gtar					\
	getback		restore-dump	unlock-dumpdates		\
	count-free
d96 1
a96 1
# list of the scripts that get run by the wrappers
d98 20
a117 7
SCRIPTS = add-tape.perl		all-backups.perl	\
	check-backups.perl	clean-db.perl		\
	do-backups.perl		hack.perl		\
	list-run-db.perl	reuse.perl		\
	backup-dump.perl	backup-gtar.perl	\
	getback.perl		restore-dump.perl	\
	unlock-dumpdates.perl	count-free.perl
d122 1
a122 1
OTHER =	backup.defs backuplib.perl unctime.perl dumplib.perl
d147 1
a147 1
install:	install-scripts install-progs
d151 1
a151 1
install-progs:		 maketime.progs
d153 5
a157 1
maketime.scripts:	$(SCRIPTS) $(OTHER)
d163 8
d180 3
d188 1
a188 1
	-touch maketime.progs
d201 1
@


1.4
log
@add count-free and unlock-dumpdates
@
text
@d93 1
a93 1
	unlock-dumpdates	count-free
@


1.3
log
@changed restore.perl --> getback.perl
@
text
@a52 1
INSTALL =	/bin/install
d57 11
d81 2
a82 1
	getback		restore-dump
d92 2
a93 1
	getback.perl		restore-dump.perl
d115 1
a115 1
	$(CC) -o wrapper -DSETSAME -DPERL=\"$(PERL)\" -DSCRIPT=\"$(SDIR)\" wrapper.c
d117 2
a118 2
lock:		lock.o
	$(CC) -o lock lock.o
d123 1
a123 1
install:	maketime.scripts maketime.progs
d125 4
d132 2
a133 1
		$(INSTALL) -m 0644 $$NAME $(SDIR) ; \
d135 1
a135 1
	@@touch maketime.scripts
d149 1
a149 1
	@@touch maketime.progs
@


1.2
log
@Various fixes to accomodate new files.
@
text
@d70 2
a71 2
	backup		backup-dump	backup-gtar			\
	restore		restore-dump
d81 1
a81 1
	restore.perl		restore-dump.perl
@


1.1
log
@Initial revision
@
text
@d27 1
a27 1
SDIR =	/n/stellar/0/romig/bin/nbu
d67 5
a71 4
EXEC =	add-tape	all-backups	backup		backup-d	\
	check-backups	clean-db	do-backups	do-backups-d	\
	fake-tardates	gtar-d		hack		list-run-db	\
	reuse
a76 1
	backup-d.perl		backup.perl		\
d78 4
a81 4
	do-backups-d.perl	do-backups.perl		\
	fake-tardates.perl	gtar-d.perl		\
	hack.perl		list-run-db.perl	\
	reuse.perl
d86 1
a86 1
OTHER =	backup.defs backuplib.perl
d120 1
a120 1
maketime.progs:		wrapper lock
a144 2


@
