[users] Request for Package in RPMForge ... HylaFax++ ...

Todd Lyons tlyons at ivenue.com
Fri Jun 20 15:52:21 CEST 2008


On Fri, Jun 20, 2008 at 03:22:08PM +0200, Dries Verachtert wrote:

>> > >    Just a quick request, if possible for HylaFax++ server package
>> > >   (http://hylafax.sourceforge.net/) to be included in RPMForge repo ...
>> > I use a somewhat customized spec file to build hylafax locally for our
>> > fax server.  I can provide it to rpmforge if requested.
>>  Would be nice for one of the maintainers to pickup ... Thanks ...
>I've added the hylafax spec file with only very minor changes. The spec file 
>is quite long but it's not complicated and easy to read and it seems to build 
>and install ok. Please note: i've no experience with faxservers and i don't 
>have a fax so no idea if it really works :-)
>
>Todd: what exactly did you change in your spec file?

I have no idea how different my spec file is from the one in Fedora.
The changes that I made were only to detect that a web front end for it
called AvantFax exists and if it does to symlink a few files differently
than normal.

%post
/sbin/ldconfig
if [ "$1" = "1" ]; then
    /sbin/chkconfig --add %{name}
fi
if [ -d %{avantfax} ]; then
    ln -sf %{avantfax}/includes/faxcover.php %{_bindir}/faxcover
    ln -sf %{avantfax}/includes/faxrcvd.php %{faxspool}/bin/faxrcvd
    ln -sf %{avantfax}/includes/notify.php %{faxspool}/bin/notify
else
    ln -sf %{_bindir}/faxcover-%{version} %{_bindir}/faxcover
    ln -sf %{faxspool}/bin/faxrcvd-%{version} %{faxspool}/bin/faxrcvd
    ln -sf %{faxspool}/bin/notify-%{version} %{faxspool}/bin/notify
fi

I've attached the whole spec file to this email.  

Dries, I will send you my src rpm offlist.  The init files that I use
also start and stop the faxgetty process, but that's just the way I
chose to do it.  Lots of people prefer it to be handled by init
directly.  In my case, I decided that it made little sense for faxgetty
to be accepting the calls if there was no hylafax on the backend to
handle it.  For public consumption, if you chose to use that in the
RPMForge package, it would probably be best to add a sysconfig setting
that turns on or off the handling of the faxgetty process (though I kind
of consider it a hack to do it this way in the first place because
nobody else seems to do it this way).
-- 
Regards...		Todd
we're off on the usual strange tangents.  next will be whether
it is ethical to walk in your neighbor's open house if they're
running ipv6:-).                                  --Randy Bush
Linux kernel 2.6.24-18-generic   4 users,  load average: 0.04, 0.04, 0.00
-------------- next part --------------
%define faxspool    /var/spool/hylafax

# The resulting debuginfo package is empty.  So we just disable it.
%define debug_package %{nil}

# Specify base install directory of avantfax
%define avantfax    /var/www/html/avantfax

Summary:   HylaFAX(tm) is a enterprise-strength fax server
Name:	   hylafax
Version:   5.2.0
Release:   1.%{?_vendorsuffix:%{_vendorsuffix}}%{!?_vendorsuffix:%{_vendor}}
Packager:  %{?_packager:%{_packager}}%{!?_packager:%{_vendor}}
Vendor:    %{?_vendorinfo:%{_vendorinfo}}%{!?_vendorinfo:%{_vendor}}
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
License:   BSD-like
Group:     Applications/Communications
URL:       http://hylafax.sourceforge.net

Source:    http://osdn.dl.sourceforge.net/sourceforge/hylafax/%{name}-%{version}.tar.gz
Source1:   hylafax_rh.init
Source2:   hylafax_daily.cron
Source3:   hylafax_hourly.cron
# Patch1:    hylafax_dso.patch
# Patch2:    hylafax_PATH.patch

BuildRequires: libjpeg-devel, libtiff-devel, zlib-devel, gcc, gcc-c++
Requires:    ghostscript, gawk, sharutils
Conflicts:   mgetty-sendfax

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
Requires(postun): /sbin/service

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

%prep
%setup -q
# %patch1 -p1
# %patch2 -p1

%build
# - Can't use the configure macro because HylaFAX configure script does
#   not understand the config options used by that macro
./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-DBLIBINC=%{_includedir} \
	--with-TIFFINC=%{_includedir} \
	--with-LIBTIFF="-ltiff -ljpeg -lz" \
	--with-DIR_SPOOL=%{faxspool} \
	--with-AFM=no \
	--with-AWK=%{_bindir}/gawk \
	--with-PATH_VGETTY=/sbin/vgetty \
	--with-PATH_GETTY=/sbin/mgetty \
	--with-PATH_DPSRIP=%{faxspool}/bin/ps2fax \
	--with-PATH_IMPRIP="" \
	--with-SYSVINIT=%{_initrddir}/hylafax \
	--with-INTERACTIVE=no

#	--with-PAGESIZE=A4 \
# can't use %{?_smp_mflags} because it breaks libfaxutil dso building
make OPTIMIZER="$RPM_OPT_FLAGS"

%install
rm -rf $RPM_BUILD_ROOT

# install: make some dirs...
mkdir -p -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/{cron.daily,cron.hourly} 
mkdir -p -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/hylafax
mkdir -p -m 755 $RPM_BUILD_ROOT%{_initrddir}
mkdir -p -m 755 $RPM_BUILD_ROOT%{_bindir}
mkdir -p -m 755 $RPM_BUILD_ROOT%{_sbindir}
mkdir -p -m 755 $RPM_BUILD_ROOT%{_libdir}
mkdir -p -m 755 $RPM_BUILD_ROOT%{_mandir}
mkdir -p -m 755 $RPM_BUILD_ROOT%{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=$RPM_BUILD_ROOT%{_bindir} \
	SBIN=$RPM_BUILD_ROOT%{_sbindir} \
	LIBDIR=$RPM_BUILD_ROOT%{_libdir} \
	LIBDATA=$RPM_BUILD_ROOT%{_sysconfdir}/hylafax \
	LIBEXEC=$RPM_BUILD_ROOT%{_sbindir} \
	SPOOL=$RPM_BUILD_ROOT%{faxspool} \
	MAN=$RPM_BUILD_ROOT%{_mandir} \
	INSTALL_ROOT=$RPM_BUILD_ROOT

for MVFILE in faxcover; do
  mv $RPM_BUILD_ROOT%{_bindir}/$MVFILE $RPM_BUILD_ROOT%{_bindir}/$MVFILE-%{version}
done
for MVFILE in faxrcvd notify; do
  mv $RPM_BUILD_ROOT%{faxspool}/bin/$MVFILE $RPM_BUILD_ROOT%{faxspool}/bin/$MVFILE-%{version}
done
# install: remaining files
install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/hylafax
install -p -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/hylafax
install -p -m 755 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/hylafax

# Prepare docdir by removing non-doc files
# Remove files that are not needed on Linux
rm -f $RPM_BUILD_ROOT%{_sbindir}/{faxsetup.irix,faxsetup.bsdi}
rm -f $RPM_BUILD_ROOT%{faxspool}/bin/{ps2fax.imp,ps2fax.dps}

rm -f $RPM_BUILD_ROOT%{faxspool}/COPYRIGHT

%clean
rm -rf $RPM_BUILD_ROOT


%pre
# Get rid of symlinks
rm -f %{_bindir}/faxcover %{faxspool}/bin/faxrcvd %{faxspool}/bin/notify

%post
/sbin/ldconfig
if [ "$1" = "1" ]; then
    /sbin/chkconfig --add %{name}
fi
if [ -d %{avantfax} ]; then
    ln -sf %{avantfax}/includes/faxcover.php %{_bindir}/faxcover
    ln -sf %{avantfax}/includes/faxrcvd.php %{faxspool}/bin/faxrcvd
    ln -sf %{avantfax}/includes/notify.php %{faxspool}/bin/notify
else
    ln -sf %{_bindir}/faxcover-%{version} %{_bindir}/faxcover
    ln -sf %{faxspool}/bin/faxrcvd-%{version} %{faxspool}/bin/faxrcvd
    ln -sf %{faxspool}/bin/notify-%{version} %{faxspool}/bin/notify
fi
%preun
if [ "$1" = "0" ]; then
    /sbin/chkconfig --del %{name}
    /sbin/service %{name} stop >/dev/null 2>&1 || :
fi

%postun
/sbin/ldconfig
if [ "$1" = "1" ]; then
    /sbin/service %{name} condrestart >/dev/null 2>&1 || :
fi


%files
%defattr(-,root,root,-)
%doc CHANGES CONTRIBUTORS COPYRIGHT README TODO VERSION
%attr(755,root,root) %config(noreplace) %{_initrddir}/hylafax
%attr(755,root,root) %config(noreplace) %{_sysconfdir}/cron.daily/hylafax
%attr(755,root,root) %config(noreplace) %{_sysconfdir}/cron.hourly/hylafax
%{_bindir}/*
%{_sbindir}/*
%{_libdir}/*
%attr(644,root,root) %{_mandir}/*/*
%attr(755,root,root) %dir %{_sysconfdir}/hylafax
%attr(755,root,root) %dir %{_sysconfdir}/hylafax/faxmail
%attr(755,root,root) %dir %{_sysconfdir}/hylafax/faxmail/*
%attr(644,root,root) %{_sysconfdir}/hylafax/faxcover_example_sgi.ps
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/hylafax/faxcover.ps
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/hylafax/faxmail.ps
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/hylafax/hfaxd.conf
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/hylafax/pagesizes
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/hylafax/typerules
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/hylafax/faxmail/*/*
%attr(-,uucp,uucp) %dir %{faxspool}
%attr(-,uucp,uucp) %dir %{faxspool}/archive
%attr(-,root,root) %dir %{faxspool}/bin
%attr(-,uucp,uucp) %dir %{faxspool}/client
%attr(-,root,root) %dir %{faxspool}/config
%attr(-,root,root) %dir %{faxspool}/dev
%attr(-,uucp,uucp) %dir %{faxspool}/docq
%attr(-,uucp,uucp) %dir %{faxspool}/doneq
%attr(-,uucp,uucp) %dir %{faxspool}/etc
%attr(-,uucp,uucp) %dir %{faxspool}/info
%attr(-,uucp,uucp) %dir %{faxspool}/log
%attr(-,uucp,uucp) %dir %{faxspool}/pollq
%attr(-,uucp,uucp) %dir %{faxspool}/recvq
%attr(-,uucp,uucp) %dir %{faxspool}/sendq
%attr(-,uucp,uucp) %dir %{faxspool}/status
%attr(-,uucp,uucp) %dir %{faxspool}/tmp
%attr(755,root,root) %{faxspool}/bin/*
%attr(-,root,root) %{faxspool}/config/*
%attr(-,root,root) %{faxspool}/etc/dpsprinter.ps
%attr(-,root,root) %{faxspool}/etc/cover.templ
%attr(-,root,root) %{faxspool}/etc/lutRS18.pcf
%attr(-,uucp,uucp) %config(noreplace) %{faxspool}/FIFO
%attr(-,root,root) %config(noreplace) %{faxspool}/etc/dialrules*
%attr(-,uucp,uucp) %config(noreplace) %{faxspool}/etc/xferfaxlog
%attr(-,uucp,uucp) %config(noreplace) %{faxspool}/etc/hosts.hfaxd

%changelog
* Thu Dec 06 2007 Todd Lyons <tlyons at ivenue.com> - 5.2.0-1.iv
- New release.

* Mon Nov 12 2007 Todd Lyons <tlyons at ivenue.com> - 5.1.11-1.iv
- New release.

* Wed Aug 29 2007 Todd Lyons <tlyons at ivenue.com> - 5.1.8-1.iv
- New release.

* Mon Jul 23 2007 Todd Lyons <tlyons at ivenue.com> - 5.1.6-1.iv
- New release.
- Patch DSO build process to remove ldconfig call.

* Mon Jun 25 2007 Todd Lyons <tlyons at ivenue.com> - 5.1.5-1.iv
- New release.
- Adjust daily cronjob to call "bash faxcron".

* Wed May 15 2007 Todd Lyons <tlyons at ivenue.com> - 5.1.4-1.iv
- Build latest release.  Allow for AvantFax existence and manage symlinks
  manually in %pre and %post.

* Fri May  4 2007 Todd Lyons <tlyons at ivenue.com> - 5.1.2-2.iv
- Fix bug in init script.

* Fri May  4 2007 Todd Lyons <tlyons at ivenue.com> - 5.1.2-1.iv
- Initial build for Ivenue.  Adjust init script to manage faxgetty.

* Fri Mar 23 2007 Lee Howard <faxguy at howardsilvan.com> - 5.1.2-1
  made faxq's FIFO "noreplace" to keep upgrades from messing up a running faxq

* Thu Mar  8 2007 Lee Howard <faxguy at howardsilvan.com> - 5.1.1-1

* Thu Feb 22 2007 Lee Howard <faxguy at howardsilvan.com> - 5.1.0-1

* Thu Jan 11 2007 Lee Howard <faxguy at howardsilvan.com> - 5.0.4-1

* Tue Jan 1 2007 Lee Howard <faxguy at howardsilvan.com> - 5.0.3-1

* Wed Dec 13 2006 Lee Howard <faxguy at howardsilvan.com> - 5.0.2-1

* Wed Nov 1 2006 Lee Howard <faxguy at howardsilvan.com> - 5.0.0-1
- update to 5.0.0
- disable build of debuginfo package
- change ownership of config and dev to root,root
- move changelog to the end of the spec file

* Mon Sep 18 2006 Lee Howard <faxguy at howardsilvan.com> - 4.3.0.11-1
- update to 4.3.0.1

* Tue Apr 11 2006 Lee Howard <faxguy at howardsilvan.com> - 4.2.5.6-1
- update to 4.2.5.6

* Tue Apr 11 2006 Lee Howard <faxguy at howardsilvan.com> - 4.2.5.5-1
- initial 4.2.5.5 build


More information about the users mailing list