Hello community,
here is the log from the commit of package capi4hylafax
checked in at Sun Aug 5 17:34:49 CEST 2007.
--------
New Changes file:
--- /dev/null 2006-09-20 18:56:23.000000000 +0200
+++ /mounts/work_src_done/STABLE/capi4hylafax/capi4hylafax.changes 2007-07-31 14:39:59.100555000 +0200
@@ -0,0 +1,7 @@
+-------------------------------------------------------------------
+Tue Jul 31 14:39:43 CEST 2007 - kkeil@suse.de
+
+- first standalone source
+
+
+
New:
----
capi4hylafax-01.03.00.tar.bz2
capi4hylafax.changes
capi4hylafax-secfix2.diff
capi4hylafax-secfix.diff
capi4hylafax.spec
capi4hylafax-suse.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ capi4hylafax.spec ++++++
#
# spec file for package capi4hylafax (Version 01.03.00)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: capi4hylafax
BuildRequires: capi4linux capi4linux-devel gcc-c++ ghostscript-library libpng-devel libtiff-devel pwdutils
Excludearch: s390 s390x
Group: Hardware/Fax
Requires: hylafax tiff gs_lib smtp_daemon a2ps hylafax-client
Autoreqprov: on
Version: 01.03.00
Release: 1
Source: %{name}-%{version}.tar.bz2
Patch0: capi4hylafax-suse.diff
Patch1: capi4hylafax-secfix.diff
Patch2: capi4hylafax-secfix2.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: Adds a faxcapi modem for hylafax
PreReq: sh-utils fileutils %insserv_prereq %fillup_prereq /usr/sbin/useradd /usr/sbin/usermod
License: GPL v2 or later
URL: http://www.avm.de
Summary: Adds a faxcapi modem for hylafax
%description
capi4hylafax adds a faxcapi modem to the hylafax environment. So you
can send and receive FAX documents with CAPI 2.0 fax controllers via a
hylafax server.
Authors:
--------
AVM
%prep
%setup -q -n %{name}-%{version}
%patch -p1
%patch1 -p1
%patch2 -p1
find ../ -name .cvsignore -exec rm {} \;
%build
%{?suse_update_config:%{suse_update_config -f}}
CFLAGS=$RPM_OPT_FLAGS CXXFLAGS=$RPM_OPT_FLAGS \
./configure --prefix=/usr \
--with-hylafax-spooldir=/var/spool/fax
# --enable-debug
make
%install
install -d ${RPM_BUILD_ROOT}/var/spool/fax
install -d ${RPM_BUILD_ROOT}/usr/lib
install -d ${RPM_BUILD_ROOT}/usr/%_lib
install -d ${RPM_BUILD_ROOT}/usr/sbin
install -d ${RPM_BUILD_ROOT}/etc
make install BIN=${RPM_BUILD_ROOT}/usr/bin \
SPOOL=${RPM_BUILD_ROOT}/var/spool/fax \
LIBEXEC=${RPM_BUILD_ROOT}/usr/lib/fax \
SBIN=${RPM_BUILD_ROOT}/usr/sbin \
LIBDIR=${RPM_BUILD_ROOT}/usr/%_lib \
DESTDIR=${RPM_BUILD_ROOT}
install -m755 faxaddmodem.capi ${RPM_BUILD_ROOT}/usr/sbin/
install -m755 setupconffile ${RPM_BUILD_ROOT}/usr/sbin/faxaddmodem.capi_dia
cp -p config.faxCAPI ${RPM_BUILD_ROOT}/etc/config.faxCAPI.sample
mkdir -p ${RPM_BUILD_ROOT}%{_defaultdocdir}/capi4hylafax
cp -p AUTHORS LIESMICH.html README.html fritz_pic.tif COPYING Readme_src \
LIESMICH.SuSE README.SuSE \
ChangeLog sample_AVMC4_config.faxCAPI sample_faxrcvd \
config.faxCAPI \
${RPM_BUILD_ROOT}%{_defaultdocdir}/capi4hylafax
%pre
/usr/sbin/useradd -r -o -g uucp -u 33 -s /bin/bash -c "Facsimile agent" -d /var/spool/fax fax 2> /dev/null || :
/usr/sbin/usermod -g uucp -G dialout fax 2> /dev/null || :
test -f /var/spool/fax/etc/config.faxCAPI -a ! -f /etc/config.faxCAPI && \
cp -a /var/spool/fax/etc/config.faxCAPI /etc/config.faxCAPI || :
%clean
[ "${RPM_BUILD_ROOT}" != "/" ] && [ -d ${RPM_BUILD_ROOT} ] && rm -rf ${RPM_BUILD_ROOT};
%post
#!/bin/sh
cd etc
FILES=`grep -l "FaxReceiveUser:" config.fax*`
test -z "$FILES" && exit
CFG=""
for f in $FILES ; do
case $f in
*~);;
*orig);;
*save);;
*new);;
*sample);;
*) FRG=`grep "FaxReceiveGroup:" $f`
if [ -z "$FRG" ]; then
CFG="${CFG} $f"
fi
;;
esac
done
test -z "$CFG" && exit
for f in $CFG ; do
mv ${f} ${f}.orig
cat ${f}.orig | while read line ; do
case $line in
FaxReceiveUser:*)
echo "FaxReceiveUser: fax" >> ${f}
echo "FaxReceiveGroup: dialout" >> ${f}
;;
*) echo "$line" >> ${f}
;;
esac
done
done
%files
%defattr(-, root, root)
%doc %{_defaultdocdir}/capi4hylafax
/usr/bin/c2faxrecv
/usr/bin/c2faxsend
/usr/sbin/faxaddmodem.capi
/usr/sbin/faxaddmodem.capi_dia
/etc/config.faxCAPI.sample
%changelog
* Tue Jul 31 2007 - kkeil@suse.de
- first standalone source
++++++ capi4hylafax-secfix2.diff ++++++
Index: capi4hylafax-01.03.00/src/faxrecv/faxrecv.cpp
===================================================================
--- capi4hylafax-01.03.00.orig/src/faxrecv/faxrecv.cpp
+++ capi4hylafax-01.03.00/src/faxrecv/faxrecv.cpp
@@ -331,7 +331,7 @@ void CFaxReceive::IsDisconnected (c_info
}
// Hylafax: <qfile> <ModemDeviceID> <CommID> <Reason> <CIDNumber> <CIDName> <destination>
- executeCommand.PrintAppend (" \"%S\" \"%S\" \"%09u\" \"%s\" \"%S\" \"\" \"%S\"",
+ executeCommand.PrintAppend (" \"%eS\" \"%eS\" \"%09u\" \"%es\" \"%eS\" \"\" \"%eS\"",
GetRecvFiles()->GetFirst(), &FaxDevice->DeviceName, jobNr,
StateText, GetReceiveID(), &MyNumber);
WriteXferLog ("RECV", jobNr, 0, 0, (char *)FaxDevice->DeviceName.GetPointer(), 0,
@@ -361,14 +361,14 @@ void CFaxReceive::IsDisconnected (c_info
}
executeCommand.PrintAppend (" %u 0x%X \"", recvStatus, Reason);
- executeCommand.Append (GetReceiveID());
+ executeCommand.PrintAppend ("%eS", GetReceiveID());
executeCommand.Append ("\" \"");
if (!MyNumber.IsEmpty()) {
- executeCommand.Append (&MyNumber);
+ executeCommand.PrintAppend ("%eS", &MyNumber);
}
executeCommand.PrintAppend ("\" %u", GetPageCount());
for (COneMultiString *pLauf = GetRecvFiles()->GetFirst(); (pLauf != 0); pLauf = pLauf->GetNext()) {
- executeCommand.PrintAppend (" \"%S\"", pLauf);
+ executeCommand.PrintAppend (" \"%eS\"", pLauf);
}
}
Index: capi4hylafax-01.03.00/src/faxsend/faxsend.cpp
===================================================================
--- capi4hylafax-01.03.00.orig/src/faxsend/faxsend.cpp
+++ capi4hylafax-01.03.00/src/faxsend/faxsend.cpp
@@ -572,7 +572,7 @@ void CFaxSend::IsDisconnected (c_info Re
commStr.Print ("%09u", m_commID);
// Hylafax: <mailaddr> <qfile> <ModemDeviceID> <CommID> <Reason>
- executeCommand.PrintAppend (" \"%S\" \"%S\" \"%S\" \"%S\" \"%s\"", &PollString,
+ executeCommand.PrintAppend (" \"%eS\" \"%eS\" \"%eS\" \"%eS\" \"%es\"", &PollString,
GetRecvFiles()->GetFirst(), &DeviceName, &commStr, StateText);
} else {
// mgetty: <RecvStatus> <Hangup Code> "<sender id>" "<poll text>" <nr of pages>
@@ -591,10 +591,10 @@ void CFaxSend::IsDisconnected (c_info Re
case 3:
break;
}
- executeCommand.PrintAppend (" %u 0x%X \"%S\" \"%S\" %u", recvStatus, Reason, GetReceiveID(),
+ executeCommand.PrintAppend (" %u 0x%X \"%eS\" \"%eS\" %u", recvStatus, Reason, GetReceiveID(),
&PollString, GetPageCount());
for (COneMultiString *pLauf = GetRecvFiles()->GetFirst(); (pLauf != 0); pLauf = pLauf->GetNext()) {
- executeCommand.PrintAppend (" \"%s\"", pLauf->GetPointer());
+ executeCommand.PrintAppend (" \"%es\"", pLauf->GetPointer());
}
}
Index: capi4hylafax-01.03.00/src/standard/CString.cpp
===================================================================
--- capi4hylafax-01.03.00.orig/src/standard/CString.cpp
+++ capi4hylafax-01.03.00/src/standard/CString.cpp
@@ -44,6 +44,9 @@
#define PRINTFLAGS_NEAR 0x0400 // Placeholder is a NEAR-pointer
#define PRINTFLAGS_QUESTION 0x0800 // Sizeof Char specified before string
#define PRINTFLAGS_STRINGTYPE 0x1000 // Placeholder is a CDynamicString-Pointer
+#define PRINTFLAGS_SHELLESCAPE 0x2000 // The placeholder should be filled in with
+ // a string suitable for passing to /bin/sh
+ // between double quotes.
/*===========================================================================*\
\*===========================================================================*/
@@ -389,6 +392,10 @@ tSInt CDynamicString::i_vPrintAppend (tF
PrtFlags |= PRINTFLAGS_SHORT;
break;
+ case 'e':
+ PrtFlags |= PRINTFLAGS_SHELLESCAPE;
+ break;
+
/*----- WIDTH or PRECISION-----*/
case '0':
if (PrtPreci == -2) {
@@ -580,13 +587,102 @@ tSInt CDynamicString::i_vPrintAppend (tF
PrtWidth = 0;
}
tSize endPos = curLen + copyBufLen;
- if (endPos >= GetMaxSize()) {
- if (DynExpand (endPos + 1) == vFalse) {
+ const tSize max_space_needed = endPos + ((PrtFlags & PRINTFLAGS_SHELLESCAPE) ? copyBufLen : 0);
+ if (max_space_needed >= GetMaxSize()) {
+ if (DynExpand (max_space_needed + 1) == vFalse) {
RETURN ('x', CSTRING_PRINT_MemoryError);
}
}
- dassert (endPos < GetMaxSize());
+ dassert (max_space_needed < GetMaxSize());
dassert (pntr != 0);
+ if (PrtFlags & PRINTFLAGS_SHELLESCAPE) {
+ const tChar * const c_bs = (tChar*) "\\";
+ const tChar * const c_0 = (tChar*) "\0";
+ const tChar * const c_dq = (tChar*) "\"";
+ const tChar * const c_d = (tChar*) "$";
+ const tChar * const c_bq = (tChar*) "`";
+ const tChar * const c_qm = (tChar*) "?";
+ // Note that in this case, PrtWidth refers to the string _after_
+ // interpretation by /bin/sh, i.e. after the escaping is removed.
+ if (PrtFlags & PRINTFLAGS_STRINGTYPE) {
+ const tStringChar *p = (tStringChar*)copyBuf;
+ const tStringChar * const p_end = p + copyBufLen;
+ for (;p < p_end; ++p) {
+ if (!s_strncmp(p,c_0,1)) {
+ s_strncpy (pntr + curLen, c_qm, 1);
+ } else {
+ if (!(s_strncmp(p,c_dq,1) &&
+ s_strncmp(p,c_bs,1) &&
+ s_strncmp(p,c_d ,1) &&
+ s_strncmp(p,c_bq,1))) {
+ s_strncpy (pntr + curLen, c_bs, 1);
+ ++curLen;
+ ++endPos;
+ }
+ s_strncpy (pntr + curLen, p, 1);
+ }
+ ++curLen;
+ }
+ } else if (PrtFlags & PRINTFLAGS_LARGE) {
+ const tUWiChar *p = (tUWiChar*)copyBuf;
+ const tUWiChar * const p_end = p + copyBufLen;
+ for (;p < p_end; ++p) {
+ if (!s_strncmp(p,c_0,1)) {
+ s_strncpy (pntr + curLen, c_qm, 1);
+ } else {
+ if (!(s_strncmp(p,c_dq,1) &&
+ s_strncmp(p,c_bs,1) &&
+ s_strncmp(p,c_d,1) &&
+ s_strncmp(p,c_bq,1))) {
+ s_strncpy (pntr + curLen, c_bs, 1);
+ ++curLen;
+ ++endPos;
+ }
+ s_strncpy (pntr + curLen, p, 1);
+ }
+ ++curLen;
+ }
+ } else if (PrtFlags & PRINTFLAGS_SHORT) {
+ const tUChar *p = (tUChar*)copyBuf;
+ const tUChar * const p_end = p + copyBufLen;
+ for (;p < p_end; ++p) {
+ if (!s_strncmp(p,c_0,1)) {
+ s_strncpy (pntr + curLen, c_qm, 1);
+ } else {
+ if (!(s_strncmp(p,c_dq,1) &&
+ s_strncmp(p,c_bs,1) &&
+ s_strncmp(p,c_d,1) &&
+ s_strncmp(p,c_bq,1))) {
+ s_strncpy (pntr + curLen, c_bs, 1);
+ ++curLen;
+ ++endPos;
+ }
+ s_strncpy (pntr + curLen, p, 1);
+ }
+ ++curLen;
+ }
+ } else {
+ dassert((sizeof tChar)== (sizeof tFormatChar));
+ const tChar *p = (tChar*)copyBuf;
+ const tChar * const p_end = p + copyBufLen;
+ for (;p < p_end; ++p) {
+ if (!s_strncmp(p,c_0,1)) {
+ s_strncpy (pntr + curLen, c_qm, 1);
+ } else {
+ if (!(s_strncmp(p,c_dq,1) &&
+ s_strncmp(p,c_bs,1) &&
+ s_strncmp(p,c_d,1) &&
+ s_strncmp(p,c_bq,1))) {
+ s_strncpy (pntr + curLen, c_bs, 1);
+ ++curLen;
+ ++endPos;
+ }
+ s_strncpy (pntr + curLen, p, 1);
+ }
+ ++curLen;
+ }
+ }
+ } else {
if (PrtFlags & PRINTFLAGS_STRINGTYPE) {
s_strncpy (pntr + curLen, (tStringChar *)copyBuf, copyBufLen);
} else if (PrtFlags & PRINTFLAGS_LARGE) {
@@ -596,6 +692,7 @@ tSInt CDynamicString::i_vPrintAppend (tF
} else {
s_strncpy (pntr + curLen, copyBuf, copyBufLen);
}
+ }
pntr[endPos] = '\0';
curLen = endPos;
if ((PrtWidth > copyBufLen) && (FillAppend (' ', PrtWidth - copyBufLen) == vFalse)) {
Index: capi4hylafax-01.03.00/src/standard/aTypes.h
===================================================================
--- capi4hylafax-01.03.00.orig/src/standard/aTypes.h
+++ capi4hylafax-01.03.00/src/standard/aTypes.h
@@ -29,6 +29,7 @@
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
+#include // should give __WORDSIZE
#include
#if defined HAVE_STDINT_H && HAVE_STDINT_H > 0
++++++ capi4hylafax-secfix.diff ++++++
Index: capi4hylafax-01.03.00/config.faxCAPI
===================================================================
--- capi4hylafax-01.03.00.orig/config.faxCAPI
+++ capi4hylafax-01.03.00/config.faxCAPI
@@ -95,9 +95,9 @@ FaxReceiveGroup: dialout
#
# Information about the order of events in faxing are saved in the "LogFile".
#
-# default "/tmp/capifax.log"
+# default "/var/log/capifax.log"
#
-LogFile: /tmp/capifax.log
+LogFile: /var/log/capifax.log
# Der Befehl "LogTraceLevel" gibt die Menge der Daten an, die in ein LogFile
Index: capi4hylafax-01.03.00/LIESMICH.html
===================================================================
--- capi4hylafax-01.03.00.orig/LIESMICH.html
+++ capi4hylafax-01.03.00/LIESMICH.html
@@ -362,7 +362,7 @@
<LI>Zum Faxempfang führen Sie einfach "c2faxrecv &", zum Beispiel in einem Startskript, aus, wenn es nicht bereits in "etc/inittab" erfolgt ist.</LI>
<LI>"Device"-Namen: Da die Anwendungen als CAPI 2.0-Anwendungen auf CAPI 2.0 direkt aufsetzen, ist diese Angabe eigentlich nicht nötig. In der Kommandozeile kann der Name des Gerätes (device) angegeben werden, HylaFAX trägt diesen Eintrag aber automatisch ein. Dieser Name wird nur zur Signalisierung an HylaFAX und zur Bestimmung des Namens der Konfigurationsdatei benutzt: "config.[Device Name]". Auf diesem Wege können also auch mehrere "c2faxrecv"-Dämons inklusive ihrer Konfigurationsdateien verwaltet werden. Eine alternative Möglichkeit ist der "-C"-Schalter.</LI>
<LI>Sollten nach der Installation unerwartete Probleme beim Faxversand auftreten, so wurde die Konfigurationsveränderung durch HylaFAX eventuell noch nicht korrekt verarbeitet. In diesem Fall ist ein manueller Aufruf von "faxsetup" oder alternativ "faxmodem faxCAPI" als "root" mit den Rechten eines Superusers hilfreich, um HylaFAX die Änderung mitzuteilen.</LI>
- <LI>Für ein ausführliches Logging muss im config.faxCAPI das "#" vor dem Eintrag "LogTraceLevel:4" entfernt werden. Das Logfile wird standardmäßig unter "/tmp/capifax.log" abgelegt.</LI>
+ <LI>Für ein ausführliches Logging muss im config.faxCAPI das "#" vor dem Eintrag "LogTraceLevel:4" entfernt werden. Das Logfile wird standardmäßig unter "/var/log/capifax.log" abgelegt.</LI>
</UL>
<P><A HREF="#Inhalt">Zurück zum Anfang</A></P>
Index: capi4hylafax-01.03.00/README.html
===================================================================
--- capi4hylafax-01.03.00.orig/README.html
+++ capi4hylafax-01.03.00/README.html
@@ -341,7 +341,7 @@
<LI>For fax reception, simply run "c2faxrecv &", for instance in a start scrpt, if it has not already been run in "etc/inittab".</LI>
<LI>"Device" Name: Because the applications are CAPI 2.0 applications based directly on CAPI, this entry is not actually necessary. However, the name of the device can be entered in the commando line, or is entered automatically by HylaFAX. This name is used only for signaling to HylaFAX and to determine the name of the configuration file: "config.[Device Name]". Thus it is also possible to manage multiple "c2faxrecv" demons along with their configuration files. Another option is the "-C" switch.</LI>
<LI>If problems occur after installation during fax transmission, HylaFAX probably did not yet process the modifications in the configuration file correctly. In this case, entering "faxsetup" or "faxmodem faxCAPI" manually with "root" or superuser rights can be used to implement the changes in HylaFAX.</LI>
- <LI>For comprehensive logging, delete in canfig.faxCAPI the "#" preceding the "LogTraceLevel:4" entry. The log file is saved by default to "/tmp/capifax.log".</LI>
+ <LI>For comprehensive logging, delete in canfig.faxCAPI the "#" preceding the "LogTraceLevel:4" entry. The log file is saved by default to "/var/log/capifax.log".</LI>
</UL>
<P><A HREF="#Inhalt">Back to top</A></P>
Index: capi4hylafax-01.03.00/src/defaults.h.in
===================================================================
--- capi4hylafax-01.03.00.orig/src/defaults.h.in
+++ capi4hylafax-01.03.00/src/defaults.h.in
@@ -39,7 +39,7 @@
#define DEFAULT_FILE_MODE 0600
#define DEFAULT_RECVPROG_NAME "CapiFaxRecv"
#define DEFAULT_SENDPROG_NAME "CapiFaxSend"
-#define DEFAULT_C4H_LOGFILENAME "/tmp/capifax.log"
+#define DEFAULT_C4H_LOGFILENAME "/var/log/capifax.log"
#define FILE_EXTENSION_TIFF ".tif"
#define FILE_EXTENSION_SFF ".sff"
Index: capi4hylafax-01.03.00/src/faxrecv/faxrecv.cpp
===================================================================
--- capi4hylafax-01.03.00.orig/src/faxrecv/faxrecv.cpp
+++ capi4hylafax-01.03.00/src/faxrecv/faxrecv.cpp
@@ -213,7 +213,7 @@ void CFaxReceive::IsConnected (cp_ncpi_a
#ifdef GENERATE_DEBUGSFFDATAFILE
dwarning (DebugSffDataFile == 0);
if (!DebugSffDataFile) {
- DebugSffDataFile = fopen ("/tmp/c2faxrecv_dbgdatafile.sff", "w");
+ DebugSffDataFile = fopen ("/var/log/c2faxrecv_dbgdatafile.sff", "w");
}
#endif
NotifyFIFO ('I'); // Comm id
Index: capi4hylafax-01.03.00/src/faxsend/faxsend.cpp
===================================================================
--- capi4hylafax-01.03.00.orig/src/faxsend/faxsend.cpp
+++ capi4hylafax-01.03.00/src/faxsend/faxsend.cpp
@@ -428,7 +428,7 @@ void CFaxSend::IsConnected (cp_ncpi_all
} else {
#ifdef GENERATE_DEBUGSFFDATAFILE
dassert (DebugSffDataFile == 0);
- DebugSffDataFile = fopen ("/tmp/c2faxsend_dbgdatafile.sff", "w");
+ DebugSffDataFile = fopen ("/var/log/c2faxsend_dbgdatafile.sff", "w");
#endif
SendData();
}
Index: capi4hylafax-01.03.00/src/standard/ExtFuncs.h
===================================================================
--- capi4hylafax-01.03.00.orig/src/standard/ExtFuncs.h
+++ capi4hylafax-01.03.00/src/standard/ExtFuncs.h
@@ -26,7 +26,7 @@
#define USE_DEBUG_INFO_CLASS 2
#define DEBUG_INDENT_WIDTH 0
- //#define DEBUG_FILE_NAME "/tmp/c2faxfcalls.log"
+ //#define DEBUG_FILE_NAME "/var/log/c2faxfcalls.log"
#else
++++++ capi4hylafax-suse.diff ++++++
Index: capi4hylafax-01.03.00/setupconffile
===================================================================
--- capi4hylafax-01.03.00.orig/setupconffile
+++ capi4hylafax-01.03.00/setupconffile
@@ -12,6 +12,9 @@ InDDIs=""
FaxNumber="+49.00.00000"
Identifier="AVM CAPI4HylaFAX"
NumberPrefix=""
+AcceptSpeech=0
+AcceptGlobalCall=0
+
DDISamples=" DDI Params\n"
DDISamples="$DDISamples\nSample for DDI Offset : 11223344"
DDISamples="$DDISamples\nSample for DDI Length : 3"
@@ -36,6 +39,26 @@ function test_for_number {
return 0
}
+function ReadConfigFile {
+ while read item value; do
+ case $item in
+ "#");;
+ "FAXNumber:") FaxNumber=$value;;
+ "LocalIdentifier:") eval Identifier=$value ;;
+ "OutgoingMSN:") OutMSN=$value;;
+ "NumberPrefix:") NumberPrefix=$value;;
+ "UseDDI:") UseDDI=$value;;
+ "AcceptSpeech:") AcceptSpeech=$value;;
+ "AcceptGlobalCall:") AcceptGlobalCall=$value;;
+ "DDIOffset:") DDIOffset=$value;;
+ "DDILength:") DDILen=$value;;
+ "IncomingDDIs:") InDDIs=$value;;
+ "IncomingMSNs:") InMSNs=$value;;
+ *) ;;
+ esac
+ done < $1
+}
+
function WriteToConfigFile {
sed "
/^ *FAXNumber *:/c\\
@@ -48,6 +71,8 @@ sed "
NumberPrefix: $NumberPrefix
/^ *UseDDI *:/c\\
UseDDI: $UseDDI
+/^ *AcceptSpeech *:/c\\
+ AcceptSpeech: $AcceptSpeech
/^ *DDIOffset *:/c\\
DDIOffset: $DDIOffset
/^ *DDILength *:/c\\
@@ -55,7 +80,9 @@ sed "
/^ *IncomingDDIs *:/c\\
IncomingDDIs: $InDDIs
/^ *IncomingMSNs *:/c\\
- IncomingMSNs: $InMSNs" "$ConfigFileName" > "$ConfigFileName.c2fax"
+ IncomingMSNs: $InMSNs
+/^ *AcceptGlobalCall *:/c\\
+ AcceptGlobalCall: $AcceptGlobalCall" "$ConfigFileName" > "$ConfigFileName.c2fax"
mv -f "$ConfigFileName.c2fax" "$ConfigFileName"
}
@@ -101,6 +128,8 @@ if [ ! -e "$ConfigFileName" ] ; then
return 1
fi
+ReadConfigFile $ConfigFileName
+
#
# show info dialog
#
@@ -131,6 +160,16 @@ while [ $terminate -eq 0 ] ; do
if [ -n "$InMSNs" ] ; then
dialogInMSN="-- is set ---"
fi
+ if [ $AcceptSpeech -ne 0 ]; then
+ dialogAcceptSpeech="yes"
+ else
+ dialogAcceptSpeech="no"
+ fi
+ if [ $AcceptGlobalCall -ne 0 ]; then
+ dialogAcceptGlobalCall="yes"
+ else
+ dialogAcceptGlobalCall="no"
+ fi
if [ $UseDDI -ne 0 ] ; then
dialogDDI="-- use ddi --"
dialogInMSN="-- disabled -"
@@ -148,32 +187,52 @@ while [ $terminate -eq 0 ] ; do
dialogNumPre="[ empty ]"
fi
- dialog --backtitle "$BT" --clear \
- --menu "Main menu" 15 50 7 \
- "Outgoing MSN " "$dialogOutMSN" \
- "Incoming MSNs " "$dialogInMSN" \
- "DDI Params " "$dialogDDI" \
- "Fax Number " "$dialogFaxNum" \
- "Fax Identifier" "$dialogId" \
- "Number Prefix " "$dialogNumPre" \
- "Save & Exit " "" 2> res
+ dialog --backtitle "$BT" --clear \
+ --menu "Main menu" 17 60 9 \
+ "Outgoing MSN " "$dialogOutMSN" \
+ "Incoming MSNs " "$dialogInMSN" \
+ "Accept Speech " "$dialogAcceptSpeech" \
+ "Accept Global Calls" "$dialogAcceptGlobalCall" \
+ "DDI Params " "$dialogDDI" \
+ "Fax Number " "$dialogFaxNum" \
+ "Fax Identifier " "$dialogId" \
+ "Number Prefix " "$dialogNumPre" \
+ "Save & Exit " "" 2> res
if [ $? -eq 0 ] ; then
case "`cat res`" in
- "Outgoing MSN ")
+ "Outgoing MSN ")
dialog --backtitle "$BT" --clear \
--inputbox "Outgoing MSN" 9 50 "$OutMSN" 2> res
if [ $? -eq 0 ] ; then
OutMSN="`cat res`"
fi
;;
- "Incoming MSNs ")
+ "Incoming MSNs ")
dialog --backtitle "$BT" --clear \
--inputbox "List of Incomming MSNs (comma seperated)" 9 70 "$InMSNs" 2> res
if [ $? -eq 0 ] ; then
InMSNs="`cat res`"
fi
;;
- "DDI Params ")
+ "Accept Speech ")
+ dialog --backtitle "$BT" --clear \
+ --yesno "Accept also calls which a service id for speech ?" 7 30
+ if [ $? -eq 0 ] ; then
+ AcceptSpeech=1
+ else
+ AcceptSpeech=0
+ fi
+ ;;
+ "Accept Global Calls")
+ dialog --backtitle "$BT" --clear \
+ --yesno "Accept also global calls (calls without a MSN) ?" 7 30
+ if [ $? -eq 0 ] ; then
+ AcceptGlobalCall=1
+ else
+ AcceptGlobalCall=0
+ fi
+ ;;
+ "DDI Params ")
tmpDDIOffset=$DDIOffset
tmpDDILen=$DDILen
tmpInDDIs=$InDDIs
@@ -240,28 +299,28 @@ while [ $terminate -eq 0 ] ; do
done
terminate=0
;;
- "Fax Number ")
+ "Fax Number ")
dialog --backtitle "$BT" --clear \
--inputbox "Fax Number (use dots instead of spaces)" 9 50 "$FaxNumber" 2> res
if [ $? -eq 0 ] ; then
FaxNumber="`cat res`"
fi
;;
- "Fax Identifier")
+ "Fax Identifier ")
dialog --backtitle "$BT" --clear \
--inputbox "Fax Identifier" 9 50 "$Identifier" 2> res
if [ $? -eq 0 ] ; then
Identifier="`cat res`"
fi
;;
- "Number Prefix ")
+ "Number Prefix ")
dialog --backtitle "$BT" --clear \
--inputbox "Number Prefix" 9 50 "$NumberPrefix" 2> res
if [ $? -eq 0 ] ; then
NumberPrefix="`cat res`"
fi
;;
- "Save & Exit ")
+ "Save & Exit ")
WriteToConfigFile
terminate=1
;;
Index: capi4hylafax-01.03.00/faxaddmodem.capi
===================================================================
--- /dev/null
+++ capi4hylafax-01.03.00/faxaddmodem.capi
@@ -0,0 +1,84 @@
+#!/bin/bash
+#
+#
+#
+HylafaxSpoolDir="/var/spool/fax"
+ConfigFileName=config.faxCAPI
+DestDirectory=/usr/bin
+FAXUSER=fax
+FAXGROUP=dialout
+CFGFILEMODE=0644
+#
+#
+#
+function SetConfigLine {
+ if [ -z "$3" ] ; then
+ grep -v "$2.*:.*/c2fax" $1 > $1.new
+ else
+ gawk 'BEGIN {repl = 0} END {if (repl == 0) {print SEARCHIT":"REPLACEIT}}
+ {if ($1 != SEARCHIT) {print $0} else {repl = 1; print $1":"REPLACEIT}}
+ ' FS=':' IGNORECASE=1 SEARCHIT="$2" REPLACEIT="$3" $1 > $1.new
+ fi
+ if [ "$4" != "no" ] ; then
+ mv $1 $1.c2fax
+ fi
+ mv $1.new $1
+}
+
+
+#
+#
+#
+if [ ! -e $HylafaxSpoolDir/etc/config ] ; then
+ echo ""
+ echo "Can't find Hylafax's config file: $HylafaxSpoolDir/etc/config."
+ echo "Please run faxsetup before setting up capi modems"
+ exit 1
+fi
+
+#
+#
+#
+if [ -e "/etc/$ConfigFileName" ] ; then
+ echo "Backup /etc/$ConfigFileName to /etc/$ConfigFileName.c2fax"
+ cp "/etc/$ConfigFileName" "/etc/$ConfigFileName.c2fax"
+elif [ -e "/etc/$ConfigFileName.sample" ] ; then
+ cp "/etc/$ConfigFileName.sample" "/etc/$ConfigFileName"
+elif [ -e "/usr/share/doc/packages/capi4hylafax/$ConfigFileName" ] ; then
+ cp "/usr/share/doc/packages/capi4hylafax/$ConfigFileName" "/etc/$ConfigFileName"
+else
+ echo "No sample configfile for /etc/$ConfigFileName"
+ echo "found, cannot create one, exit"
+ exit
+fi
+
+ConfigFileName="/etc/$ConfigFileName"
+SetConfigLine "$ConfigFileName" SpoolDir "\t\t$HylafaxSpoolDir" no
+SetConfigLine "$ConfigFileName" FaxRcvdCmd "\t\t$HylafaxSpoolDir/bin/faxrcvd" no
+
+#
+# capi devices should owned by uucp
+#
+chown uucp /dev/capi*
+
+# adjust hylafax config file and inittab
+echo "Change $HylafaxSpoolDir/etc/config and /etc/inittab."
+SetConfigLine $HylafaxSpoolDir/etc/config SendFaxCmd "\t\t$HylafaxSpoolDir/bin/faxsend"
+SetConfigLine /etc/inittab fr "35:respawn:$DestDirectory/c2faxrecv -q \"$HylafaxSpoolDir\""
+
+. /usr/sbin/faxaddmodem.capi_dia $HylafaxSpoolDir
+
+main_config_dialog "$ConfigFileName"
+
+# fixup permissions
+chmod $CFGFILEMODE $HylafaxSpoolDir/etc/config*
+chmod $CFGFILEMODE /etc/config.faxCAPI*
+chmod $CFGFILEMODE /etc/inittab
+chown ${FAXUSER}:${FAXGROUP} $HylafaxSpoolDir/etc/config*
+chown ${FAXUSER}:${FAXGROUP} /etc/config.faxCAPI*
+
+# that was it
+
+echo -e "\nInstall was successfully!\n"
+echo "The Fax Receive Daemon c2faxrecv was added to /etc/inittab and will be started"
+echo "automatically on system start. You could start it manually now with telinit q."
Index: capi4hylafax-01.03.00/README.SuSE
===================================================================
--- /dev/null
+++ capi4hylafax-01.03.00/README.SuSE
@@ -0,0 +1,12 @@
+Short hints for using capi4hylafax under SuSE Linux
+
+1. call faxsetup and follow the dialog
+2. call faxaddmodem, answer the first question
+ "Do you want setup a CAPI 2.0 based ISDN modem"
+ with yes, follow the dialog.
+3. start c2faxrecv via telinit -q
+
+After this fax receiving and sending should work you can test it for example
+with:
+sendfax -d <FaxPhoneNumber> <this file>
+
Index: capi4hylafax-01.03.00/LIESMICH.SuSE
===================================================================
--- /dev/null
+++ capi4hylafax-01.03.00/LIESMICH.SuSE
@@ -0,0 +1,16 @@
+Einige kurze Hinweise zur Benutzung von capi4hylafax unter SuSE Linux
+
+1. faxsetup starten und entsprechend configurieren
+2. faxaddmodem starten und die Frage
+ "Do you want setup a CAPI 2.0 based ISDN modem"
+ mit yes beantworten.
+3. Starten des c2faxrecv daemons durch telinit -q
+
+Danach sollte der Faxempfang und das Faxsenden funktionieren.
+Sie k�nnen das z.B. mit
+sendfax -d <Rufnummer> <dieses file>
+
+ein Testfax verschicken.
+
+Um aus anderen Anwendungen Faxe zu verschicken siehe
+http://sdb.suse.de/de/sdb/html/ghillie_hylafax_einrichten.html
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org