File capi4hylafax.spec of Package capi4hylafax

# spec file for package capi4hylafax
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           capi4hylafax
Version:        01.03.00
Release:        0
Summary:        Adds a faxcapi modem for hylafax
License:        GPL-2.0+
Group:          Hardware/Fax

Patch0:         capi4hylafax-suse.diff
Patch1:         capi4hylafax-secfix.diff
Patch2:         capi4hylafax-secfix2.diff
Patch3:         capi4hylafax-configure.diff
Patch4:         capi4hylafax-gcc48.diff
Patch5:         capi4hylafax-01.03.00-fix-bashisms.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  capi4linux
BuildRequires:  capi4linux-devel
BuildRequires:  gcc-c++
BuildRequires:  ghostscript-library
BuildRequires:  libpng-devel
BuildRequires:  libtiff-devel
BuildRequires:  pwdutils
Requires:       a2ps
Requires:       gs_lib
Requires:       hylafax
Requires:       hylafax-client
Requires:       smtp_daemon
Requires:       tiff
Requires(pre):  sh-utils fileutils /usr/sbin/useradd /usr/sbin/usermod

capi4hylafax adds a faxcapi modem to the hylafax environment. It allows
you to send and receive FAX documents with CAPI 2.0 fax controllers via
a hylafax server.

%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch4 -p1
%patch5 -p1
find ../ -name .cvsignore -delete

%configure \
#		--enable-debug 
make %{?_smp_mflags}

install -d "%buildroot/var/spool/fax"
install -d "%buildroot/usr/lib"
install -d "%buildroot/%_libdir"
install -d "%buildroot/%_sbindir"
install -d "%buildroot/%_sysconfdir"
make install BIN="%buildroot/%_bindir" \
		SPOOL="%buildroot/var/spool/fax" \
		LIBEXEC="%buildroot/usr/lib/fax" \
		SBIN="%buildroot/%_sbindir" \
		LIBDIR="%buildroot/%_libdir" \
install -m755 faxaddmodem.capi "%buildroot/%_sbindir/"
install -m755 setupconffile "%buildroot/%_sbindir/faxaddmodem.capi_dia"
cp -p config.faxCAPI "%buildroot/%_sysconfdir/config.faxCAPI.sample"
mkdir -p "%buildroot/%_defaultdocdir/capi4hylafax"
cp -p AUTHORS LIESMICH.html README.html fritz_pic.tif COPYING Readme_src \
	ChangeLog sample_AVMC4_config.faxCAPI sample_faxrcvd \
	config.faxCAPI \

/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 || :

cd etc
FILES=`grep -l "FaxReceiveUser:" config.fax*`
test -z "$FILES" && exit
for f in $FILES ; do
    case $f in
	*)  FRG=`grep "FaxReceiveGroup:" $f`
	    if [ -z "$FRG" ]; then
		CFG="${CFG} $f"
test -z "$CFG" && exit
for f in $CFG ; do
    mv ${f} ${f}.orig
    cat ${f}.orig | while read line ; do
	case $line in
		echo "FaxReceiveUser:         fax" >> ${f}
		echo "FaxReceiveGroup:        dialout" >> ${f}
	    *)  echo "$line" >> ${f}

%defattr(-, root, root)
%doc %{_defaultdocdir}/capi4hylafax

openSUSE Build Service is sponsored by