File hylafax+.spec of Package hylafax+
#
# spec file for package hylafax+
#
# Copyright (c) 2015 SUSE LINUX 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 http://bugs.opensuse.org/
#
%global faxspool /var/spool/hylafax
Summary: An enterprise-strength fax server
License: BSD-3-Clause
Group: Productivity/Telephony/Servers
Name: hylafax+
Version: 5.5.6
Release: 0%{?dist}
%if 0%{?fedora} >= 16
%else
%endif
Url: http://hylafax.sourceforge.net
Source0: http://downloads.sourceforge.net/hylafax/hylafax-%{version}.tar.gz
#%if 0%{?sles_version} < 1200
Source1: hylafax+_rh.init
#%endif
Source2: hylafax+_daily.cron
Source3: hylafax+_hourly.cron
Source4: hylafax-hfaxd.service
Source5: hylafax-faxq.service
Source6: hylafax-faxgetty-ttyS0.service
Source7: README.SUSE
Source8: sendonly.conf
BuildRequires: gcc-c++
BuildRequires: ghostscript
BuildRequires: libjpeg-devel
BuildRequires: libtiff-devel
BuildRequires: pam-devel
BuildRequires: zlib-devel
%if 0%{?fedora} >= 16
BuildRequires: lcms-devel
BuildRequires: libtiff-tools
BuildRequires: openldap-devel
BuildRequires: systemd-units
Requires: cron
Requires: crontabs
Requires: gawk
Requires: ghostscript
Requires: ghostscript-fonts
Requires: libtiff-tools
Requires: mailx
Requires: sharutils
%endif
%if 0%{?fedora} > 16
BuildRequires: jbigkit-devel
%endif
%if 0%{?fedora} >= 18
BuildRequires: jbigkit-devel
BuildRequires: lcms-devel
BuildRequires: libtiff-tools
BuildRequires: openldap-devel
BuildRequires: systemd
Requires: crontabs
Requires: gawk
Requires: ghostscript
Requires: ghostscript-fonts
Requires: mailx
Requires: sharutils
%endif
%if 0%{?suse_version}
BuildRequires: jbigkit
BuildRequires: liblcms-devel
BuildRequires: openldap2-devel
Requires: cron
Requires: gawk
Requires: ghostscript
Requires: ghostscript-fonts
Requires: mailx
Requires: sharutils
Requires: tiff
%endif
%if 0%{?suse_version} > 1200
BuildRequires: systemd
%endif
# Server checks for existence of sendfax
Requires: hylafax+-client
Conflicts: mgetty-sendfax
Conflicts: hylafax < 30.0.0
Provides: hylafax = 30.0.0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
%if 0%{?fedora} >= 16
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
%endif
%if 0%{?suse_version} >= 1210
%{?systemd_requires}
%else
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
Requires(postun): /sbin/service
%endif
%define lib_version %(echo %version | tr \. _)
%description
HylaFAX(tm) is a enterprise-strength fax server supporting
Class 1 and 2 fax modems on UNIX systems. It provides spooling
services and numerous supporting fax management tools.
The fax clients may reside on machines different from the server
and client implementations exist for a number of platforms including
windows.
%package -n libfaxutil%{lib_version}
Summary: Runtime Library needed by both server and client.
Group: System/Libraries
%description -n libfaxutil%{lib_version}
This runtime lib is needed by both the server and the client.
%package -n hylafax+-client
Conflicts: sendfax
Summary: Linux client package for the Hylafax server
Group: Hardware/Fax
Conflicts: hylafax-client < 30.0.0
Provides: hylafax-client = 30.0.0
%description -n hylafax+-client
This is linux client part of the very powerful Hylafax fax server. If
you already run the Hylafax fax server on an other machine at your
network, you can use this package to access the server.
%prep
%setup -q -n hylafax-%{version}
cp %{S:7} .
cp %{S:8} .
%build
# - Can't use the configure macro because HylaFAX configure script does
# not understand the config options used by that macro
STRIP=':' \
./configure \
--with-DIR_BIN=%{_bindir} \
--with-DIR_SBIN=%{_sbindir} \
--with-DIR_LIB=%{_libdir} \
--with-DIR_LIBEXEC=%{_sbindir} \
--with-DIR_LIBDATA=%{_sysconfdir}/hylafax \
--with-DIR_LOCKS=/var/lock \
--with-LIBDIR=%{_libdir} \
--with-TIFFBIN=%{_bindir} \
--with-DIR_MAN=%{_mandir} \
--with-PATH_GSRIP=%{_bindir}/gs \
--with-TIFFINC=-L%{_includedir} \
--with-LIBTIFF="-ltiff" \
--with-DIR_SPOOL=%{faxspool} \
--with-AFM=no \
--with-AWK=%{_bindir}/gawk \
--with-PATH_VGETTY=/sbin/vgetty \
--with-PATH_GETTY=/sbin/mgetty \
--with-PAGESIZE=A4 \
--with-PATH_DPSRIP=%{faxspool}/bin/ps2fax \
--with-PATH_IMPRIP="" \
--with-SYSVINIT=%{_initrddir}/hylafax+ \
--with-INTERACTIVE=no
# can't use %{?_smp_mflags} because it breaks libfaxutil dso building
make OPTIMIZER="%optflags"
%install
%if 0%{?fedora} != 0
rm -rf %{buildroot}
%endif
# install: make some dirs...
mkdir -p -m 755 %{buildroot}%{_sysconfdir}/{cron.daily,cron.hourly}
mkdir -p -m 755 %{buildroot}%{_sysconfdir}/hylafax
%if 0%{?fedora} >= 16 || 0%{?suse_version} >= 1210 || 0%{?sles_version} >= 1200
mkdir -p -m 755 %{buildroot}%{_unitdir}
%endif
mkdir -p -m 755 %{buildroot}%{_initrddir}
mkdir -p -m 755 %{buildroot}%{_bindir}
mkdir -p -m 755 %{buildroot}%{_sbindir}
mkdir -p -m 755 %{buildroot}%{_libdir}
mkdir -p -m 755 %{buildroot}%{_mandir}
mkdir -p -m 755 %{buildroot}%{faxspool}/config
# install: binaries and man pages
# FAXUSER, FAXGROUP, SYSUSER and SYSGROUP are set to the current user to
# avoid warnings about chown/chgrp if the user building the SRPM is not root;
# they are set to the correct values with the RPM attr macro
make install -e \
FAXUSER=`id -u` \
FAXGROUP=`id -g` \
SYSUSER=`id -u` \
SYSGROUP=`id -g` \
BIN=%{buildroot}%{_bindir} \
SBIN=%{buildroot}%{_sbindir} \
LIBDIR=%{buildroot}%{_libdir} \
LIBDATA=%{buildroot}%{_sysconfdir}/hylafax \
LIBEXEC=%{buildroot}%{_sbindir} \
SPOOL=%{buildroot}%{faxspool} \
MAN=%{buildroot}%{_mandir} \
INSTALL_ROOT=%{buildroot}
# install: remaining files
%if 0%{?fedora} >= 16
install -p -m 644 %{SOURCE4} %{buildroot}%{_unitdir}/hylafax-hfaxd.service
install -p -m 644 %{SOURCE5} %{buildroot}%{_unitdir}/hylafax-faxq.service
install -p -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/hylafax-faxgetty-ttyS0.service
%endif
%if 0%{?suse_version} >= 1210 || 0%{?sles_version} >= 1200
install -p -m 644 %{SOURCE4} %{buildroot}%{_unitdir}/hylafax-hfaxd.service
install -p -m 644 %{SOURCE5} %{buildroot}%{_unitdir}/hylafax-faxq.service
install -p -m 644 %{SOURCE6} %{buildroot}%{_unitdir}/hylafax-faxgetty-ttyS0.service
%endif
%if 0%{?sles_version} < 1200
install -p -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/hylafax+
%endif
install -p -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/cron.daily/hylafax
install -p -m 755 %{SOURCE3} %{buildroot}%{_sysconfdir}/cron.hourly/hylafax
%if 0%{?fedora} >= 16 || 0%{?suse_version} >= 1210 || 0%{?sles_version} >= 1200
for lnk in hylafax-hfaxd hylafax-faxgetty-ttyS0 hylafax-faxq; do
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rc$lnk
done
%endif
# ABR: rchylafax+? No Service in non-systemd Distros
#%if 0%{?fedora} < 16 || 0%{?sles_version} < 1200
# ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rchylafax+
#%endif
# not being executable is rather unconvenient
chmod +x %{buildroot}%{_sbindir}/edit-faxcover
# Prepare docdir by removing non-doc files
# Remove files that are not needed on Linux
rm -f %{buildroot}%{_sbindir}/{faxsetup.irix,faxsetup.bsdi}
rm -f %{buildroot}%{faxspool}/bin/{ps2fax.imp,ps2fax.dps}
rm -f %{buildroot}%{faxspool}/COPYRIGHT
%if 0%{?fedora} >= 16
%post
/sbin/ldconfig
if [ 0$1 -eq 1 ]; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%preun
if [ 0$1 -eq 0 ]; then
/bin/systemctl --no-reload disable hylafax-hfaxd.service > /dev/null 2>&1 || :
/bin/systemctl stop hylafax-hfaxd.service > /dev/null 2>&1 || :
/bin/systemctl --no-reload disable hylafax-faxq.service > /dev/null 2>&1 || :
/bin/systemctl stop hylafax-faxq.service > /dev/null 2>&1 || :
fi
%postun
/sbin/ldconfig
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ 0$1 -ge 1 ]; then
/bin/systemctl try-restart hylafax-hfaxd.service >/dev/null 2>&1 || :
/bin/systemctl try-restart hylafax-faxq.service >/dev/null 2>&1 || :
fi
%endif
########SUSE adjust - begin
#####Systemd settings
%if 0%{?sles_version} >= 1200 || 0%{?suse_version} >= 1210
%pre
%service_add_pre hylafax-faxq.service
%service_add_pre hylafax-faxgetty-ttyS0.service
%service_add_pre hylafax-hfaxd.service
%post
/sbin/ldconfig
%service_add_post hylafax-faxq.service
%service_add_post hylafax-faxgetty-ttyS0.service
%service_add_post hylafax-hfaxd.service
%preun
%service_del_preun hylafax-faxq.service
%service_del_preun hylafax-faxgetty-ttyS0.service
%service_del_preun hylafax-hfaxd.service
%postun
/sbin/ldconfig
%service_del_postun hylafax-faxq.service
%service_del_postun hylafax-faxgetty-ttyS0.service
%service_del_postun hylafax-hfaxd.service
%endif
#####End Systemd-setings
####SysV settings
%if 0%{?sles_version} && 0%{?sles_version} < 1200
%post
%{fillup_and_insserv %{name}}
/sbin/ldconfig
if [ 0$1 -eq 1 ]; then
/sbin/chkconfig --add hylafax+
fi
%preun
if [ $1 = 0 ] ; then
# exits with an error if hfax is not running
# %%{stop_on_removal %%{name}}
if [ -x /usr/lib/lsb/remove_initd ]; then
/usr/lib/lsb/install_initd %{_initrddir}/%{name}
elif [ -x /sbin/chkconfig ]; then
/sbin/chkconfig --del %{name}
else
rm -f /etc/rc.d/rc?.d/???%{name}
fi
/sbin/service %{name} stop >/dev/null 2>&1 || :
fi
%postun
if [ "$1" = "1" ]; then
%{restart_on_update %{name}}
%{insserv_cleanup}
fi
%post -n libfaxutil%{lib_version} -p /sbin/ldconfig
%postun -n libfaxutil%{lib_version} -p /sbin/ldconfig
%endif
####End SysV settings
#######SUSE adjust - end
%files
%if 0%{?fedora} >= 16 || 0%{?suse_version} >= 1210 || 0%{?sles_version} >= 1200
%defattr(-,root,root,-)
%{_unitdir}/hylafax-hfaxd.service
%{_unitdir}/hylafax-faxq.service
%{_unitdir}/hylafax-faxgetty-ttyS0.service
%{_sbindir}/rchylafax-faxgetty-ttyS0
%{_sbindir}/rchylafax-faxq
%{_sbindir}/rchylafax-hfaxd
%endif
%defattr(-,uucp,uucp,-)
%doc CHANGES CONTRIBUTORS COPYRIGHT README TODO VERSION README.SUSE sendonly.conf
%exclude %{_libdir}/libfaxutil*
%{_libdir}/libfax*
%doc %{_mandir}/man5/hylafax-config.5f.gz
%doc %{_mandir}/man5/doneq.5f.gz
%doc %{_mandir}/man5/dialrules.5f.gz
%doc %{_mandir}/man5/hosts.hfaxd.5f.gz
%doc %{_mandir}/man5/hylafax-server.5f.gz
%doc %{_mandir}/man5/hylafax-info.5f.gz
%doc %{_mandir}/man5/hylafax-log.5f.gz
%doc %{_mandir}/man5/pagermap.5f.gz
%doc %{_mandir}/man5/pagesizes.5f.gz
%doc %{_mandir}/man5/recvq.5f.gz
%doc %{_mandir}/man5/sendq.5f.gz
%doc %{_mandir}/man5/hylafax-shutdown.5f.gz
%doc %{_mandir}/man5/status.5f.gz
%doc %{_mandir}/man5/tsi.5f.gz
%doc %{_mandir}/man5/typerules.5f.gz
%doc %{_mandir}/man5/xferfaxlog.5f.gz
%doc %{_mandir}/man8/choptest.8c.gz
%doc %{_mandir}/man8/cqtest.8c.gz
%doc %{_mandir}/man8/dialtest.8c.gz
%doc %{_mandir}/man8/faxabort.8c.gz
%doc %{_mandir}/man8/faxaddmodem.8c.gz
%doc %{_mandir}/man8/faxadduser.8c.gz
%doc %{_mandir}/man8/faxanswer.8c.gz
%doc %{_mandir}/man8/faxconfig.8c.gz
%doc %{_mandir}/man8/faxcron.8c.gz
%doc %{_mandir}/man8/faxdeluser.8c.gz
%doc %{_mandir}/man8/faxgetty.8c.gz
%doc %{_mandir}/man8/faxinfo.8c.gz
%doc %{_mandir}/man8/faxlock.8c.gz
%doc %{_mandir}/man8/faxmodem.8c.gz
%doc %{_mandir}/man8/faxq.8c.gz
%doc %{_mandir}/man8/faxqclean.8c.gz
%doc %{_mandir}/man8/faxquit.8c.gz
%doc %{_mandir}/man8/faxrcvd.8c.gz
%doc %{_mandir}/man8/faxsend.8c.gz
%doc %{_mandir}/man8/faxsetup.8c.gz
%doc %{_mandir}/man8/faxstate.8c.gz
%doc %{_mandir}/man8/faxwatch.8c.gz
%doc %{_mandir}/man8/hfaxd.8c.gz
%doc %{_mandir}/man8/jobcontrol.8c.gz
%doc %{_mandir}/man8/mkcover.8c.gz
%doc %{_mandir}/man8/notify.8c.gz
%doc %{_mandir}/man8/pagesend.8c.gz
%doc %{_mandir}/man8/pollrcvd.8c.gz
%doc %{_mandir}/man8/pdf2fax.8c.gz
%doc %{_mandir}/man8/ps2fax.8c.gz
%doc %{_mandir}/man8/recvstats.8c.gz
%doc %{_mandir}/man8/tagtest.8c.gz
%doc %{_mandir}/man8/tiff2fax.8c.gz
%doc %{_mandir}/man8/tiffcheck.8c.gz
%doc %{_mandir}/man8/tsitest.8c.gz
%doc %{_mandir}/man8/wedged.8c.gz
%doc %{_mandir}/man8/xferfaxstats.8c.gz
%doc %{_mandir}/man8/faxfetch.8c.gz
%doc %{_mandir}/man8/faxmsg.8c.gz
%doc %{_mandir}/man8/faxsetup.linux.8c.gz
%doc %{_mandir}/man8/hylafax.8c.gz
%doc %{_mandir}/man8/lockname.8c.gz
%doc %{_mandir}/man8/ondelay.8c.gz
%doc %{_mandir}/man8/probemodem.8c.gz
%doc %{_mandir}/man8/typetest.8c.gz
%dir %{_sysconfdir}/hylafax
%dir %{_sysconfdir}/hylafax/faxmail
%dir %{_sysconfdir}/hylafax/faxmail/application
%dir %{_sysconfdir}/hylafax/faxmail/image
%config(noreplace) %{_sysconfdir}/hylafax/hfaxd.conf
%dir %{faxspool}/config
%dir %{faxspool}/dev
%{faxspool}/config/*
%{faxspool}/bin/dict/*
%{faxspool}/bin/genfontmap.ps
%{faxspool}/bin/auto-rotate.ps
%{faxspool}/etc/dpsprinter.ps
%{faxspool}/etc/cover.templ
%{faxspool}/etc/lutRS18.pcf
%{faxspool}/etc/LiberationSans-25.pcf
%config(noreplace) %{faxspool}/etc/dialrules*
%defattr(755,root,root,-)
%if 0%{?fedora} < 16 || 0%{?sles_version} < 1210
%{_initrddir}/hylafax+
#%{_sbindir}/rchylafax+
%endif
%config(noreplace) %{_sysconfdir}/cron.daily/hylafax
%config(noreplace) %{_sysconfdir}/cron.hourly/hylafax
%{_sbindir}/choptest
%{_sbindir}/cqtest
%{_sbindir}/dialtest
%{_sbindir}/faxabort
%{_sbindir}/faxaddmodem
%{_sbindir}/faxadduser
%{_sbindir}/faxanswer
%{_sbindir}/faxconfig
%config(noreplace) %attr(700,root,root) %{_sbindir}/faxcron
%{_sbindir}/faxdeluser
%{_sbindir}/faxinfo
%{_sbindir}/faxlock
%{_sbindir}/faxmodem
%{_sbindir}/faxmsg
%{_sbindir}/faxq
%{_sbindir}/faxqclean
%{_sbindir}/faxquit
%{_sbindir}/faxsetup
%{_sbindir}/faxsetup.linux
%{_sbindir}/faxstate
%{_sbindir}/faxwatch
%{_sbindir}/probemodem
%{_sbindir}/recvstats
%{_sbindir}/tagtest
%{_sbindir}/tiffcheck
%{_sbindir}/tsitest
%{_sbindir}/typetest
%{_sbindir}/xferfaxstats
%{_sbindir}/faxfetch
%{_sbindir}/faxgetty
%{_sbindir}/faxsend
%{_sbindir}/hfaxd
%{_sbindir}/hylafax
%{_sbindir}/lockname
%{_sbindir}/ondelay
%{_sbindir}/pagesend
%{_sbindir}/textfmt
%{faxspool}/bin/archive
%{faxspool}/bin/common-functions
%{faxspool}/bin/dictionary
%{faxspool}/bin/faxrcvd
%{faxspool}/bin/mkcover
%{faxspool}/bin/notify
%{faxspool}/bin/pcl2fax
%{faxspool}/bin/pdf2fax.gs
%{faxspool}/bin/pollrcvd
%{faxspool}/bin/ps2fax.gs
%{faxspool}/bin/qp-encode.awk
%{faxspool}/bin/rfc2047-encode.awk
%{faxspool}/bin/tiff2fax
%{faxspool}/bin/tiff2pdf
%{faxspool}/bin/wedged
%{_sysconfdir}/hylafax/faxmail/application/pdf
%{_sysconfdir}/hylafax/faxmail/application/octet-stream
%{_sysconfdir}/hylafax/faxmail/image/tiff
%defattr(-,uucp,uucp,-)
%dir %{faxspool}
%dir %{faxspool}/bin
%dir %{faxspool}/bin/dict
%dir %{faxspool}/client
%dir %{faxspool}/etc
%dir %{faxspool}/info
%dir %{faxspool}/log
%dir %{faxspool}/recvq
%dir %{faxspool}/status
%config(noreplace) %{faxspool}/etc/xferfaxlog
%attr(700,uucp,uucp) %dir %{faxspool}/docq
%attr(700,uucp,uucp) %dir %{faxspool}/doneq
%attr(700,uucp,uucp) %dir %{faxspool}/archive
%attr(700,uucp,uucp) %dir %{faxspool}/sendq
%attr(700,uucp,uucp) %dir %{faxspool}/tmp
%attr(700,uucp,uucp) %dir %{faxspool}/pollq
%defattr(600,uucp,uucp,-)
%config(noreplace) %{faxspool}/etc/hosts.hfaxd
%files -n libfaxutil%{lib_version}
%defattr(-, root, root)
%{_libdir}/libfaxutil*
%files -n hylafax+-client
%defattr(-, root, root)
%config(noreplace) %{_sysconfdir}/hylafax/faxcover.ps
%config(noreplace) %{_sysconfdir}/hylafax/faxmail.ps
%config(noreplace) %{_sysconfdir}/hylafax/pagesizes
%config(noreplace) %{_sysconfdir}/hylafax/typerules
%{_bindir}/faxalter
%{_bindir}/faxcover
%{_bindir}/faxmail
%{_bindir}/faxrm
%{_bindir}/faxstat
%{_bindir}/sendfax
%{_bindir}/sendpage
%{_sbindir}/edit-faxcover
%{_mandir}/man1/edit-faxcover.1.gz
%{_mandir}/man1/faxalter.1.gz
%{_mandir}/man1/faxcover.1.gz
%{_mandir}/man1/faxmail.1.gz
%{_mandir}/man1/faxrm.1.gz
%{_mandir}/man1/faxstat.1.gz
%{_mandir}/man1/hylafax-client.1.gz
%{_mandir}/man1/sendfax.1.gz
%{_mandir}/man1/sendpage.1.gz
%{_mandir}/man1/sgi2fax.1.gz
%{_mandir}/man1/textfmt.1.gz
%changelog