]> git.pld-linux.org Git - packages/efax.git/blob - efax.patch
- dropped pre-cvs changelog
[packages/efax.git] / efax.patch
1 diff -urN efax-0.9a-001114.org/efax.conf efax-0.9a-001114/efax.conf
2 --- efax-0.9a-001114.org/efax.conf      1970-01-01 01:00:00.000000000 +0100
3 +++ efax-0.9a-001114/efax.conf  2004-08-06 23:01:11.000000000 +0200
4 @@ -0,0 +1,409 @@
5 +#!/bin/sh
6 +# 
7 +# fax - script to make, send, receive, view or print a fax
8 +# Copyright 1993-1999 by Ed Casas 
9 +# 
10 +# --- Start of user configuration section --- 
11 +# 
12 +# Notes: 
13 +#
14 +#  - do not put spaces before or after the equal (=) signs.
15 +#
16 +#  - variables can also be set on the command line, for example:
17 +#       fax DEV=cua0 send file.ps
18 +#    or in a configuration file (see CONFIGFILES below)
19 +#
20 +
21 +# The names of the fax script, efax and efix, including full path
22 +# if necessary.
23 +
24 +FAX=/usr/bin/fax
25 +EFAX=/usr/bin/efax
26 +EFIX=/usr/bin/efix
27 +
28 +# The device to which the fax modem is connected (e.g. ttya for
29 +# /dev/ttya).  Use a dial-out (cua) device if available.  If
30 +# there are links to this device then all programs must use same
31 +# name or the UUCP locking mechanism will fail.  For example, if
32 +# /dev/modem is a link to /dev/cua1, then getty, uucp, kermit,
33 +# pppd, dip, etc. must *all* use either /dev/modem or /dev/cua1.
34 +
35 +DEV=modem
36 +
37 +# Your fax number in international format, 20 characters maximum.
38 +# Use only digits, spaces, and the "+" character.
39 +
40 +FROM="+48 00 0000000"
41 +
42 +# Your name as it should appear on the page header.
43 +
44 +NAME="from PLD system"
45 +
46 +# The preferred page size for creating and printing faxes.
47 +# Allowed values are "letter", "legal", and "a4".
48 +
49 +# PAGE=letter
50 +# PAGE=legal
51 +PAGE=a4
52 +
53 +# The type of printer. Use 'pcl' for HP-PCL or 'ps' for
54 +# Postscript.  See definition of PRINT (below) for more options.
55 +
56 +PRTYPE=ps                              # Postscript (e.g. Apple LaserWriter)
57 +# PRTYPE=pcl                           # HP-PCL (e.g. HP LaserJet) 
58 +
59 +# The command to print image files from standard input.  Typically
60 +# this is "lpr" or "lp".
61 +
62 +PRCMD="/usr/bin/lpr"
63 +
64 +# The command to view a Portable Gray Map (PGM) image from the
65 +# standard input.  Typically "xv -" or "xloadimage stdin".
66 +
67 +VIEWCMD="/usr/bin/xloadimage stdin"            # best
68 +# VIEWCMD="pnmtoxwd | xwud"            # slower alternative
69 +# VIEWCMD="xv -"                       # much slower alternative       
70 +
71 +# The name of the Ghostscript executable including full path if
72 +# necessary.  Only required if faxing Postscript files.
73 +
74 +GS=/usr/bin/gs
75 +
76 +# Dial string prefix and suffix such as T for tone dialing, P for
77 +# pulse dialing, 9 to get an external line, commas for delays or
78 +# W to wait for dial tone.  See definition of TELCVT below if you
79 +# have more complex requirements.
80 +
81 +DIALPREFIX="T"
82 +DIALSUFFIX=""
83 +
84 +# The name(s) of lock file(s) according to your system's
85 +# conventions. Protect with single quotes for delayed evaluation.
86 +# Add a leading '#' to the file name to use binary format.
87 +
88 +LOCK='-x /var/lock/LCK..$DEV'                  # modern systems
89 +# LOCK='-x /usr/spool/uucp/LCK..$DEV'          # older systems
90 +# LOCK='-x /var/lock/LCK..$DEV -x /var/spool/uucp/LCK..$DEV' # both
91 +# LOCK='-x #/usr/spool/uucp/LCK..$DEV'         # binary format
92 +# LOCK='-x /usr/spool/locks/LK.047.040.011'    # SysV style names
93 +# LOCK=''                                      # no lock file
94 +
95 +# Uncomment one of the following lines to force xon/xoff flow
96 +# control only if you have one of the types of modems listed.
97 +
98 +# FCINIT='-j\Q4'               # AT&T (Dataport, Paradyne)
99 +# FCINIT='-j\Q1'               # Motorola (Power Modem, 3400 Pro,...)
100 +# FCINIT='-j*F1'               # QuickComm (Spirit II)
101 +# FCINIT='-j&H2&I0&R1&D3I4'    # USR (Courier, Sportster)
102 +# FCINIT='-or'                 # Multi-Tech (for bit reversal)
103 +
104 +# FCINIT="$FCINIT -j+FBO=0"    # USR modems using Class 2.0
105 +
106 +# ****************************************************************
107 +# The remaining options probably won't need to be changed.
108 +# ****************************************************************
109 +
110 +# Configuration files that are sourced if they exist.  Comment
111 +# out if you don't need to use config files. Warning: any type of
112 +# shell command in these files will be executed.
113 +
114 +CONFIGFILES="/etc/efax.rc ${HOME:-~}/.efaxrc ./.efaxrc /etc/sysconfig/efax"
115 +
116 +# A command that will generate unique names for logs and received
117 +# files.  'date +%m%d%H%M%S' works on most systems.  Protect with
118 +# single quotes.
119 +
120 +TSTAMP='date +%m%d%H%M%S'
121 +# TSTAMP='echo $$'             # alternative - use process number
122 +
123 +# Shell command to convert aliases to phone numbers when sending
124 +# faxes.  When executed $1 will be the alias and $f the file name
125 +# to search.  The example below uses a directory file where alias
126 +# lines start with the keyword "fax" followed by the alias in
127 +# parentheses and a colon.  The remainder of the line is taken to
128 +# be the phone number. Other lines are ignored.  For example, if
129 +# one of the files in DIRFILES (defined below) contained the line
130 +# "fax(kpmg): 691-3031", you could use the command "fax send kpmg
131 +# invoice.24". Protect with single quotes.
132 +
133 +LOOKUP='eval sed -n -e "/^fax($1):/{" -e "s/^[^:]*://p" -eq -e"}" $f'
134 +
135 +# List of telephone directory file(s) to be searched.  The
136 +# default is the file .faxdir in the user's home directory.
137 +
138 +DIRFILES="${HOME:-.}/.faxdir"
139 +
140 +# Shell command to convert phone numbers to dial strings.  This
141 +# lets you to store numbers without the long distance or
142 +# alternate carrier access codes, passwords, accounting digits,
143 +# etc.  In the examples below this is used to convert numbers
144 +# beginning with '+'; the first substitution handles same-country
145 +# calls and the second handles international calls.
146 +
147 +TELCVT='sed -e s/+1/1/ -e s/+/011/'    # North America
148 +# TELCVT='sed -e s/+61/0/ -e s/+/0011/' # Australia
149 +# TELCVT='sed -e s/+44/0/ -e s/+/00/'  # UK
150 +# TELCVT='sed -e s/+49/0/ -e s/+/00/'  # Germany
151 +# TELCVT='sed -e s/+852// -e s/+/001/' # Hong Kong
152 +# TELCVT='sed -e s/+33// -e s/+/19W/'  # France (?)
153 +# TELCVT='sed -e s/+34/0/ -e s/+/07W/' # Spain
154 +# TELCVT='sed -e s/+1/10288/'          # use AT&T
155 +# TELCVT='sed -e s/+/T82W1682W9W/'     # get out of PBX
156 +
157 +# efix options to use a bitmap font for text-to-fax conversion.
158 +# The option -l66 puts 66 lines of text per page, -d1,1 sets 1
159 +# inch top & left margin.  Comment these out to use the built-in
160 +# font. Use "fax makefont" to make bitmap fonts from Postscript
161 +# fonts.
162 +
163 +# TEXTFONT="-l66 -d1,1 -f /usr/bin/efaxfont"
164 +
165 +# efax options to specify a different font for headers. Generate
166 +# using "fax makefont."
167 +
168 +# HDRFONT="-f /usr/bin/efaxfont"
169 +
170 +# Dimensions of page sizes.
171 +
172 +PAGE_letter="8.465x11in"       # fax width x letter length
173 +PAGE_legal="8.465x14in"                # fax width x legal length
174 +PAGE_a4="21x29.7cm"            # ISO A4
175 +
176 +# Default resolution for converting to fax format. Can only be
177 +# 204x196 or 204x98.
178 +
179 +RES=204x196                    # default "Fine" resolution (196 lpi)
180 +# RES=204x98                   # standard resolution (98 lpi)
181 +
182 +# When the print and view commands below are executed, $f will be
183 +# the input file name and $PAGEDIM will be one of the above page
184 +# dimensions. Protect with single quotes.
185 +
186 +# PRINT: A command to convert fax files to a printable format.
187 +# For printers other than Postscript or PCL you can use efix's
188 +# PBM output and an appropriate pbm filter (such as pbmtoepson)
189 +# or efix's Postsript output and Ghostscript as a filter. Change
190 +# the scaling (-s) and displacement (-d) options as required to
191 +# fit the image onto the area your printer can print.
192 +
193 +PRINT='$EFIX -ve -p$PAGEDIM -r300 -s0.98 -d0,0.125 -o$PRTYPE $f'
194 +
195 +# example using pbm utilities:
196 +# PRINT='$EFIX -ve -p$PAGEDIM -r60x72 -opbm $f | pbmtoepson'
197 +
198 +# example using Ghostscript:
199 +# PRINT='$EFIX -ve -p$PAGEDIM -r120x144 -ops $f | \
200 +#      $GS -q  -sPAPERSIZE=$PAGE -sDEVICE=epson -r120x144 \
201 +#      -dNOPAUSE -dSAFER -sOutputFile=- - '
202 +
203 +# VIEW: A command to convert fax files to PGM format for
204 +# previewing.  efix's pgm output reduces image dimensions by 4X.
205 +
206 +# VIEW='$EFIX -ve -p$PAGEDIM -r200 -opgm $f'   # 50dpi: fast, whole-page view
207 +VIEW='$EFIX -ve -p$PAGEDIM -r300 -opgm $f'     # 75dpi: slower, readable size
208 +
209 +# Commands to set up modem.  "-iZ -iE0&D2S7=120 -i&C0"
210 +# works with almost all modems.  See the efax(1) man page for
211 +# details.
212 +
213 +INIT="-iZ -i&FE0&D2S7=120 -i&C0"
214 +
215 +# Command(s) to reset modem when efax finishes. "-kZ" works in
216 +# almost all cases.
217 +
218 +RESET="-kZ"
219 +# RESET="-kZ -k&F+FCLASS=0"    # for modems that stay in fax mode after reset
220 +
221 +# Speaker mode(M) and loudness(L). Mn sets speaker mode where n
222 +# means: 0:never, 1:until carrier, 2:always, 3:on receive only.
223 +
224 +SPKR="-iM1L0"
225 +
226 +# Options to use a particular command sets.  Normally efax
227 +# selects the command set based on the modem's capabilities.  Use
228 +# -o1 to force Class 1, -o2 for Class 2 and -o0 for Class 2.0.
229 +# Class 2 is not the same as Class 2.0
230 +
231 +# CLASSINIT="-o1"      # Class 1
232 +# CLASSINIT=""         # Class 2
233 +# CLASSINIT="-o0"      # Class 2.0
234 +
235 +# The modem's capabilities for sending faxes.  Normally efax
236 +# chooses these by querying the modem.  "-c 1,3,0,0,0,0,0,0"
237 +# forces 9600 bps maximum speed.  See the efax(1) man page for a
238 +# description of the fields.
239 +
240 +# TXCAP="-c 1,3,0,2,0,0,0,0"
241 +
242 +# Capabilities for receiving faxes.  Usually the same as TXCAP.
243 +# If your modem only receives at 4800 bps use "-c 1,1,0,0,0,0,0,0".
244 +
245 +# RXCAP="$TXCAP"
246 +
247 +# Additional options required only for transmit or only for
248 +# receive.  None normally required.
249 +
250 +RXINIT=""
251 +TXINIT=""
252 +
253 +# Command to make a date for the page header. Protect with single
254 +# quotes.  'date "+%Y/%m/%d %H:%M"' works on most systems.
255 +
256 +DATECMD='date "+%Y/%m/%d %H:%M"'       # YYYY/MM/DD HH:MM (24hour)
257 +# DATECMD='date'                       # longer, more readable
258 +
259 +# Page header format.  You may use $DATE, $NAME, $FROM, $TO, and
260 +# "%d/%d" (for page number and count).  Protect with single
261 +# quotes.  Example: '$DATE $FROM $NAME p. %d/%d'.
262 +
263 +HDR='$DATE     $FROM      $NAME     p. %d/%d'
264 +
265 +# BUSYRETRIES is a list of delays in seconds between attempts to
266 +# redial busy numbers.  Comment out if you don't want to retry
267 +# busy numbers.
268 +
269 +BUSYRETRIES="30 60 120 300 60 600 60 60 1200 60 60"
270 +
271 +# FAILRETRIES is a list of delays in seconds between attempts to
272 +# retry failed transmissions.  Retries are only attempted if at
273 +# least one page was sent in the previous attempt. Retries
274 +# include only pages not already sent. Comment out if you don't
275 +# want to retry failed transmissions.
276 +
277 +FAILRETRIES="300 300"  # try two more times at 5 minute intervals
278 +
279 +# Command to run another program (efax) at a higher-than-normal
280 +# scheduling priority.  This command isn't used if it fails
281 +# (e.g. because the current user isn't privileged).  Comment this
282 +# out if it causes problems.
283 +
284 +NICE="nice -n -10"
285 +
286 +# Standard versions of commands that are often aliased.
287 +
288 +RM="/bin/rm -f"
289 +LS="/bin/ls"
290 +
291 +# Messages to display.  VERB sets the messages displayed (stderr)
292 +# and VERBLOG the messages written to log files (stdout).
293 +
294 +VERB="ewin"            # show errors, warnings, progress & negotiation
295 +VERBLOG="chewmainrxtf" # log everything
296 +
297 +# ****************************************************************
298 +# The remaining configuration options apply only to the `fax
299 +# answer' command.  You can ignore these if you will only be
300 +# running efax manually.  See "USING INIT TO RUN EFAX" in the
301 +# efax man page for more information.
302 +# ****************************************************************
303 +
304 +# device or file where fatal error messages should be written
305 +
306 +CONSOLE=/dev/console
307 +
308 +# The directory to store incoming faxes and log files.  This directory
309 +# should already exist and be writable by the user(s) of this script.
310 +
311 +FAXDIR=/var/spool/fax
312 +LOGDIR=/var/log/fax
313 +
314 +# The strftime(3) pattern that generates the file name for
315 +# received files.  For example, at 10:45:36 on February 25,
316 +# "%m%d%H%M%S" would produce 0225104536, "%j-%H%M" would produce
317 +# 056-1045, and %d%b%H%M 25Feb1045.
318 +
319 +ANSFNAME="%m%d%H%M%S"
320 +
321 +# umask for received files. Use 022 to allow anyone to retrieve faxes.
322 +
323 +UMASK=022
324 +
325 +# The user to be sent mail when a fax is received.
326 +
327 +FAXMGR=root
328 +
329 +# The sendmail executable including full path if necessary.  Only
330 +# required if forwarding received faxes by e-mail in $NOTIFY.
331 +
332 +SENDMAIL=/usr/sbin/sendmail
333 +
334 +# The command to execute when a fax is received.  Normally this
335 +# sends FAXMGR e-mail or prints the received fax.  The variable
336 +# $f will be the name of the log file, $FILES will contain the
337 +# names of the received files, and $REMID will have the remote ID
338 +# string or '?' if none. The faxmail function will e-mail the fax
339 +# as MIME image/tiff attachments.  Comment this out to do
340 +# nothing.  Protect with single quotes.
341 +
342 +NOTIFY='faxmail | $SENDMAIL $FAXMGR'
343 +# NOTIFY='mail -s "fax/message from $REMID: $FILES" $FAXMGR <$f'
344 +# NOTIFY='lpr $f ; $FAX print $OPT $FILES'
345 +
346 +# The number of rings to wait before answering.
347 +
348 +ANSRINGS=4
349 +
350 +# If you want to enable fax/data adaptive answer (AA) read the
351 +# efax man page and define DATAINIT to be the options that enable
352 +# AA. Note: AA does not work properly on some (2400/9600) modems
353 +# unless the modem initialization is done at 2400 bps (not
354 +# possible with efax). USR modems do not support modem adaptive
355 +# answer (+FAE=) in Class 1.  &C1 enables most modems' DCD line
356 +# so a signal can be sent to shells when a call is dropped.  You
357 +# must also define DCMD (see below).
358 +
359 +DATAOPT="-j&C1 -j+FCLASS=0 -jS7=30"
360 +# DATAINIT="$DATAOPT -j+FAE=1"         # Class 1 modem adaptive answer
361 +# DATAINIT="$DATAOPT -j+FAA=1"         # Class 2[.0] modem adaptive answer
362 +# DATAINIT="$DATAOPT -oa"              # software adaptive answer
363 +# DATAINIT="$DATAOPT"                  # data-only answer
364 +
365 +# If you have a voice modem and want to answer in voice mode
366 +# define VOICEINIT to be the options that enable voice mode.  You
367 +# must also set VCMD below. Voice support is not yet available.
368 +
369 +# VOICEINIT="-j#CLS=8"                 # Rockwell voice modems
370 +# VOICEINIT="-jM2L2#CLS=8#VLS=4"       #    with speaker on
371 +
372 +# Argument to exec(2) of "/bin/sh -c" for incoming data calls.
373 +# This command will usually exec getty(8) but can include other
374 +# commands to set up the serial port, etc.  Up to 6 %d arguments
375 +# are replaced by the baud rate following the CONNECT response
376 +# from the modem or 19200 if none.  If using getty_ps ensure
377 +# /etc/gettydefs has entries for all possible %d values
378 +# (e.g. 19200). Use 'nice' if required to reduce any special
379 +# priority set by NICE.
380 +
381 +DCMD="exec /sbin/getty -h $DEV %d vt100"       # for getty_ps (Linux)
382 +# DCMD="exec /sbin/agetty -h $DEV %d vt100"    # for agetty (Linux)
383 +# DCMD="exec pppd $DEV %d"                     # start PPP server
384 +
385 +# Argument to exec(2) of "/bin/sh -c" for incoming voice calls.
386 +# This command will usually be a shell script that interacts with
387 +# the caller by using efone to play/record audio and detect DTMF
388 +# tones.  Up to 6 %d arguments are replaced by the modem file
389 +# descriptor.  VCMD can "exec fax reanswer" to switch to fax or
390 +# data mode if required.
391 +
392 +FONE=/usr/bin/fone                             # minimal voice mail
393 +VCMD="exec $FONE %d"
394 +
395 +# The owner.group and mode to which "fax answer" sets the serial
396 +# device.  This allows non-root processes to grab the device from
397 +# efax even if a previous process (e.g. login) has changed it.
398 +# Comment out if you don't need to reset device ownership.
399 +
400 +OWNER=root.dialout             # typical
401 +# MODE=666             # anybody
402 +MODE=660               # only owner & group
403 +
404 +# Regular expression for efax exit codes in log files that will
405 +# *not* be saved.  For example, use [145] to ignore exits due to
406 +# `locked' (1), `no modem' (4), and `signal' (5) conditions
407 +
408 +NOLOG='[145]'
409 +
410 +# ****************************************************************
411 +# --- End of user configuration section ---
412 +# ****************************************************************
413 +
414 diff -urN efax-0.9a-001114.org/efaxio.c efax-0.9a-001114/efaxio.c
415 --- efax-0.9a-001114.org/efaxio.c       2004-08-06 22:51:02.000000000 +0200
416 +++ efax-0.9a-001114/efaxio.c   2004-08-06 22:51:10.000000000 +0200
417 @@ -2,6 +2,7 @@
418  #include <signal.h>    
419  #include <stdio.h>
420  #include <string.h>
421 +#include <time.h>
422  
423  #include "efaxio.h"            /* EFAX */
424  #include "efaxmsg.h"
425 diff -urN efax-0.9a-001114.org/fax efax-0.9a-001114/fax
426 --- efax-0.9a-001114.org/fax    2004-08-06 22:51:02.000000000 +0200
427 +++ efax-0.9a-001114/fax        2004-08-06 22:56:00.000000000 +0200
428 @@ -107,7 +107,7 @@
429  # out if you don't need to use config files. Warning: any type of
430  # shell command in these files will be executed.
431  
432 -CONFIGFILES="/etc/efax.rc ${HOME:-~}/.efaxrc ./.efaxrc"
433 +CONFIGFILES="/etc/efax.rc ${HOME:-~}/.efaxrc ./.efaxrc /etc/sysconfig/efax"
434  
435  # A command that will generate unique names for logs and received
436  # files.  'date +%m%d%H%M%S' works on most systems.  Protect with
This page took 0.101898 seconds and 3 git commands to generate.