File hylafax.spec of Package hylafax

#
# spec file for package hylafax
#
# Copyright (c) 2012 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 http://bugs.opensuse.org/
#


Name:           hylafax
BuildRequires:  gcc-c++
BuildRequires:  ghostscript-library
BuildRequires:  libjpeg-devel
BuildRequires:  libpng-devel
BuildRequires:  libtiff-devel
BuildRequires:  metamail
BuildRequires:  mgetty
BuildRequires:  mm
BuildRequires:  postfix
BuildRequires:  pwdutils
BuildRequires:  xz
BuildRequires:  zlib-devel
Provides:       fax_daemon
Requires:       a2ps
Requires:       gs_lib
Requires:       hylafax-client
Requires:       mgetty
Requires:       smtp_daemon
Requires:       tiff
Conflicts:      sendfax
Version:        6.0.5
Release:        0
Source:         %{name}-%{version}.tar.gz
Source1:        latex-cover-1.04.tar.lzma
Source2:        %{name}-SuSE.tar.lzma
Source3:        %{name}-rpmlintrc
Source4:        hylafax-6.0.4.de.po
Patch:          hylafax-6.0.4.patch
Patch1:         hylafax-6.0.4-isdn.patch
Patch2:         hylafax-6.0.4-valist.patch
Patch3:         hylafax-6.0.4-pic.patch
Patch4:         hylafax-6.0.4-fax_user.patch
Patch5:         hylafax-6.0.4-asciifix.patch
Patch6:         hylafax-6.0.4-warning.patch
Patch7:         hylafax-6.0.4-dispatch-isdn.patch
Patch9:         hylafax-6.0.4-no-timestamp.patch
Patch10:        hylafax-6.0.4-DESTDIR.patch
Patch11:        hylafax-6.0.4-configure.patch
Patch12:        hylafax-changed_options.patch
# PATCH-FIX-OPENSUSE hylafax-6.0.5-TIFF-4.0.patch zaitor@opensuse.org -- Fixes build with TIFF 4.0 we now have in 12.2. Patch taken from gentoo ( http://gentoo-overlays.zugaina.org/bgo-overlay/portage/net-misc/hylafax/files/hylafax-6.0.5-tiff-4.0.patch )
%if 0%{?suse_version} > 1210
Patch13:        hylafax-6.0.5-TIFF-4.0.patch
%endif
Url:            http://www.hylafax.org
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Summary:        Very Powerful Fax Server
License:        MIT
Group:          Hardware/Fax
PreReq:         sh-utils fileutils %insserv_prereq %fillup_prereq /usr/sbin/useradd /usr/sbin/usermod
%define lib_dir %{_prefix}/lib/fax
%define spooldir /var/spool/fax

%description
Very powerful fax server.

%package -n hylafax-client
Conflicts:      sendfax
Summary:        Linux client package for the Hylafax server
Group:          Hardware/Fax

%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 -qa 1 -a 2
%patch
%patch1
%patch2
%patch3
%patch4
%patch5
%patch6
%patch7
%patch9
%patch10
%patch11
%patch12
%if 0%{?suse_version} > 1210
%patch13 -p1
%endif
# needs to be executable 
chmod 755 SuSE/usr/lib/fax/a2pswrap
find ../ -name .cvsignore -exec rm {} \;  
cp %{S:4} po/de.po

%build
./configure --with-OPTIMIZER="%{optflags}" --with-STRIP=: \
            --with-MKDIR="/bin/mkdir -p" ${RPM_ARCH}-suse-linux < /dev/null
%{__make} BIN=%{_bindir} \
     LIBDATA=%{lib_dir} \
     LIBEXEC=%{lib_dir} \
     SBIN=%{_sbindir} \
     SPOOL=%{spooldir} \
     MAN=%{_mandir} \
     DESTDIR=%{buildroot} \
     LIBDIR=%{_libdir} \
     LOCALEDIR=%{_datadir}/locale %{?_smp_mflags}

%install
install -d %{buildroot}%{spooldir}
install -d %{buildroot}%{_libdir}
install -d %{buildroot}%{_mandir}
install -d %{buildroot}%{_sysconfdir}/init.d
%{__make} BIN=%{_bindir} \
     LIBDATA=%{lib_dir} \
     LIBEXEC=%{lib_dir} \
     SBIN=%{_sbindir} \
     SPOOL=%{spooldir} \
     MAN=%{_mandir} \
     DESTDIR=%{buildroot} \
     LIBDIR=%{_libdir} \
     LOCALEDIR=%{_datadir}/locale install
install -m755 etc/hylafax %{buildroot}%{_sysconfdir}/init.d
install -d %{buildroot}%{_sbindir}
ln -sf ../../etc/init.d/hylafax %{buildroot}%{_sbindir}/rchylafax
cp -af SuSE/* %{buildroot}
rm -f %{buildroot}/README.SuSE
install -d %{buildroot}%{spooldir}/bin/
install -m755 faxsend %{buildroot}%{spooldir}/bin/
install -d %{buildroot}%{_defaultdocdir}/%{name}
mv %{buildroot}%{lib_dir}/faxcover_example_sgi.ps %{buildroot}%{_defaultdocdir}/%{name}
rm -f %{buildroot}%{_libdir}/*.so
rm -f /usr/lib/debug/.build-id/11/877b19d1d92aae65fa3cdadbace22c918d8a7c
rm -f /usr/lib/debug/.build-id/11/877b19d1d92aae65fa3cdadbace22c918d8a7c.debug
rm -f /usr/lib/debug/usr/lib/fax/typetest.debug
rm -f /usr/lib/debug/usr/lib64/libhylafax-6.0.so.3.debug
%{find_lang} %{name}-client
%{find_lang} %{name}-server
%{find_lang} lib%{name}

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

%post
/bin/chown -Rhf fax var/spool/fax/*
%{fillup_and_insserv hylafax}
ldconfig

%postun
%{insserv_cleanup}
ldconfig

%post -n hylafax-client -p /sbin/ldconfig

%postun -n hylafax-client -p /sbin/ldconfig

%files -f %{name}-server.lang
%defattr(-, root, root)
%doc COPYRIGHT README SuSE/README.SuSE TODO VERSION latex-cover-1.04 doc/RELEASENOTES-6.0.txt
%config /etc/init.d/hylafax
%dir /usr/lib/fax
%attr(700,root,root) /etc/cron.daily/suse.de-faxcron
#/usr/%_lib/libfaxserver*
/usr/lib/fax/faxgetty
/usr/lib/fax/faxsend
/usr/lib/fax/hfaxd
%config(noreplace) /usr/lib/fax/hfaxd.conf
/usr/lib/fax/lockname
/usr/lib/fax/ondelay
/usr/lib/fax/pagesend
%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
/usr/sbin/choptest
/usr/sbin/cqtest
/usr/sbin/dialtest
/usr/sbin/faxabort
/usr/sbin/faxaddmodem
/usr/sbin/faxadduser
/usr/sbin/faxanswer
/usr/sbin/faxconfig
%config(noreplace) %attr(700,root,root) /usr/sbin/faxcron
/usr/sbin/faxdeluser
/usr/sbin/faxinfo
/usr/sbin/faxlock
/usr/sbin/faxmodem
/usr/sbin/faxmsg
/usr/sbin/faxq
/usr/sbin/faxqclean
/usr/sbin/faxquit
/usr/sbin/faxsetup
/usr/sbin/faxsetup.bsdi
/usr/sbin/faxsetup.irix
/usr/sbin/faxsetup.linux
/usr/sbin/faxstate
/usr/sbin/faxwatch
/usr/sbin/probemodem
/usr/sbin/rchylafax
/usr/sbin/recvstats
/usr/sbin/tagtest
/usr/sbin/tiffcheck
/usr/sbin/tsitest
/usr/sbin/typetest
/usr/sbin/xferfaxstats
%defattr(-,fax,uucp)
%dir /var/spool/fax
%dir %attr(0700,fax,uucp) /var/spool/fax/archive
%dir %attr(0755,fax,uucp) /var/spool/fax/bin
/var/spool/fax/bin/*
%dir %attr(0755,fax,uucp) /var/spool/fax/client
%dir %attr(0755,fax,uucp) /var/spool/fax/config
/var/spool/fax/config/*
%dir %attr(0755,fax,uucp) /var/spool/fax/dev
%dir %attr(0700,fax,uucp) /var/spool/fax/docq
%dir %attr(0700,fax,uucp) /var/spool/fax/doneq
%dir %attr(0755,fax,uucp) /var/spool/fax/etc
%config(noreplace) /var/spool/fax/etc/cover.templ
%config(noreplace) /var/spool/fax/etc/dialrules
%config(noreplace) /var/spool/fax/etc/dialrules.europe
%config(noreplace) /var/spool/fax/etc/dialrules.sf-ba
%config(noreplace) /var/spool/fax/etc/dpsprinter.ps
%config(noreplace) /var/spool/fax/etc/hosts.hfaxd
%config(noreplace) /var/spool/fax/etc/lutRS18.pcf
%config(noreplace) /var/spool/fax/etc/xferfaxlog
%config(noreplace) /var/spool/fax/etc/users
/var/spool/fax/etc/templates/
%dir %attr(0755,fax,uucp) /var/spool/fax/info
%dir %attr(0755,fax,uucp) /var/spool/fax/log
%dir %attr(0700,fax,uucp) /var/spool/fax/pollq
%dir %attr(0755,fax,uucp) /var/spool/fax/recvq
%dir %attr(0700,fax,uucp) /var/spool/fax/sendq
%dir %attr(0755,fax,uucp) /var/spool/fax/status
%dir %attr(0700,fax,uucp) /var/spool/fax/tmp
/var/spool/fax/COPYRIGHT
/var/spool/fax/FIFO

%files -n hylafax-client -f hylafax-client.lang -f libhylafax.lang
%defattr(-, root, root)
%{_libdir}/libhylafax*.so.*
/usr/bin/faxalter
/usr/bin/faxcover
/usr/bin/faxmail
/usr/bin/faxrm
/usr/bin/faxstat
/usr/bin/sendfax
/usr/bin/sendpage
%dir /usr/lib/fax
/usr/lib/fax/a2pswrap
%config /usr/lib/fax/faxcover.ps
/usr/lib/fax/faxmail.ps
%config /usr/lib/fax/pagesizes
%config(noreplace) /usr/lib/fax/sendfax.conf
/usr/lib/fax/textfmt
%config /usr/lib/fax/typerules
/usr/lib/fax/typetest
/usr/sbin/edit-faxcover
%doc %{_mandir}/man1/edit-faxcover.1.gz
%doc %{_mandir}/man1/faxalter.1.gz
%doc %{_mandir}/man1/faxcover.1.gz
%doc %{_mandir}/man1/faxmail.1.gz
%doc %{_mandir}/man1/faxrm.1.gz
%doc %{_mandir}/man1/faxstat.1.gz
%doc %{_mandir}/man1/hylafax-client.1.gz
%doc %{_mandir}/man1/sendfax.1.gz
%doc %{_mandir}/man1/sendpage.1.gz
%doc %{_mandir}/man1/sgi2fax.1.gz
%doc %{_mandir}/man1/textfmt.1.gz

%changelog
openSUSE Build Service is sponsored by