Sophie

Sophie

distrib > Mandriva > 7.2 > i586 > media > main-src > by-pkgid > 2e42ba154be07f8b1cfbaa2acb04b835 > files > 11

cups-1.1.4-3mdk.src.rpm

%define name cups
%define version 1.1.4
%define real_version %{version}
%define release 3mdk

Summary: Common Unix Printing System
Name: %{name}
Version: %{version}
Release: %{release}
Copyright: GPL
Group: System/Servers
Source: ftp://ftp.easysw.com/pub/cups/%{real_version}/%{name}-%{real_version}-source.tar.bz2
# Small C program to get list of all installed PPD files
Source1: poll_ppd_base.c.bz2
# Small C program to list the printer-specific options of a particular printer
Source2: lphelp.c.bz2
# Icon for the Mandrake menu
Source3: cups.png.bz2
# Complete replacement for startup script to have it the
# Mandrake way
Source5: cups.startup.bz2
# Script for cleaning up the PPD files
Source6: cleanppd.pl.bz2
Patch1: cups-1.1.3-cupsdconf.patch.bz2
Patch2: cups-1.1.3-nopassword.patch.bz2
Patch4: cups-1.1.3-mimetypes.patch.bz2
Patch5: cups-1.1.3-mdktestpage.patch.bz2
Patch6: cups-1.1.3-pamconfig.patch.bz2
Patch7: cups-1.1.4-hpglscaling.patch.bz2
Patch8: cups-1.1.4-httpc.patch.bz2
Url: http://www.cups.org
BuildRoot: %{_tmppath}/%{name}-buildroot
# Moved this "Requires:" entry to CUPS-Drivers package
#Requires: ghostscript >= 5.50-15mdk
Requires: rpm >= 3.0.4-6mdk /usr/sbin/update-alternatives

%package devel
Summary: Common Unix Printing System - development environment
Group: Development/C

%description
The Common Unix Printing System provides a portable printing layer for 
UNIX(TM) operating systems. It has been developed by Easy Software Products 
to promote a standard printing solution for all UNIX vendors and users. 
CUPS provides the System V and Berkeley command-line interfaces. 

%description devel
The Common Unix Printing System provides a portable printing layer for 
UNIX(TM) operating systems. This is the development package for creating
additional printer drivers, printing software, and other CUPS services.

%prep
%setup -q -n %{name}-%{real_version}

# Do NEVER use cups.suse (this package is for Mandrake)
cp -f data/cups.pam data/cups.suse

# to allow root to configure the printers from any machine by the web
# interface and to generate /etc/printcap for KDE finding the printers
%patch1 -p0
# Do changes that it is possible to use the CUPS WWW interface and
# KUPS also when root has no password (makes CUPS more convenient for
# home users without network
%patch2 -p0
# Apply a bugfix of HPGL recognition in /etc/cups/mime.types
%patch4 -p0
# "Mandrakize" test page
%patch5 -p0
# Adapt PAM configuration to Linux Mandrake
%patch6 -p1
# Fix HPGL scaling bug
%patch7 -p0
# Security fix: lpstat and web interface displayed the SMB password before
%patch8 -p0
# Load additional tools
bzcat %{SOURCE1} > $RPM_BUILD_DIR/%{name}-%{real_version}/poll_ppd_base.c
bzcat %{SOURCE2} > $RPM_BUILD_DIR/%{name}-%{real_version}/lphelp.c
# Load menu icon
bzcat %{SOURCE3} > $RPM_BUILD_DIR/%{name}-%{real_version}/cups.png
# Load Mandrake startup script
bzcat %{SOURCE5} > cups.startup

%build

# For 'configure' the macro is not used, because otherwise one does not get the
# /etc and /var directories correctly hardcoded into the executables (they
# would get /usr/etc and /usr/var.
./configure
%make LOGDIR=$RPM_BUILD_ROOT%{_var}/log/cups \
             REQUESTS=$RPM_BUILD_ROOT%{_var}/spool/cups \
             SERVERROOT=$RPM_BUILD_ROOT%{_sysconfdir}/cups \
             MANDIR=$RPM_BUILD_ROOT%{_mandir} \
             PAMDIR=$RPM_BUILD_ROOT%{_sysconfdir}/pam.d \
             BINDIR=$RPM_BUILD_ROOT%{_bindir} \
             SBINDIR=$RPM_BUILD_ROOT%{_sbindir} \
             INITDIR=$RPM_BUILD_ROOT%{_sysconfdir} \
             CHOWN=/bin/echo

# Compile additional tools
gcc -opoll_ppd_base -I. -I./cups -L./cups -lcups poll_ppd_base.c
gcc -olphelp -I. -I./cups -L./cups -lcups lphelp.c

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_initrddir}

%makeinstall LOGDIR=$RPM_BUILD_ROOT%{_var}/log/cups \
             REQUESTS=$RPM_BUILD_ROOT%{_var}/spool/cups \
             SERVERROOT=$RPM_BUILD_ROOT%{_sysconfdir}/cups \
             MANDIR=$RPM_BUILD_ROOT%{_mandir} \
             PAMDIR=$RPM_BUILD_ROOT%{_sysconfdir}/pam.d \
             BINDIR=$RPM_BUILD_ROOT%{_bindir} \
             SBINDIR=$RPM_BUILD_ROOT%{_sbindir} \
             INITDIR=$RPM_BUILD_ROOT%{_sysconfdir} \
             CHOWN=/bin/echo

# Install additional tools

install -m 755 poll_ppd_base $RPM_BUILD_ROOT%{_bindir}
install -m 755 lphelp $RPM_BUILD_ROOT%{_bindir}

# install menu icon

mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/locolor/16x16/apps/
install -m 644 cups.png $RPM_BUILD_ROOT%{_datadir}/icons/locolor/16x16/apps/

# install script to call the web interface from the menu
cat <<EOF > $RPM_BUILD_ROOT/usr/bin/cupsWebAdmin
#!/bin/sh
url='http://localhost:631/'
if ! [ -z "\$BROWSER" ] && ( which \$BROWSER ); then
  browser=\`which \$BROWSER\`
elif [ -x /usr/bin/netscape ]; then
  browser=/usr/bin/netscape
elif [ -x /usr/bin/konqueror ]; then
  browser=/usr/bin/konqueror
elif [ -x /usr/bin/lynx ]; then
  browser='xterm -bg black -fg white -e lynx'
else
  xmessage "No web browser found, install one or set the BROWSER environment variable!"
  exit 1
fi
\$browser \$url
EOF
chmod a+rx $RPM_BUILD_ROOT/usr/bin/cupsWebAdmin

# install menu entry
mkdir -p $RPM_BUILD_ROOT/usr/lib/menu

cat <<EOF > $RPM_BUILD_ROOT/usr/lib/menu/cups
?package(cups): needs=X11 \
section=Configuration/Printing \
title="CUPS WWW admin tool" \
command="/usr/bin/cupsWebAdmin 1>/dev/null 2>/dev/null" \
icon="/usr/share/icons/locolor/16x16/apps/cups.png"
EOF

# Install startup script

install -m 755 cups.startup $RPM_BUILD_ROOT%{_initrddir}/cups

# Install PPDs
mkdir -p $RPM_BUILD_ROOT%{_datadir}/cups/model
install -m 755 ppd/*.ppd $RPM_BUILD_ROOT%{_datadir}/cups/model
# Uncompress Perl script for cleaning up manufacturer entries in PPD files
bzcat %{SOURCE6} > ./cleanppd.pl
chmod a+rx ./cleanppd.pl
# Do the clean-up
find $RPM_BUILD_ROOT/usr/share/cups/model -name "*.ppd" -print -exec ./cleanppd.pl '{}' \;

# Prepare CUPS for XPP with overloaded cupsGetPassword (only make available
# the SHARED CUPS library, not the STATIC one)

#ln -s libcups.so.2 $RPM_BUILD_ROOT%{_libdir}/libcups.so

# Needed by CUPS driver development kit of GIMP-Print

#ln -s libcupsimage.so.2 $RPM_BUILD_ROOT%{_libdir}/libcupsimage.so

# prepare the commands conflicting with LPD for the update-alternatives
# treatment
( cd $RPM_BUILD_ROOT%{_bindir}
  mv lpr lpr-cups
  mv lpq lpq-cups
  mv lprm lprm-cups
)
( cd $RPM_BUILD_ROOT%{_sbindir}
  mv lpc lpc-cups
)
( cd $RPM_BUILD_ROOT/usr/share/man/man1
  mv lpr.1 lpr-cups.1
  mv lpq.1 lpq-cups.1
  mv lprm.1 lprm-cups.1
)
( cd $RPM_BUILD_ROOT/usr/share/man/man8
  mv lpc.8 lpc-cups.8
)

%post

# Set compatibility link for startup script

#[ -d %{_sysconfdir}/rc.d/init.d ] && \
#	ln -sf %{_initrddir}/cups %{_sysconfdir}/rc.d/init.d

# Let CUPS daemon be automatically started at boot time

/sbin/ldconfig
/sbin/chkconfig --add cups

# Set up update-alternatives entries
%{_sbindir}/update-alternatives --install %{_bindir}/lpr lpr /usr/bin/lpr-cups 10 --slave %{_mandir}/man1/lpr.1.bz2 lpr.1.bz2 /usr/share/man/man1/lpr-cups.1.bz2
%{_sbindir}/update-alternatives --install %{_bindir}/lpq lpq /usr/bin/lpq-cups 10 --slave %{_mandir}/man1/lpq.1.bz2 lpq.1.bz2 /usr/share/man/man1/lpq-cups.1.bz2
%{_sbindir}/update-alternatives --install %{_bindir}/lprm lprm /usr/bin/lprm-cups 10 --slave %{_mandir}/man1/lprm.1.bz2 lprm.1.bz2 /usr/share/man/man1/lprm-cups.1.bz2
%{_sbindir}/update-alternatives --install %{_sbindir}/lpc lpc /usr/sbin/lpc-cups 10 --slave %{_mandir}/man8/lpc.8.bz2 lpc.1.bz2 /usr/share/man/man8/lpc-cups.8.bz2

##menu
if [ -x /usr/bin/update-menus ]; then
        /usr/bin/update-menus
fi

# Restart the CUPS daemon when it was running before
! ( lpstat -r 1> /dev/null 2>&1 ) || (
  %{_initrddir}/cups stop 1> /dev/null 2>&1
  rm -f /etc/cups/ppds.dat
  rm -f /var/spool/cups/[cd]*
  rm -f /var/spool/cups/tmp/*
  %{_initrddir}/cups start 1> /dev/null 2>&1
)

%preun

if [ "$1" = 0 ]; then

  # Remove update-alternatives entries
  %{_sbindir}/update-alternatives --remove lpr /usr/bin/lpr-cups
  %{_sbindir}/update-alternatives --remove lpq /usr/bin/lpq-cups
  %{_sbindir}/update-alternatives --remove lprm /usr/bin/lprm-cups
  %{_sbindir}/update-alternatives --remove lpc /usr/sbin/lpc-cups

  /sbin/chkconfig --del cups

fi

%postun

/sbin/ldconfig

## menu
if [ "$1" = 0 ]; then
        if [ -x /usr/bin/update-menus ]; then
                /usr/bin/update-menus
        fi
fi

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
#%doc CHANGES.txt CREDITS.txt LICENSE.txt README.txt
%doc %{_defaultdocdir}/%{name}
%config(noreplace) %{_sysconfdir}/cups
%config(noreplace) %{_initrddir}/cups
%{_sbindir}/*
%{_bindir}/*
%{_libdir}/*.so.*
# These ".so" links are in the main package but not in the devel package
# because they are needed for the function overloading in XPP and QTCUPS
%{_libdir}/*.so
%{_libdir}/cups
%{_datadir}/cups
%{_datadir}/locale
%{_mandir}/*
%{_var}/log/cups
# Set ownerships of spool directory which is normally done by 'make install'
# Because RPM does 'make install' as normal user, this has to be done here
%dir %attr(0700,lp,root) %{_var}/spool/cups
%dir %attr(01700,lp,root) %{_var}/spool/cups/tmp
%config(noreplace) %{_sysconfdir}/pam.d/cups
# menu entry
%{_datadir}/icons/locolor/16x16/apps/
%{_libdir}/menu

%files devel
%defattr(-,root,root)
%{_includedir}/cups/*
#Do not include /usr/lib/libcups.a because otherwise XPP and other programs
#which overload CUPS library functions would not compile
#%{_libdir}/*.a

%changelog
* Sat Oct 21 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.4-3mdk
- Security fix: lpstat and web interface displayed the SMB password before

* Tue Oct 17 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.4-2mdk
- Set default Filterlimit to 999999 in /etc/cups/cupsd.conf, the default
  value zero limited to one process instead of allowing unlimited processes.
- Fixed a bug in scaling of HPGL files.

* Sat Oct 14 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.4-1mdk
- New release with all previous bugfixes included and important fixes for
  the GIMP-Print drivers.

* Mon Oct  2 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.3-13mdk
- Applied patch by Michael Sweet for the test file bug in the IPP backend.

* Sun Oct  1 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.3-12mdk
- Fixed a bug of the IPP backend which prevented text with accented characters
  being transferred correctly to the printing server.

* Sun Oct  1 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.3-11mdk
- Cleaned up manufacturer entry in the CUPS PPD files
- Fixed a bug in handling lines with leading spaces in ~/.lpoptions

* Thu Sep 28 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.3-10mdk
- Menu call for the web interface not fixed to Netscape any more.

* Thu Sep 28 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.3-9mdk
- New bugfix patch of Michael Sweet for admin.cgi

* Wed Sep 27 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.3-8mdk
- Fixed bug in admin.cgi by a patch of Michael Sweet, no downdate to 1.1.2
  any more
- Fixed bug with duplex printing in HP LaserJet driver

* Tue Sep 26 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.3-7mdk
- Fixed bug in IPP backend which prevented options from
  being transferred correctly to a remote printer

* Tue Sep 26 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.3-6mdk
- Applied new PAM configuration

* Mon Sep 25 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.3-5mdk
- Program "lphelp" expanded to show also numerical options of CUPS-O-MATIC
  PPD files.

* Sat Sep 23 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.3-4mdk
- Mandrakized the test page
- Login/password request for command line tools

* Fri Sep 22 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.3-3mdk
- Revised support of accounts without password. Now XPP, KUPS and QTCUPS
  do not ask for the login/password again and again when one clicks
  "Cancel" in the login dialog.

* Wed Sep 20 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.3-2mdk
- Fixed bug of adding a printer with the web interface being impossible
- Make CUPS WWW interface and KUPS usable when root has no 
  password

* Tue Sep 19 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.3-1mdk
- Corrected "preun" script, so that update-alternatives links do not
  get lost on update of the package.
- Updated to CUPS 1.1.3 which includes all the previous bug fix
  patches and some additional bugfixes.

* Sat Sep 16 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.2-22mdk
- changed default configuration to generate an /etc/printcap
  file. So non-natively CUPS supporting programs (as KDE)
  find the printers.

* Thu Sep 14 2000 Guillaume Cottenceau <gc@mandrakesoft.com> 1.1.2-21mdk
- corrected incoherent-subsys, till sucks
- added reload

* Wed Sep 13 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.2-20mdk
- Replaced startup script completely to fit to the Mandrake
  standard
- Applied another development snapshot patch of Michael Sweet to fix
  bugs in pstoimage and pstoraster, and the information propafation
  between the CUPS daemons on different machines.

* Sat Sep  9 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.2-19mdk
- Applied another development snapshot patch of Michael Sweet to fix
  several bugs.

* Fri Sep  8 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.2-18mdk
- {_datadir}/locale was forgotten in files section, added

* Fri Sep  8 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.2-17mdk
- Added /usr/sbin/update-alternatives to "Requires:" line
  to surround a bug of version number comparing in RPM

* Thu Sep  7 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.2-16mdk
- Turned off feature of "Implicit classes", it is broken.
- Introduced "Requires:" line to make sure that "update-
  alternatives" is available.
- Added patch of Michael Sweet to support instances in lpq
  and lprm.

* Thu Sep  7 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.2-15mdk
- Applied development snapshot patch of Michael Sweet to fix
  several bugs.
- Added automatic daemon restart on update.

* Wed Sep  5 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.2-14mdk
- Fixed segfaults in poll_ppd_base
- Better description in cups.sh (help text for startup 
  services config programs)

* Fri Sep  1 2000 Till Kamppeter <till@mandrakesoft.com> 1.1.2-13mdk
- Fixed bugs in the "files" list of specfile (definition of doc dir)

* Tue Aug 29 2000 Till Kamppeter <tkamppeter@mandrakesoft.com> 1.1.2-12mdk
- Added patch adjusting the USB printer autodetection to the current state

* Fri Aug 25 2000 Till Kamppeter <tkamppeter@mandrakesoft.com> 1.1.2-11mdk
- Menu entry for CUPS WWW Admin tool added
- Removed compatibility link /etc/init.d/cups to /etc/rc.d/init.d/cups, init
  script simply in %{_initrddir} now.

* Fri Aug 25 2000 Till Kamppeter <tkamppeter@mandrakesoft.com> 1.1.2-10mdk
- Fixed compiler options for the additional tools

* Thu Aug 24 2000 Till Kamppeter <tkamppeter@mandrakesoft.com> 1.1.2-9mdk
- Made the cups package ready for co-existing with the old lpr printing
  system.

* Mon Aug 21 2000 Till Kamppeter <tkamppeter@mandrakesoft.com> 1.1.2-8mdk
- Moved "/usr/lib/libcups*.so" links from devel package to main package
  because the function overloading in XPP and QTCUPS would not work without
  these links.

* Thu Aug 17 2000 Till Kamppeter <tkamppeter@mandrakesoft.com> 1.1.2-7mdk
- Added program "lphelp" which lists the printer-specific options defined
  in the PPD file, so that one can make use of it in "lp", "lpr", and
  "lpoptions" commands at the command line.
- Got a bugfix from Michael Sweet to fix an htmltops problem, applied it
- Applied bugfix for HPGL recognition in /etc/cups/mime.types

* Thu Aug 17 2000 Till Kamppeter <tkamppeter@mandrakesoft.com> 1.1.2-6mdk
- Added program "poll_ppd_base" to get a list of all PPD files installed with
  manufacturer and model names of the printers (useful for installation/
  configuration scripts)

* Mon Aug 14 2000 Till Kamppeter <tkamppeter@mandrakesoft.com> 1.1.2-5mdk
- Added link libcupsimage.so --> libcupsimage.so.2 so thet drivers based
  on the CUPS driver development kit of GIMP Print compile
- Moved links "*.so" --> "*.so.2" to the development package (rpmlint
  recommends this)

* Wed Aug  9 2000 Till Kamppeter <tkamppeter@mandrakesoft.com> 1.1.2-4mdk
- Replaced "chown" in "%post" by "%attr" in file list
- Now GhostScript 5.50 is not more required by this package but by cups-drivers
- Compatibility link /etc/rc.d/init.d/cups, if /etc/rc.d/init.d/ exists

* Tue Aug  8 2000 Till Kamppeter <tkamppeter@mandrakesoft.com> 1.1.2-3mdk
- Let the PPDs delivered with CUPS be installed, too

* Tue Aug  8 2000 Till Kamppeter <tkamppeter@mandrakesoft.com> 1.1.2-2mdk
- Moved init script to from /etc/rc.d/init.d/ to /etc/init.d
- Now GhostScript 5.50 is required
- Patched chkconfig entry in /etc/init.d/cups to 2345 60 60 (as lpd)

* Tue Aug  8 2000 Till Kamppeter <tkamppeter@mandrakesoft.com> 1.1.2-1mdk
- Excluded static CUPS library to allow overloading of CUPS functions
- Patched CUPS daemon config to use Web interface for administration
- pstoraster not removed to have the flexibility to also use CUPS drivers
- Updated to version 1.1.2 with bugfix patch for the Makefile

* Tue Jul  4 2000 François Pons <fpons@mandrakesoft.com> 1.1-0.b5.1mdk
- removed pstoraster from installation as drivers are in cups-drivers.
- initial release.