home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
unix
/
volume24
/
faxpax
/
part02
/
FaxConfig
Wrap
Text File
|
1991-03-12
|
26KB
|
973 lines
#!/bin/sh
#
# $Header: FaxConfig, 2.2.91, ks
# basically a [very much] stripped down and ripped off version of rn/Configure
# where it says:
# Yes, you may rip this off to use in other distribution packages.
# so I did
n=''
c=''
contains=''
modemtypes='1'
charset='i'
device="/dev/not_that_one"
devlock="LCK..nosuchdevice"
dialstr=""
dialtype='T'
net='y'
netwide_fax="NETWIDE_FAX"
faxhost="faxhost"
faxadmin=`whoami`
faxadmin="$faxadmin@"`hostname`
faxfmode='0644'
faxlib='/usr/local/lib/faxlib'
faxspool='/usr/local/spool/fax'
fmtype="sierra"
localbin='/usr/local/bin'
loglevel='9'
manshelf='/usr/share/man'
maxresend='3'
maxage='1'
maxtry='5'
topspeed='7'
uucplocks='/var/spool/locks'
echo "Beginning of configuration questions for faxpak."
echo " "
: some greps do not return status, grrr.
echo "grimblepritz" >grimble
if grep blurfldyick grimble >/dev/null 2>&1 ; then
contains=contains
else
if grep grimblepritz grimble >/dev/null 2>&1 ; then
contains=grep
else
contains=contains
fi
fi
: sanity checks
PATH='.:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc'
export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$)
if test ! -t 0; then
echo "Type 'sh FaxConfig', not 'sh <FaxConfig'"
exit 1
fi
: first determine how to suppress newline on echo command
echo "Checking echo to see how to suppress newlines..."
(echo "hi there\c" ; echo " ") >.echotmp
if $contains c .echotmp >/dev/null 2>&1 ; then
echo "...using -n."
n='-n'
c=''
else
echo "...using \\\c."
n=''
c='\c'
fi
echo $n "Type carriage return to continue. Your cursor should be here-->$c"
read ans
rm .echotmp
: now set up to do reads with possible shell escape
: if this does not work on your machine, 1,$s/. myread/read ans/
cat <<EOSC >myread
ans='!'
while expr "X\$ans" : "X!" >/dev/null; do
read ans
case "\$ans" in
!)
sh
echo " "
echo $n "Your answer: $c"
;;
!*)
set \`expr "X\$ans" : "X!\(.*\)\$"\`
sh -c "\$*"
echo " "
echo $n "Your answer: $c"
;;
esac
done
EOSC
cat <<EOT
# general info
##############################################################################
This installation shell script asks you some questions regarding the
setup of faxpak. Currently there is no support for hardware other than
Sun Microsystems'. To port this to other machines run this script
anyway, but then have a close look at wiring.c. Wiring.c can be used
as a standalone test program with TESTING defined, and with TEST_DEVICE
defined to a port you can use for testing [you can reconfig any time],
preferably without interfering logins.
This script builds a header file faxconfig.h, a soft configuration file
fax,config, fax.1 man pages and, if you're lucky, two faxpak fonts.
Default answers are shown in [brackets]. Hitting carriage return accepts
the defaults. Once you have faxconfig.h and fax.config you can change
each file by editing it without re-running this script.
EOT
echo $n "[Type carriage return to continue] $c"
. myread
echo " "
cat <<EOT
##############################################################################
faxpak can run on networked and standalone machines.
If faxpak is networked, it is assumed that one HOST has the faxmodem[s],
with all other machines acting as CLIENTS, spooling outgoing fax jobs to
the faxhost.
The faxhosts' duty is to convert incoming text files into group 3 fax files,
and to do the actual transmission, to log what's going on, to report by
mail [if requested] and to do house keeping chores. This is done by entries
in root's crontab which calls sendfax frequently and faxcleanup once a day.
EOT
dflt=$net
echo $n "Do you expect to run faxpak on networked machines? [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
if [ $ans = y ]
then
cat <<EOT
# network info, don't really need much
######################################################################
"client" machines find the faxhost by calling gethostbyname(FAXHOST),
with FAXHOST #defined in faxconfig.h on our sita as "faxhost",
and with "faxhost" aliased in /etc/hosts to mbox. mbox is a 3/60 that
acts as our spooling machine [printing, faxing, mail, news archive etc.].
EOT
dflt=$faxhost
echo "Please enter the \"synonym\" your FAXHOST will be known by -"
echo $n "[I guess you could enter the name of a known machine]: [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
faxhost=$ans
else
net='n'
netwide_fax="nonet"
fi
cat <<EOT
# we need someone to blame when things go wrong
##############################################################################
The bad news is that things DO go wrong. Therefore we may need
someone to interfere by hand, or to lend a hand if a user needs help,
or to give the default answer ["You can't to that"].
EOT
dflt=$faxadmin
echo $n "Name a patient person suitable for dealing with fax problems: [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
faxadmin=$ans
# what arg do we give chmod()
##############################################################################
dflt=$faxfmode
echo $n "Please enter the file access perms to be enforced by faxpak: [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
faxfmode=$ans
cat <<EOT
# where to put faxlib and the spool dir
##############################################################################
To keep things somewhat organised we need to define a /someplace/faxlib,
and a /somewhere/spooldir for faxpak. I prefer to keep them separate from
distribution libs and spool dirs. I'd also like to know where you keep you
man pages.
EOT
dflt=$faxlib
echo $n "Please enter the path to faxlib: [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
faxlib=$ans
dflt=$faxspool
echo $n "And path to faxspool: [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
faxspool=$ans
dflt=$manshelf
echo $n "And your Manual Shelf: [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
manshelf=$ans
cat <<EOT
# find competing uucp locks
##############################################################################
Modem logins, uucp transmissions and faxes all the same time and on
the same modem tend become somewhat garbled. Tell me where uucp keeps
its lock files, so that sendfax dies away instantly if uucp is active
[it knows about logins on a port].
EOT
dflt=$uucplocks
echo $n "Where does uucp create its lock files: [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
uucplocks=$ans
cat <<EOT
# local bin for fax
##############################################################################
Assuming you don't put local executables into /usr/{bin,ucb}, we need
sort of a /local/bin to put the user interface [called fax] into.
EOT
dflt=$localbin
echo $n "Where do you keep local executables: [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
localbin=$ans
cat <<EOT
# max no of resends within one transmission
##############################################################################
The last hard wired bit of info is the number of resends. If a page is
garbled during transmission, the two hardware gizzmos, that is your
faxmodem on this side and the fax machine on the other end, can agree
to resend that page. I don't know if fax machines have a built in limit
for the number of resent pages, I do, however, feel safer if I know
sendfax doesn't spend all night resending a page. Having seen the different
levels of compliance to the CCITT specs, especially european fax machines',
I would doubt, if such a limit is enforced.
EOT
dflt=$maxresend
echo $n "How often do you permit the resending of a page within one call [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
maxresend=$ans
# have header info, get details for fax.config
##############################################################################
if [ $modemtypes = 2 ]
then
mtypestring="faxmodem type, currently class2 and sierra type modems are supported"
else
mtypestring="faxmodem type, currently only sierra type modems are supported"
fi
cat <<EOT
# soft configuration, saved in $faxlib/fax.config"
##############################################################################
Most of the configuration of faxpak can be changed after compiling faxpak.
Softwired details are stashed into $faxlib/fax.config, allowing for easy
alteration once you have faxpak working. The fax.config file stores:
1: the ports to which you have faxmodems connected *)
2: literal name of lockfile for each port, in case uucp uses these ports
as well as faxpak *)
3: $mtypestring
4: Tone or Pulse dialling
5: Highest speed your faxmodems are capable of [RTFFaxmodemM]
6: an optinal string to re-enable dialins on the port after sendfax is done,
see /etc/uucp/Dialers, or the modem docs, for examples
7: wildcarded dialcodes and times, faxes to these area codes are ok *)
8: max no of days a fax is allowed to sit in $faxspool
9: max no of attempts to send a fax
log level, 9 logs everything [huge!], 0 only some relevant info
FaxConfig only writes a preliminary file including some comments. Feel
free to edit it to your liking at any time.
*) these are best done with an editor, in fact, I don't even ask for
dialcode:time pairs. see the file fax.config when done with this script.
[you could also call this load sharing between you and me].
EOT
dflt=$device
echo $n "Please enter the first port to be used [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
device=$ans
dflt=$devlock
echo "Please enter lockname to block uucp while we're"
echo $n "sending out faxes [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
devlock=$ans
if [ $modemtypes = 2 ]
then
dflt=$fmtype
echo $n "Please enter modem type [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
fmtype=$ans
fi
dflt=$dialtype
echo $n "Please enter 'P' if you want pulse dialling [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
dialtype=$ans
dflt=$topspeed
echo "Please enter code for highest baud rate your modem can "
echo $n "fax at - see modem manual [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
topspeed=$ans
dflt=$dialstring
echo "If you feel brave enough [else leave blank and do later]"
echo $n "String to reenable dialins on ports used by faxmodems [$dflt] $c"
. myread
echo
dflt=$maxage
echo $n "How many days is a fax allowed to sit in the queue [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
maxage=$ans
dflt=$maxage
echo $n "How many attempts do you allow to connect to one phone no [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
maxtry=$ans
dflt=$loglevel
echo $n "What log level do you want sendfax [wiring for testing] to log at [$dflt] $c"
. myread
echo
case $ans in
'') ans=$dflt;;
esac
loglevel=$ans
cat <<EOT
# charset info
##############################################################################
Although I planned to support quite a few different character sets [with
the help of several netters] faxpak currently supports the following few.
For those poor souls whose expression is limited to 7 bits, the decision
must be based on rand().
Please enter the charset you want faxpak to use:
i iso 8859.1
p pc de facto [code page 850] standard *)
8 pc code page 861
*) Some people felt strongly the ibm pc code page 850 is NOT a de facto
standard. IMHO it is insofar as the uk, germany, switzerland and some
other mid european countries are concerned, where quite a chunk of
"the action" takes place. If you still disagree, don't use faxpak.
EOT
dflt=$charset
echo $n "What charset do you want to use [$dflt] $c"
. myread
echo
echo copying font definition for diy font kit
case $ans in
'p') cp faxhost/faxfonts/diy_ibmpc.def faxhost/faxfonts/diykit.def;;
'8') cp faxhost/faxfonts/diy_codep861.def faxhost/faxfonts/diykit.def;;
*) cp faxhost/faxfonts/diy_iso.def faxhost/faxfonts/diykit.def;;
esac
rm -f myread grimble
# have fax.config, write faxconfig.h and fax.config
###################################################
echo "writing faxconfig.h"
cat >faxconfig.h <<EOT
/*
fax configuration header [faxconfig.h],
shared by faxclient/fax.c, and faxhost/*.c
Copyright (C) 1991, klaus schallhorn, klaus@cnix.uucp
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in
all copies and that both that copyright notice and this permission
notice appear in supporting documentation.
This software is provided "as is" without express or implied warranty.
*/
#define $netwide_fax
/* some common bits 'n pieces */
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#define ERROR (-1)
#endif
#ifndef min
#define min(a,b) ((a<b)?a:b)
#define max(a,b) ((a>b)?a:b)
#endif
/* network stuff */
#ifdef NETWIDE_FAX
#define FAXHOST "$faxhost" /* get host by name */
#endif
/* application specific stuff */
#define FAXADMIN "$faxadmin" /* mail errors if !user */
#define FAXFMODE $faxfmode /* for chmod */
#define FAXSERVER "spool.fax" /* name of spool pgm */
#define FAXLIB "$faxlib" /* needed on faxhost only */
#define FAXSPOOL "$faxspool" /* needed on faxhost only */
#define UUCPLOCKS "$uucplocks" /* again host only */
#define LOCALBIN "$localbin" /* client && host, for fax.c */
#define MAX_RESEND $maxresend /* don't resend a page forever */
#define FAXLFONT "textfaxl.font" /* lores bitmap font from diykit */
#define FAXHFONT "textfaxh.font" /* hires bitmap font from diykit */
#define PSFONT "Courier-Bold12" /* ghostscript font */
#define MAX_FAX_LINES 2400 /* is a bit generous, so what */
#define COARSE 1 /* 204.15 by 97.79 dpi */
#define FINE 2 /* 204.15 by 195.58 dpi */
#define HP 3
#define ASCII 0 /* use hp laser jet compat font to create pbm */
#define PBM 1 /* use as is, sort of */
/* these aren't done yet, see wiring.c, why */
#define DVI 2 /* dvi2ps, NOT YET DONE */
#define GHOSTSCRIPT 3 /* ideas [not yet] stolen from mit ai labs */
#define HPCL 4 /* hp laser jet compat output */
/* fax modem specific bits */
#define BETA_FIRMWARE /* applies to wiring.c */
#define SIERRA /* type of fax modem */
#ifdef NEED_FAXTYPES /* needed in fax.c and spool.fax.c */
struct ftypes
{
char *typename;
int typeid;
} faxtypes[] =
{
"ascii", ASCII,
"pbm", PBM,
"dvi", DVI,
"postscript", GHOSTSCRIPT,
"hpcl" HPCL
};
#define MAX_FTYPE sizeof(faxtypes)/sizeof(struct ftypes)
#endif /* need fax types */
struct FAX
{
long spooled;
char user[80];
#ifdef JOBID
char jobid[80];
#endif
char dname[256];
char xname[256];
char **phone;
int tries,
hires,
uid,
now,
mail,
pages,
type,
phone_nos;
long tpos,
ppos;
};
EOT
echo "writing fax.config"
cat >fax.config <<EOT
# fax.config
# Copyright (C) 1991 klaus schallhorn, klaus@cnix.uucp
#
# Permission to use, copy, modify, and distribute this software
# and its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in
# all copies and that both that copyright notice and this permission
# notice appear in supporting documentation.
#
# This software is provided "as is" without express or implied warranty.
#
#
# fax devices
# ===========
# 2nd column contains the actual device for sendfax
# ie /dev/cua1
#
# 3rd col states lock name to be used so that uucp does not even try
# to interfere while we're faxing. Stating the lock name verbatim is
# essential since there are differences between HDB uucp and older/other
# versions.
# NOTE: if you don't share faxmodems with uucp, locknames don't really
# matter as long as each port has a distinctive lockname. fred1, fred2
# ... fredn would be acceptable.
#
# 4th col specifies the modem type connected to that port so sendfax knows
# how to talk to the hardware.
#
# 5th col is either T [as in tone dialling] or P [pulse].
#
# 6th col is highest speed you want to connect at, see your modem manual.
#
# 7th col is a string sent to the fax modem AFTER we've used it IF you
# want to enable incoming calls/getty, for a typical string see
# /etc/uucp/Diallers, string has to be "in quotes", absence of a string
# implies nothing to send.
#
# this is what fax.config looks here
# 1st 2nd 3rd 4th 5th 6th 7th
#device /dev/cua1 LCK..cua1 sierra T 7 "ATE1M0V1X1Q0S2=127S0=4S12=255"
#device /dev/cua2 LCK..cua2 sierra T 7 "ATE1M0V1X1Q0S2=127S0=4S12=255"
device $device $devlock $fmtype $dialtype $topspeed $dialstr
#
#
# phone bill saver
# ================
#
# I do not want faxes at peak rates, except local ones.
#
# long distance call phone nos start with a zero PLUS any combination of
# digits 1 to 9 [1-9][1-9]*
# NOTE: no zeros in 2nd or 3rd digit, except if 2nd digit > 1
#
# international ones start with 010 cty code PLUS any combination of 1 to 9
#
# This feature can be raped to make sure faxes to specific fax numbers
# are only sent at an acceptable [for the recipient] time, as shown in the
# first "hour entry". Hard coded phone nos should come before wild card
# entries.
#
# This sample states that long distance is ok from 6 pm to 6 am,
# international ones from 8 pm to 6 am
#
#hours 0104977777777 9 - 12 # this guy can only be sent to in the morning
#hours 01049123456 8 - 10 14 16 - 19
#hours 0[1-9][1-9]* 18 - 6 # as in 078 123 6789
#hours 0[2-9]* 18 - 6 # as in 030 455 6748
#hours 010[1-9]* 20 - 6 # as in 01049 30 345 6789
#
#
# max age of files in spool dir [days], fax is supposed to be fast!
# =============================
#
maxage $maxage
#
#
# max number of attempts to connect
# =================================
#
maxtry $maxtry
#
# log level
# =========
#
# 9 = everything
# 0 = errors, transmission times
# other useful levels are 3 and 5
#
loglevel $loglevel
#
#
# end of fax.config
EOT
# now save fax.1 man pages
##########################
echo "writing faxclient/fax.1 man pages"
cat >faxclient/fax.1 <<EOT
.TH fax 1 "Feb 4th, 1991"
.SH NAME
fax \- send a Group 3 fax via faxmodem.
.SH SYNOPSIS
fax phone_no [-a -f -h -l -m -n -r -s] file
.SH DESCRIPTION
Fax accepts ascii input and sends it as a group 3 fax
using a sierra type faxmodem. The first parameter is either
a phone number, an alias [see aliases] or a distribution list [see lists]
file name.
.sp
If the first parameter contains digits only, it is
assumed to be a phone number.
.sp
If your site does enforce permissions, you may have to ask your
administrator [$faxadmin] for permission to fax.
.SH PARAMETERS
.TP
.B -a'for the attention of...'
To specify a recipient within an organization for internal
routing. The string must be quoted so it's passed as one
argument to fax. It is then prepended to the outgoing message.
.TP
.B -f/absolute/font/path/fontfile
Use an alternative font. In addition to the default typewriter fonts
in low and high resolution fax knows about
HP Laserjet compatible fonts [up to 30 points in height]. These are
scaled to the resolution of the outgoing fax. Used with low resolution
the output is not pretty.
.TP
.B -h
Use high resolution mode [204 by 195 dots per inch]. This almost doubles
the transmission time.
.TP
.B -l
Use low resolution mode [204 by 97 dots per inch].
.TP
.B -m
Report by mail as soon as the fax has been sent. Fatal errors or failure
to deliver is reported back irrespectible of the mail flag setting.
.TP
.B -n
Send the fax "now" rather than at cheap rate, where "now" refers
to the next time the fax daemon runs. To bypass the time restrictions [if
any] you may need to have special permission.
.TP
.B -r'return fax number string'
This string is prepended to the outgoing fax to specify a return
fax number. Currently fax does not support incoming faxes.
.TP
.B -s
Save outgoing faxes in HOME/Fax.Sent/phone.date. Fax saves outgoing faxes in
files whose name is a concatenation of recipient and date. If the recipient
is not an alias and not a distribution list, the phone number is
used for the first part of the file name.
.PP
File is an ascii file containing a formatted message.
.SH DEFAULTS
You can override built in defaults by creating a file ".faxrc" in
your home directory. This file is consulted before fax reads
command line parameters.
.sp
Permitted default values in .faxrc are those that apply to
all outgoing faxes sent by one user. Command line option override
these dafaults, however.
.TP
.B font
The name of a font to be used by fax. The font has to be available
on the machine running the fax daemon. The fontfile
must be accessible to the fax daemon.
.TP
.B resolution
Can be high or low [see above]. Default: low.
.TP
.B mail
Set to yes for notification by mail. Default: no.
.TP
.B now
Set to yes for sending next time the fax queue is checked
for outgoing faxes. Default: no.
.TP
.B retfax
A string to be prepended all your outgoing faxes. No default string.
.TP
.B save
If set, saves files in HOME/Fax.Sent/phone.date. Default: no.
.SH ALIASES
If the first parameter to fax contains alphabetic characters, fax first
checks your HOME directory for a file fax.aliases. This file contains
a list of names, phone numbers, optionally ftao [for the attention of]
strings to be prepended to each outgoing fax. Anything appearing after a #
sign is treated as a comment.
.sp
A sample fax.aliases file might look:
.sp
.nf
fred 12345678 :For the attn of Fred Bloggs # comment
bill 98765
sue 765432389 :The Lady in Pink # another comment
.fi
.SH LISTS
If an alias is not found in fax.aliases, fax tries to open a distribution
list with the same name. Distribution lists are similar to alias files.
A sample distribution list might look:
.sp
.nf
12345678 :For the attn of Fred Bloggs # comment
98765
765432389 :The Lady in Pink # another comment
.fi
.SH INTERACTIVE USE
If fax is not given a file name on the command line, it reads
it's standard input until a line starting with a '.' is encountered,
or until EOF.
.sp
Entering of a fax can be aborted by hitting ^C. Entering ~v at the beginning of
a line calls the default editor, if specified by the environment variable
EDITOR, or /usr/ucb/vi.
.sp
Starting a line with ~p prints the message entered to far.
.SH AUTHOR
Klaus Schallhorn
.SH COPYRIGHT
Copyright (C) 1991 Klaus Schallhorn, klaus@cnix.uucp
.sp
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted, provided
that the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation. This software is provided "as is" without express or
implied warranty.
EOT
echo "writing Makefiles"
cat >Makefile <<EOT
# Makefile for faxpak
#
# Copyright (C) 1991 klaus schallhorn, klaus@cnix.uucp
#
CC = cc
CFLAGS = -O2
LDFLAGS = -s
FAXLIB = $faxlib
FAXFMODE = $faxfmode
LOCALBIN = $localbin
MANSHELF = $manshelf
SHELL = /bin/sh
SUBS = faxclient faxhost faxhost/faxfonts
all:
for i in \$(SUBS) ; do \
( cd \$\$i ; make \$(MFLAGS) 'CC=\$(CC)' 'CFLAGS=\$(CFLAGS)' 'LDFLAGS=\$(LDFLAGS)' all ); \
done
install:
for i in \$(SUBS) ; do \
( cd \$\$i ; make \$(MFLAGS) 'LOCALBIN=\$(LOCALBIN)' 'MANSHELF=\$(MANSHELF)' 'FAXLIB=\$(FAXLIB)' 'FAXFMODE=\$(FAXFMODE)' install ); \
done
clean:
-rm -f Part?? *.hdr fax.config
for i in \$(SUBS) ; do \
( cd \$\$i ; make \$(MFLAGS) clean ); \
done
EOT
cat >faxclient/Makefile <<EOT
# Makefile for faxclient
all: fax
fax: fax.o
cc -o fax \$(LDFLAGS) fax.o
fax.o: fax.c
cc \$(CFLAGS) -c fax.c
install: bininstall maninstall
bininstall: fax
cp fax \$(LOCALBIN)
maninstall: fax.1
cp fax.1 \$(MANSHELF)/man1
chmod 644 \$(MANSHELF)/man1/fax.1
clean:
-rm -f *.o *.a core fax
EOT
cat >faxhost/Makefile <<EOT
# Makefile for faxhost
FAXCLEANUP = faxcleanup.o faxlog.o
SENDFAX = sendfax.o wiring.o faxlog.o
SPOOLFAX = spool.fax.o faxlog.o
TEXTTOPBM = texttopbm.o fntwrite.o
FAXHDR = ../faxconfig.h
PGMS = faxcleanup sendfax spool.fax texttopbm
TEXTFILES = fax.config textfaxl.font textfaxh.font
all: \$(PGMS)
faxcleanup: \$(FAXHDR) \$(FAXCLEANUP)
cc -o faxcleanup \$(LDFLAGS) \$(FAXCLEANUP)
sendfax: \$(FAXHDR) sierracmd.h \$(SENDFAX)
cc -o sendfax \$(LDFLAGS) \$(SENDFAX)
spool.fax: \$(FAXHDR) \$(SPOOLFAX)
cc -o spool.fax \$(LDFLAGS) \$(SPOOLFAX)
texttopbm: \$(FAXHDR) \$(TEXTTOPBM)
cc -o texttopbm \$(LDFLAGS) \$(TEXTTOPBM)
install:
cp \$(PGMS) \$(FAXLIB)
cp ../fax.config \$(FAXLIB)
for i in \$(TEXTFILES) ; do \
( chmod \$(FAXFMODE) \$(FAXLIB)/\$\$i ); \
done
for i in \$(PGMS) ; do \
( chmod 0500 \$(FAXLIB)/\$\$i ); \
done
chmod 6711 \$(FAXLIB)/spool.fax
chown root.daemon \$(FAXLIB)/*
clean:
-rm -f *.o *.a core \$(PGMS)
EOT
cat >faxhost/faxfonts/Makefile <<EOT
# Makefile for faxhost/faxfonts
# path for textfax?.font is hardwired into diykit [in ../../faxconfig.h]
all: diykit lores.data hires.data \
$faxlib/textfaxl.font $faxlib/textfaxh.font
diykit: diykit.o
cc -o diykit \$(LDFLAGS) diykit.o
diykit.o: ../../faxconfig.h diykit.h diykit.c
cc \$(CFLAGS) -c diykit.c
# path for textfax?.font is hardwired into diykit [in ../../faxconfig.h]
$faxlib/textfaxl.font: lores.data
./diykit
$faxlib/textfaxh.font: hires.data
./diykit
lores.data: lores.uue
uudecode lores.uue && uncompress lores.data.Z
hires.data: hires.uue
uudecode hires.uue && uncompress hires.data.Z
install:
clean:
-rm -f *.o *.a *.data core diykit
EOT
# end of FaxConfig