#
# Conditional build:
-# _without_php don't build php extension
-# _without_perl don't build perl extension
+%bcond_without php # don't build php extension
+%bcond_without perl # don't build perl extension
#
# TODO:
# - register php module
# - perl BRs
%include /usr/lib/rpm/macros.perl
Summary: Common Unix Printing System
-Summary(pl): Popularny System Druku dla Uniksa
+Summary(pl): Popularny system druku dla Uniksa
Summary(pt_BR): Sistema Unix de Impressão
Name: cups
-Version: 1.1.19
-Release: 5
+%define rcver rc1
+Version: 1.1.21
+Release: 0.%{rcver}.1
Epoch: 1
License: GPL/LGPL
Group: Applications/Printing
-# Source0-md5: 04cbeed9a8acfe23624f1cb6be9c3eac
-Source0: ftp://ftp.easysw.com/pub/%{name}/%{version}/%{name}-%{version}-source.tar.bz2
+Source0: ftp://ftp.easysw.com/pub/%{name}/%{?rcver:test}%{!?rcver:%{version}}/%{name}-%{version}%{rcver}-source.tar.bz2
+# Source0-md5: 3cf609727cbf8d8c097d16100be58a28
Source1: %{name}.init
Source2: %{name}.pamd
Source3: %{name}.logrotate
Patch6: %{name}-man_pages_linking.patch
Patch7: %{name}-nolibs.patch
Patch8: %{name}-chown.patch
+Patch9: %{name}-nostrip.patch
+Patch10: %{name}-rpath.patch
+Patch11: %{name}-gcc34.patch
URL: http://www.cups.org/
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: libtiff-devel
-BuildRequires: openssl-devel >= 0.9.7c
+BuildRequires: openslp-devel
+BuildRequires: openssl-devel >= 0.9.7d
BuildRequires: pam-devel
-%{?!_without_php:BuildRequires: php-devel}
+%{?with_php:BuildRequires: php-devel}
BuildRequires: pkgconfig
+BuildRequires: rpm-perlprov
PreReq: %{name}-libs = %{epoch}:%{version}
Requires(post,preun): /sbin/chkconfig
Requires: pam >= 0.77.3
Obsoletes: LPRng
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+%define _ulibdir %{_prefix}/lib
+
%description
CUPS provides a portable printing layer for UNIX®-based operating
systems. It has been developed by Easy Software Products to promote a
support real-world printing under UNIX.
%description -l pl
-CUPS dostarcza standardowy poziom drukowania dla systemów bazuj±cych
-na UNIXie. CUPS u¿ywa protoko³u IPP - Internet Printint Protocol jako
-podstawy do zarz±dzania zadaniami i kolejkami druku.
+CUPS dostarcza standardowy poziom drukowania dla systemów uniksowych.
+CUPS u¿ywa protoko³u IPP - Internet Printint Protocol jako podstawy do
+zarz±dzania zadaniami i kolejkami druku.
%description -l pt_BR
O sistema Unix de impressão (CUPS) fornece uma camada de impressão
%description -n php-cups -l pl
Modu³ PHP do Popularnego Systemu Druku dla Uniksa.
+%package backend-usb
+Summary: USB backend for CUPS
+Summary(pl): Backend USB dla CUPS-a
+Group: Applications/Printing
+Requires: cups = %{epoch}:%{version}
+
+%description backend-usb
+This package allow CUPS printing on USB printers.
+
+%description backend-usb -l pl
+Ten pakiet umo¿liwia drukowanie z poziomu CUPS-a na drukarkach USB.
+
+%package backend-serial
+Summary: Serial port backend for CUPS
+Summary(pl): Backend obs³uguj±cy porty szeregowe dla CUPS-a
+Group: Applications/Printing
+Requires: cups = %{epoch}:%{version}
+
+%description backend-serial
+This package allow CUPS printing on printers connected by serial
+ports.
+
+%description backend-serial -l pl
+Ten pakiet umo¿liwia drukowanie z poziomu CUPS-a na drukarkach
+pod³±czonych do portów szeregowych.
+
+%package backend-parallel
+Summary: Parallel port backend for CUPS
+Summary(pl): Backend obs³uguj±cy porty równoleg³e dla CUPS-a
+Group: Applications/Printing
+Requires: cups = %{epoch}:%{version}
+
+%description backend-parallel
+This package allow CUPS printing on printers connected by parallel
+ports.
+
+%description backend-parallel -l pl
+Ten pakiet umo¿liwia drukowanie z poziomu CUPS-a na drukarkach
+pod³±czonych do portów równoleg³ych.
+
%prep
-%setup -q
+%setup -q -n %{name}-%{version}%{rcver}
%patch0 -p1
%patch1 -p1
# wtf?
%patch6 -p1
%patch7 -p1
%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
%build
%{__aclocal}
%{__autoconf}
%configure \
- --with-docdir=%{_libdir}/%{name}/cgi-bin
+ --libdir=%{_ulibdir} \
+ --with-docdir=%{_ulibdir}/%{name}/cgi-bin
%{__make}
-%{?!_without_php:%{__make} -C scripting/php}
+perl -pi -e 's#-I\.\.\/\.\.#-I../.. -I../../cups#g' scripting/php/Makefile
+%{?with_php:%{__make} -C scripting/php}
-%if 0%{?!_without_perl:1}
+%if %{with perl}
cd scripting/perl
%{__perl} -pi -e 's@-lcups@-L../../cups $1@' Makefile.PL
%{__perl} Makefile.PL \
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-%if 0%{?!_without_php:1}
+if [ "%{_lib}" != "lib" ] ; then
+ install -d $RPM_BUILD_ROOT%{_libdir}
+ mv $RPM_BUILD_ROOT%{_ulibdir}/*.so* $RPM_BUILD_ROOT%{_libdir}
+ mv $RPM_BUILD_ROOT%{_ulibdir}/*.a $RPM_BUILD_ROOT%{_libdir}
+fi
+
+%if %{with php}
%{__make} -C scripting/php install \
PHPDIR="$RPM_BUILD_ROOT`php-config --extension-dir`"
%endif
-%if 0%{?!_without_perl:1}
+%if %{with perl}
cd scripting/perl
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
# for internal http browser:
-cp doc/*.html $RPM_BUILD_ROOT%{_libdir}/%{name}/cgi-bin
-cp doc/*.css $RPM_BUILD_ROOT%{_libdir}/%{name}/cgi-bin
-cp doc/images/* $RPM_BUILD_ROOT%{_libdir}/%{name}/cgi-bin/images
+cp doc/*.html $RPM_BUILD_ROOT%{_ulibdir}/%{name}/cgi-bin
+cp doc/*.css $RPM_BUILD_ROOT%{_ulibdir}/%{name}/cgi-bin
+cp doc/images/* $RPM_BUILD_ROOT%{_ulibdir}/%{name}/cgi-bin/images
touch $RPM_BUILD_ROOT/var/log/cups/{access_log,error_log,page_log}
touch $RPM_BUILD_ROOT/etc/security/blacklist.cups
%post
/sbin/chkconfig --add cups
-if [ -f /var/lock/subsys/cupsd ]; then
+if [ -f /var/lock/subsys/cups ]; then
/etc/rc.d/init.d/cups restart 1>&2
else
echo "Run \"/etc/rc.d/init.d/cups start\" to start cups daemon."
%preun
if [ "$1" = "0" ]; then
- if [ -f /var/lock/subsys/cupsd ]; then
+ if [ -f /var/lock/subsys/cups ]; then
/etc/rc.d/init.d/cups stop 1>&2
fi
/sbin/chkconfig --del cups
%attr(755,root,root) %{_bindir}/cupstestppd
%attr(755,root,root) %{_bindir}/disable
%attr(755,root,root) %{_bindir}/enable
-%dir %{_libdir}/cups
-%dir %{_libdir}/cups/*
-%attr(755,root,root) %{_libdir}/cups/*/*
-%attr(755,root,root) %{_sbindir}/*
+%dir %{_ulibdir}/cups
+%dir %{_ulibdir}/cups/*
+%attr(755,root,root) %{_ulibdir}/cups/*/*
+%exclude %{_ulibdir}/cups/backend/usb
+%exclude %{_ulibdir}/cups/backend/serial
+%exclude %{_ulibdir}/cups/backend/parallel
+%attr(755,root,root) %{_sbindir}/cupsd
%{_datadir}/cups
%{_mandir}/man1/backend.1*
%{_mandir}/man1/cupstestppd.1*
%attr(755,root,root) %{_bindir}/lpr
%attr(755,root,root) %{_bindir}/lprm
%attr(755,root,root) %{_bindir}/lpstat
+%attr(755,root,root) %{_sbindir}/accept
+%attr(755,root,root) %{_sbindir}/cupsaddsmb
+%attr(755,root,root) %{_sbindir}/lpadmin
+%attr(755,root,root) %{_sbindir}/lpc
+%attr(755,root,root) %{_sbindir}/lpinfo
+%attr(755,root,root) %{_sbindir}/lpmove
+%attr(755,root,root) %{_sbindir}/reject
%{_mandir}/man1/cancel.1*
%{_mandir}/man1/lp.1*
%{_mandir}/man1/lpoptions.1*
%attr(755,root,root) %{_bindir}/cups-config
%{_includedir}/cups
%{_libdir}/lib*.so
+%{_mandir}/man1/cups-config*
%{_mandir}/man3/*
-%lang(fr) %{_mandir}/fr/man3/*
+%lang(fr) %{_mandir}/fr/man1/cups-config*
%files static
%defattr(644,root,root,755)
%{_libdir}/*.a
-%if 0%{?!_without_perl:1}
+%if %{with perl}
%files -n perl-cups
%defattr(644,root,root,755)
%{perl_vendorarch}/*.pm
%attr(755,root,root) %{perl_vendorarch}/auto/CUPS/*.so
%endif
-%if 0%{?!_without_php:1}
+%if %{with php}
%files -n php-cups
%defattr(644,root,root,755)
%attr(755,root,root) %(php-config --extension-dir)/*
%endif
+
+%files backend-usb
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_ulibdir}/cups/backend/usb
+
+%files backend-serial
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_ulibdir}/cups/backend/serial
+
+%files backend-parallel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_ulibdir}/cups/backend/parallel