: 'Procedure to compile & install hasp in $1 file sys - /usr if $1 null.'
: 'Does NOT make subdirectories rje rje/sque hasp hasp/job hasp/pool hasp/info.'
: 'If you are not running HASP, ASP, or JES, change the SFILES define'
: 'in hdisp.c to 1.  Jobs will then come back to /usr/hasp/job.'
: 'Run me as root!'

: '$2 : name of C compiler.  cc if null.'
= c $2 cc

pwd |= b
= f $1 /usr
echo "making library"
sh -v lib.rc $c
echo "compiling source"
as hmain.s
mv a.out hmain.o
ld -n hmain.o -lPW -lc
mv a.out haspmain
rm hmain.o
$c -s -O -n -o haspqer rjeqer.c lib1.a -lPW
$c -s -O -n -o haspqer2 rjeqer2.c lib1.a -lPW
$c -s -O -n -o haspdisp hdisp.c lib1.a -lPW
$c -s -O -n -o hasphalt rjehalt.c lib1.a -lPW
$c -s -O -n -o haspinit rjeinit.c lib1.a -lPW
$c -s -O -n -o haspnfy hnfy.c lib1.a -lPW
echo "making shqer. shqer runs jobs with uid 180. change define if needed."
$c -s -O -o shqer shqer.c lib1.a -lPW
$c -s -O -o compact compact.c
: program to print out usage stats if turned on
$c -s -O -o usage usage.c
$c -s -O -n -o haspcopy rjecopy.c -lPW
$c -s -O -n -o hasprecv hrecv.c -lPW
$c -s -O -n -o haspxmit hxmit.c -lPW
$c -O -o snoop0 snoop0.c
$c -O -o snoop1 snoop1.c
= a $f/hasp
cp testjob $a/testjob
cp badjob $a/badjob
mv snoop0 $a/snoop0
mv snoop1 $a/snoop1
mv compact $a/compact
mv usage $a/usage
mv haspqer $a/haspqer
mv haspqer2 $a/haspqer2
mv haspdisp $a/haspdisp
mv hasphalt $a/hasphalt
mv haspinit $a/haspinit
mv haspnfy $a/haspnfy
mv shqer $a/shqer
mv haspcopy $a/haspcopy
mv hasprecv $a/hasprecv
mv haspxmit $a/haspxmit
mv haspmain $a/haspmain
: lsl used for listing left over files to be cleaned out by ops
cp lsl $a/lsl
: ptrans file  --  prints a punch file in ascii
cp ptran $a/ptran
cp ptrans $a/ptrans
: scan used to scan log file. e.g. scan log 50 prints last 50 chars
cp scan $a/scan
chdir $a
chmod 444 badjob
chmod 440 testjob
chmod 550 snoop0 snoop1 compact usage haspqer haspdisp \
		hasphalt haspinit shqer haspcopy hasprecv haspxmit \
		haspmain lsl ptran ptrans scan
donate rje testjob badjob snoop0 snoop1 compact usage haspqer haspdisp \
		hasphalt haspinit shqer haspcopy hasprecv haspxmit \
		haspmain lsl ptran ptrans scan
chmod 0 shqer
chmod 4555 haspqer
chown rje haspqer2
chgrp ROOT haspqer2
chmod 2700 haspqer2
chown hasp haspnfy
chgrp ROOT haspnfy
chmod 2700 haspnfy
echo "DONE!"
