Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > 0dae45b80a46da8fa6bd9b3cf03b17f0 > files > 2

LPRng-3.8.27-1mdk.src.rpm

Summary: LPRng Print Spooler
Name: LPRng
Version: 3.8.27
Release: 1mdk
License: GPL and Artistic
Group: System/Configuration/Printing
Source0: http://www.lprng.com/DISTRIB/LPRng/%{name}-%{version}.tar.bz2
Source1: lprng.startup.bz2
#Patch0: LPRng-3.7.4-lockfile.patch.bz2
#Patch1: LPRng-3.7.4-kerb5.patch
#Patch2: LPRng-3.7.4-nointl.patch.bz2
#Patch3: LPRng-3.7.4-inet_ntop.patch.bz2
#Patch4: LPRng-3.7.4-manpage.patch.bz2
#Patch5: LPRng-3.7.4-shutdown.patch.bz2
#Patch6: LPRng-3.7.4-direct.patch.bz2
#Patch7: LPRng-3.7.4-jobfilescan.patch.bz2
URL: http://www.lprng.com
Buildroot: %{_tmppath}/%{name}-buildroot
# "Conflicts: lpr" is mis-understood, not only the package "lpr" is
# considered as conflicting but also /usr/bin/lpr of another spooler, as
# CUPS.
#Conflicts: lpr
Requires: net-tools
Provides: lpr lpddaemon
Prereq: /sbin/chkconfig, /etc/rc.d/init.d, mktemp, fileutils, textutils, gawk
BuildPreReq: gdbm-devel gettext-devel

%description
The LPRng software is an enhanced, extended, and portable implementation
of the Berkeley LPR print spooler functionality. While providing the
same interface and meeting RFC1179 requirements, the implementation
is completely new and provides support for the following features:
lightweight (no databases needed) lpr, lpc, and lprm programs; dynamic
redirection of print queues; automatic job holding; highly verbose
diagnostics; multiple printers serving a single queue; client programs
do not need to run SUID root; greatly enhanced security checks; and a
greatly improved permission and authorization mechanism.

The source software compiles and runs on a wide variety of UNIX systems,
and is compatible with other print spoolers and network printers that
use the LPR interface and meet RFC1179 requirements.  LPRng provides
emulation packages for the SVR4 lp and lpstat programs, eliminating the
need for another print spooler package. These emulation packages can be
modified according to local requirements, in order to support vintage
printing systems.

For users that require secure and/or authenticated printing support,
LPRng supports Kerberos V, MIT Kerberos IV Print Support, and PGP
authentication.  LPRng is being adopted by MIT for use as their Campus
Wide printing support system. Additional authentication support is
extremely simple to add.

%prep
%setup -q

# Security fix: Restrict remote access
perl -p -i -e "s/^\#REJECT SERVICE=X/REJECT SERVICE=X NOT SERVER\n\#REJECT SERVICE=X/" lpd.perms.in

#patch0 -p1 -b .lockfile
#patch2 -p1 -b .nointl
#patch3 -p1 -b .inet_ntop
#patch4 -p1 -b .manpage
#patch5 -p1 -b .shutdown
#patch6 -p1 -b .direct
#patch7 -p1 -b .jobfilescan

# pick up configure.in changes
#autoconf 

# set up gettext
#cd po
#rm Makefile.in.in
#ln -s /usr/share/gettext/po/Makefile.in.in .
#cd ..
#rm -fr intl

# Modified startup file with various system checks
bzcat %{SOURCE1} > lprng.startup

%build
CFLAGS="-g" ; export CFLAGS
%configure --enable-nls \
	--with-userid=lp \
	--with-groupid=lp \
#%{!?nokerberos:--enable-kerberos}

perl -p -i -e 's/-DGETENV=\\\"1\\\"/-DGETENV=\\\"0\\\"/g' src/Makefile
make MAKEPACKAGE=YES

%install
rm -rf %{buildroot}

# Installation of locales is broken... Work around it! (They will never get
# it correct)
perl -pi -e "s,prefix =.*,prefix = ${RPM_BUILD_ROOT}%{_prefix},g" po/Makefile
perl -pi -e "s,datadir =.*,datadir = ${RPM_BUILD_ROOT}%{_prefix}/share,g" po/Makefile
perl -pi -e "s,localedir =.*,localedir = ${RPM_BUILD_ROOT}%{_prefix}/share/locale,g" po/Makefile
perl -pi -e "s,gettextsrcdir =.*,gettextsrcdir = ${RPM_BUILD_ROOT}%{_prefix}/share/gettext/po,g" po/Makefile

make SUID_ROOT_PERMS=" 04755" DESTDIR=${RPM_BUILD_ROOT} MAKEPACKAGE=YES mandir=%{_mandir} install
%__cp src/monitor ${RPM_BUILD_ROOT}%{_prefix}/sbin/monitor

# Move locale files to right place, every attempt to fix the Makefiles fails
#cp -a ${RPM_BUILD_ROOT}${RPM_BUILD_ROOT}/* ${RPM_BUILD_ROOT}
#rm -rf ${RPM_BUILD_ROOT}/home

# install init script
mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
install -m755 lprng.startup %{buildroot}%{_sysconfdir}/rc.d/init.d/lpd

# prepare the commands conflicting with CUPS for the update-alternatives
# treatment
( cd $RPM_BUILD_ROOT%{_bindir}
  rm -f lp
  ln -s lpr-lpd lp
  rm -f cancel
  ln -s lprm-lpd cancel
  mv lpr lpr-lpd
  mv lpq lpq-lpd
  mv lprm lprm-lpd
  mv lp lp-lpd
  mv cancel cancel-lpd
  mv lpstat lpstat-lpd
)
( cd $RPM_BUILD_ROOT%{_sbindir}
  mv lpc lpc-lpd
)
( cd $RPM_BUILD_ROOT/%{_mandir}/man1
  mv lpr.1 lpr-lpd.1
  mv lpq.1 lpq-lpd.1
  mv lprm.1 lprm-lpd.1
  mv lp.1 lp-lpd.1
  mv cancel.1 cancel-lpd.1
  mv lpstat.1 lpstat-lpd.1
)
( cd $RPM_BUILD_ROOT/%{_mandir}/man8
  mv lpc.8 lpc-lpd.8
)

# Conflict with setup package
rm -f %buildroot%_sysconfdir/printcap

# Suppress automatic replacement of "echo" by "gprintf" in the LPRng
# startup script by RPM. This automatic replacement is broken.
export DONT_GPRINTIFY=1

%clean
rm -rf %{buildroot}

%post
/sbin/chkconfig --add lpd
if [ -w /etc/printcap ] ; then
  TMP1=`mktemp /etc/printcap.XXXXXX`
  gawk '
    BEGIN { first = 1; cont = 0; last = "" }
    /^[:space:]*#/      { if(cont) sub("\\\\$", "", last)}
    { if(first == 0) print last }
    { first = 0 }
    { last = $0 }
    { cont = 0 }
    /\\$/ { cont = 1 }
    END {sub("\\\\$", "", last); print last}
  ' /etc/printcap > ${TMP1} && cat ${TMP1} > /etc/printcap && rm -f ${TMP1}
fi

# Set up update-alternatives entries
%{_sbindir}/update-alternatives --install %{_bindir}/lpr lpr %{_bindir}/lpr-lpd 5 --slave %{_mandir}/man1/lpr.1.bz2 lpr.1.bz2 %{_mandir}/man1/lpr-lpd.1.bz2
%{_sbindir}/update-alternatives --install %{_bindir}/lpq lpq %{_bindir}/lpq-lpd 5 --slave %{_mandir}/man1/lpq.1.bz2 lpq.1.bz2 %{_mandir}/man1/lpq-lpd.1.bz2
%{_sbindir}/update-alternatives --install %{_bindir}/lprm lprm %{_bindir}/lprm-lpd 5 --slave %{_mandir}/man1/lprm.1.bz2 lprm.1.bz2 %{_mandir}/man1/lprm-lpd.1.bz2
%{_sbindir}/update-alternatives --install %{_bindir}/lp lp %{_bindir}/lp-lpd 5 --slave %{_mandir}/man1/lp.1.bz2 lp.1.bz2 %{_mandir}/man1/lp-lpd.1.bz2
%{_sbindir}/update-alternatives --install %{_bindir}/cancel cancel %{_bindir}/cancel-lpd 5 --slave %{_mandir}/man1/cancel.1.bz2 cancel.1.bz2 %{_mandir}/man1/cancel-lpd.1.bz2
%{_sbindir}/update-alternatives --install %{_bindir}/lpstat lpstat %{_bindir}/lpstat-lpd 5 --slave %{_mandir}/man1/lpstat.1.bz2 lpstat.1.bz2 %{_mandir}/man1/lpstat-lpd.1.bz2
%{_sbindir}/update-alternatives --install %{_sbindir}/lpc lpc %{_sbindir}/lpc-lpd 5 --slave %{_mandir}/man8/lpc.8.bz2 lpc.1.bz2 %{_mandir}/man8/lpc-lpd.8.bz2

%preun

if [ "$1" = 0 ]; then
  # Remove update-alternatives entries
  %{_sbindir}/update-alternatives --remove lpr /usr/bin/lpr-lpd
  %{_sbindir}/update-alternatives --remove lpq /usr/bin/lpq-lpd
  %{_sbindir}/update-alternatives --remove lprm /usr/bin/lprm-lpd
  %{_sbindir}/update-alternatives --remove lp /usr/bin/lp-lpd
  %{_sbindir}/update-alternatives --remove cancel /usr/bin/cancel-lpd
  %{_sbindir}/update-alternatives --remove lpstat /usr/bin/lpstat-lpd
  %{_sbindir}/update-alternatives --remove lpc /usr/sbin/lpc-lpd

  %{_sysconfdir}/rc.d/init.d/lpd stop >/dev/null 2>&1
  /sbin/chkconfig --del lpd
fi

%postun
if [ "$1" -ge "1" ]; then
  %{_sysconfdir}/rc.d/init.d/lpd condrestart >/dev/null 2>&1
fi

%files
%defattr(-,root,root)
%attr(755,root,root) %config(noreplace) %{_sysconfdir}/lpd
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/printcap*
%config %{_sysconfdir}/rc.d/init.d/lpd
%attr(755,lp,lp) %{_bindir}/lpq-lpd
%attr(755,lp,lp) %{_bindir}/lprm-lpd
%attr(755,lp,lp) %{_bindir}/lpr-lpd
%attr(755,lp,lp) %{_bindir}/lpstat-lpd
%{_bindir}/lp-lpd
%{_bindir}/cancel-lpd
%attr(755,lp,lp) %{_sbindir}/lpc-lpd
%_sbindir/checkpc
%_sbindir/lpd
%_sbindir/lprng_certs
%_sbindir/lprng_index_certs
%_sbindir/monitor
%attr(755,root,root)  %_libdir/filters/*
%attr(755,root,root)  %_libdir/liblpr*
%{_mandir}/*/*
%{_datadir}/locale/fr/LC_MESSAGES/LPRng.mo
%doc CHANGES CONTRIBUTORS COPYRIGHT INSTALL LICENSE 
%doc README* VERSION Y2KCompliance
%doc DOCS/*.htm* DOCS/*.jpg DOCS/*.png DOCS/*.txt DOCS/*.pdf
%doc DOCS/LPRng-Reference-Multipart

%changelog
* Mon Aug 23 2004 Olivier Thauvin <thauvin@aerov.jussieu.fr> 3.8.27-1mdk
- 3.8.27
- remove printcap, conflict with setup

* Thu Mar 18 2004 Olivier Thauvin <thauvin@aerov.jussieu.fr> 3.8.26-2mdk
- Fix permission on %%_sysconfdir/lpd
- clean list files

* Fri Mar  5 2004 Till Kamppeter <till@mandrakesoft.com> 3.8.26-1mdk
- Version 3.8.26 (after a long break LPRng is under development again).

* Sat Sep 14 2002 Till Kamppeter <till@mandrakesoft.com> 3.8.12-2mdk
- Rebuilt.

* Fri Jun 28 2002 Till Kamppeter <till@mandrakesoft.com> 3.8.12-1mdk
- Updated to version 3.8.12.
- SECURITY FIX: Added "REJECT SERVICE=X NOT SERVER" to /etc/lpd.perms to
  restrict access from remote machines (Red Hat Security Advisory 
  RHSA-2002:089-07).

* Sun Feb 10 2002 Till Kamppeter <till@mandrakesoft.com> 3.8.6-1mdk
- Updated to version 3.8.6.
- Added "lpddaemon" to the "Provides" of LPRng, to satisfy FHS/LSB tests.
- Fixed french locale
- Fixed multi-part version of HOWTO
- Security fix: Disabled usage of the LPD_CONF environment variable

* Sat Jan 12 2002 Till Kamppeter <till@mandrakesoft.com> 3.8.4-2mdk
- Used "route -n" instead of "route" in startup script, the simple
  "route" does often not show the loopback device correctly.

* Thu Jan 10 2002 Till Kamppeter <till@mandrakesoft.com> 3.8.4-1mdk
- Updated to version 3.8.4.

* Mon Dec 17 2001 Till Kamppeter <till@mandrakesoft.com> 3.7.4-10mdk
- Suppressed automatic replacement of "echo" by "gprintf" in the startup
  script, the automatic replacement is broken.

* Tue Dec  4 2001 Till Kamppeter <till@mandrakesoft.com> 3.7.4-9mdk
- Modified startup script to do not do any changes on /etc/hosts any more.

* Fri Oct 12 2001 Till Kamppeter <till@mandrakesoft.com> 3.7.4-8mdk
- Added auto-correction of /etc/hosts, so that there is always a
  "localhost" definition.

* Sat Sep 15 2001 Till Kamppeter <till@mandrakesoft.com> 3.7.4-7mdk
- Corrected links "lp" and "cancel" to work with update-alternatives.

* Fri Sep 14 2001 Till Kamppeter <till@mandrakesoft.com> 3.7.4-6mdk
- Made startup system checks also working on non-english systems.
- LPRng requires net-tools.

* Fri Sep 14 2001 Till Kamppeter <till@mandrakesoft.com> 3.7.4-5mdk
- Check /etc/hosts on startup so assure that it has a correct
  "localhost" line.
- Do not change hostname to "localhost" if there is no local network.

* Wed Sep  1 2001 Till Kamppeter <till@mandrakesoft.com> 3.7.4-4mdk
- Added checks for system environment to the LPRng startup script,
  missing kernel modules and a missing loopback device are started
  automatically now.

* Mon Jul 23 2001 Stefan van der Eijk <stefan@eijk.nu> 3.7.4-3mdk
- BuildPreReq: gdbm-devel gettext-devel

* Wed Jul 18 2001 Till Kamppeter <till@mandrakesoft.com> 3.7.4-2mdk
- Update alternatives stuff as with LPD

* Tue Jun 19 2001 Lenny Cartier <lenny@mandrakesoft.com> 3.7.4-1mdk
- from RH rawhide
- remove kerberos stuff


* Tue Jan 02 2001 Lenny Cartier <lenny@mandrakesoft.com> 3.6.24-3mdk
- rebuild

* Thu Oct 05 2000 Vincent Danen <vdanen@mandrakesoft.com> 3.6.24-2mdk 

- applied security patch, fix potential root hack via use_syslog function

* Thu Aug 24 2000 Lenny Cartier <lenny@mandrakesoft.com> 3.6.24-1mdk 

- fixed source permission
- used srpm, once again ;) ,  provided by Christian Zoffoli <czoffoli@linux-mandrake.com>
- new version

* Wed Aug 16 2000 Christian Zoffoli <czoffoli@linux-mandrake.com> 3.6.23-1mdk
- new version

* Thu Aug 10 2000 Christian Zoffoli <czoffoli@linux-mandrake.com> 3.6.22-1mdk
- new version
- BM
- macroszification
- merge with RH
- fixed nls

* Thu Apr 20 2000 Lenny Cartier <lenny@mandrakesoft.com> 3.6.12-2mdk
- bz2 patch
- fix group

* Wed Feb 16 2000 Stefan van der Eijk <s.vandereijk@chello.nl>
- made patch so users can build the package
- altered .spec file --> checkconfig for redhat / mandrake

* Tue Sep 14 1999 Patrick Powell <papowell@astart.com>
- resolved problems with symbolic links to /etc/init.d
 files - used the chkconfig facility

* Sun Sep 05 1999 Patrick Powell <papowell@astart.com>
- did ugly things to put the script in the spec file

* Sun Aug 29 1999 Giulio Orsero <giulioo@tiscalinet.it>
- 3.6.8

* Sat Aug 28 1999 Giulio Orsero <giulioo@tiscalinet.it>
- 3.6.7 First RPM build.