]> git.pld-linux.org Git - packages/cups.git/blob - cups.spec
- security fix for a DoS vulnerability (CAN-2005-2097)
[packages/cups.git] / cups.spec
1 #
2 # Conditional build:
3 %bcond_without  php     # don't build PHP extension
4 %bcond_without  perl    # don't build Perl extension
5 #
6 # TODO:
7 # - register php module
8 # - build/install java ext ?
9 # - perl BRs
10 %include        /usr/lib/rpm/macros.perl
11 Summary:        Common Unix Printing System
12 Summary(pl):    Popularny system druku dla Uniksa
13 Summary(pt_BR): Sistema Unix de Impressão
14 Name:           cups
15 Version:        1.1.23
16 Release:        4
17 Epoch:          1
18 License:        GPL/LGPL
19 Group:          Applications/Printing
20 Source0:        http://ftp.easysw.com/pub/cups/%{version}/%{name}-%{version}-source.tar.bz2
21 # Source0-md5:  4ce09b1dce09b6b9398af0daae9adf63
22 #Source0:       http://ftp.easysw.com/pub/cups/test/%{name}-%{version}%{_suf}-source.tar.bz2
23 Source1:        %{name}.init
24 Source2:        %{name}.pamd
25 Source3:        %{name}.logrotate
26 Patch0:         %{name}-config.patch
27 Patch1:         %{name}-lp-lpr.patch
28 Patch2:         %{name}-options.patch
29 Patch3:         %{name}-ENCRYPTIONtxt.patch
30 Patch4:         %{name}-man_pages_linking.patch
31 Patch5:         %{name}-nolibs.patch
32 Patch6:         %{name}-nostrip.patch
33 Patch7:         %{name}-rpath.patch
34 Patch8:         %{name}-gcc34.patch
35 Patch9:         %{name}-tmpdir.patch
36 Patch10:        %{name}-gcc4.patch
37 Patch11:        %{name}-CAN-2005-2097.patch
38 URL:            http://www.cups.org/
39 BuildRequires:  autoconf
40 BuildRequires:  automake
41 BuildRequires:  libjpeg-devel
42 BuildRequires:  libpng-devel
43 BuildRequires:  libtiff-devel
44 BuildRequires:  openslp-devel
45 BuildRequires:  openssl-devel >= 0.9.7d
46 BuildRequires:  pam-devel
47 %{?with_php:BuildRequires:      php-devel}
48 BuildRequires:  pkgconfig
49 BuildRequires:  rpm-perlprov
50 PreReq:         %{name}-libs = %{epoch}:%{version}-%{release}
51 Requires(post,preun):   /sbin/chkconfig
52 Requires:       pam >= 0.77.3
53 Conflicts:      ghostscript < 7.05.4
54 Obsoletes:      LPRng
55 Obsoletes:      lpr
56 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
58 %define         _ulibdir        %{_prefix}/lib
59
60 %description
61 CUPS provides a portable printing layer for UNIX-based operating
62 systems. It has been developed by Easy Software Products to promote a
63 standard printing solution for all UNIX vendors and users. CUPS
64 provides the System V and Berkeley command-line interfaces. CUPS uses
65 the Internet Printing Protocol ("IPP") as the basis for managing print
66 jobs and queues. The Line Printer Daemon ("LPD") Server Message Block
67 ("SMB"), and AppSocket (a.k.a. JetDirect) protocols are also supported
68 with reduced functionality. CUPS adds network printer browsing and
69 PostScript Printer Description ("PPD") based printing options to
70 support real-world printing under UNIX.
71
72 %description -l pl
73 CUPS dostarcza standardowy poziom drukowania dla systemów uniksowych.
74 CUPS u¿ywa protoko³u IPP - Internet Printint Protocol jako podstawy do
75 zarz±dzania zadaniami i kolejkami druku.
76
77 %description -l pt_BR
78 O sistema Unix de impressão (CUPS) fornece uma camada de impressão
79 portável para os sistemas operacionais baseados no UNIX®.
80
81 %package lib
82 Summary:        Common Unix Printing System Libraries
83 Summary(pl):    Biblioteki dla CUPS
84 Summary(pt_BR): Sistema Unix de Impressão - bibliotecas para uso em clientes cups
85 Group:          Libraries
86 Provides:       %{name}-libs = %{epoch}:%{version}-%{release}
87 Obsoletes:      %{name}-libs
88 Obsoletes:      libcups1
89
90 %description lib
91 Common Unix Printing System Libraries.
92
93 %description lib -l pl
94 Biblioteki dla CUPS.
95
96 %description lib -l pt_BR
97 Bibliotecas CUPS requeridas pelos clientes CUPS.
98
99 %package clients
100 Summary:        Common Unix Printing System Clients
101 Summary(pl):    Aplikacje klienckie dla CUPS
102 Group:          Applications/Printing
103 Provides:       %{name}-clients = %{epoch}:%{version}-%{release}
104 Conflicts:      LPRng
105
106 %description clients
107 Common Unix Printing System Clients.
108
109 %description clients -l pl
110 Aplikacje klienckie dla CUPS.
111
112 %package image-lib
113 Summary:        Common Unix Printing System Libraries - images manipulation
114 Summary(pl):    Biblioteki dla CUPS - obs³uga formatów graficznych
115 Summary(pt_BR): Sistema Unix de Impressão - bibliotecas para uso em clientes cups
116 Group:          Libraries
117 Requires:       %{name}-lib = %{epoch}:%{version}-%{release}
118 Obsoletes:      libcups1
119
120 %description image-lib
121 Common Unix Printing System Libraries - images manupalation.
122
123 %description image-lib -l pl
124 Biblioteki dla CUPS - obs³uga formatów graficznych.
125
126 %description image-lib -l pt_BR
127 Bibliotecas CUPS requeridas pelos clientes CUPS.
128
129 %package devel
130 Summary:        Common Unix Printing System development files
131 Summary(pl):    Popularny System Druku dla Uniksa, pliki nag³ówkowe
132 Summary(pt_BR): Sistema Unix de Impressão - ambiente de desenvolvimento
133 Group:          Development/Libraries
134 Requires:       %{name}-image-lib = %{epoch}:%{version}-%{release}
135 Requires:       %{name}-lib = %{epoch}:%{version}-%{release}
136 Obsoletes:      libcups1-devel
137
138 %description devel
139 Common Unix Printing System development files.
140
141 %description devel -l pl
142 Popularny System Druku dla Uniksa, pliki nag³ówkowe.
143
144 %description devel -l pt_BR
145 Este pacote é um adicional que contem um ambiente de desenvolvimento
146 para a criação de suporte a novas impressoras e novos serviços ao
147 CUPS.
148
149 %package static
150 Summary:        Common Unix Printing System static libraries
151 Summary(pl):    Popularny System Druku dla Uniksa, biblioteki statyczne
152 Summary(pt_BR): Common Unix Printing System - bibliotecas estáticas
153 Group:          Development/Libraries
154 Requires:       %{name}-devel = %{epoch}:%{version}-%{release}
155
156 %description static
157 Common Unix Printing System static libraries.
158
159 %description static -l pl
160 Popularny System Druku dla Uniksa, biblioteki statyczne.
161
162 %description static -l pt_BR
163 Bibliotecas estáticas para desenvolvimento de programas que usam as
164 bibliotecas do CUPS.
165
166 %package -n perl-cups
167 Summary:        Perl module for CUPS
168 Summary(pl):    Modu³ Perla CUPS
169 Group:          Development/Languages/Perl
170 Requires:       %{name}-lib = %{epoch}:%{version}-%{release}
171
172 %description -n perl-cups
173 Perl module for Common Unix Printing System.
174
175 %description -n perl-cups -l pl
176 Modu³ Perla do Popularnego Systemu Druku dla Uniksa.
177
178 %package -n php-cups
179 Summary:        PHP module for CUPS
180 Summary(pl):    Modu³ PHP CUPS
181 Group:          Development/Languages/PHP
182 Requires:       %{name}-lib = %{epoch}:%{version}-%{release}
183
184 %description -n php-cups
185 PHP module for Common Unix Printing System.
186
187 %description -n php-cups -l pl
188 Modu³ PHP do Popularnego Systemu Druku dla Uniksa.
189
190 %package backend-usb
191 Summary:        USB backend for CUPS
192 Summary(pl):    Backend USB dla CUPS-a
193 Group:          Applications/Printing
194 Requires:       %{name} = %{epoch}:%{version}-%{release}
195
196 %description backend-usb
197 This package allow CUPS printing on USB printers.
198
199 %description backend-usb -l pl
200 Ten pakiet umo¿liwia drukowanie z poziomu CUPS-a na drukarkach USB.
201
202 %package backend-serial
203 Summary:        Serial port backend for CUPS
204 Summary(pl):    Backend obs³uguj±cy porty szeregowe dla CUPS-a
205 Group:          Applications/Printing
206 Requires:       %{name} = %{epoch}:%{version}-%{release}
207
208 %description backend-serial
209 This package allow CUPS printing on printers connected by serial
210 ports.
211
212 %description backend-serial -l pl
213 Ten pakiet umo¿liwia drukowanie z poziomu CUPS-a na drukarkach
214 pod³±czonych do portów szeregowych.
215
216 %package backend-parallel
217 Summary:        Parallel port backend for CUPS
218 Summary(pl):    Backend obs³uguj±cy porty równoleg³e dla CUPS-a
219 Group:          Applications/Printing
220 Requires:       %{name} = %{epoch}:%{version}-%{release}
221
222 %description backend-parallel
223 This package allow CUPS printing on printers connected by parallel
224 ports.
225
226 %description backend-parallel -l pl
227 Ten pakiet umo¿liwia drukowanie z poziomu CUPS-a na drukarkach
228 pod³±czonych do portów równoleg³ych.
229
230 %prep
231 %setup -q
232 %patch0 -p1
233 %patch1 -p1
234 %patch2 -p1
235 %patch3 -p1
236 %patch4 -p1
237 %patch5 -p1
238 %patch6 -p1
239 %patch7 -p1
240 %patch8 -p1
241 # wtf?
242 #%patch9 -p1
243 %patch10 -p1
244 %patch11 -p1
245
246 %build
247 %{__aclocal}
248 %{__autoconf}
249 %configure \
250         --libdir=%{_ulibdir} \
251         %{?debug:--enable-debug} \
252         --with-docdir=%{_ulibdir}/%{name}/cgi-bin
253 %{__make}
254
255 %{__perl} -pi -e 's#-I\.\.\/\.\.#-I../.. -I../../cups#g' scripting/php/Makefile
256 %{?with_php:%{__make} -C scripting/php}
257
258 %if %{with perl}
259 cd scripting/perl
260 %{__perl} -pi -e 's@-lcups@-L../../cups $1@' Makefile.PL
261 %{__perl} Makefile.PL \
262         INSTALLDIRS=vendor \
263         OPTIMIZE="%{rpmcflags} -I../.."
264 # avoid rpaths generated by MakeMaker
265 %{__perl} -pi -e 's@LD_RUN_PATH="\$\(LD_RUN_PATH\)" @@' Makefile
266
267 %{__make}
268 cd ../..
269 %endif
270
271 %install
272 rm -rf $RPM_BUILD_ROOT
273 install -d $RPM_BUILD_ROOT/etc/{{rc.d/init.d,pam.d,logrotate.d},security} \
274         $RPM_BUILD_ROOT/var/log/{,archiv/}cups
275
276 %{__make} install \
277         BUILDROOT=$RPM_BUILD_ROOT \
278         CUPS_USER=$(id -u) \
279         CUPS_GROUP=$(id -g)
280
281 if [ "%{_lib}" != "lib" ] ; then
282         install -d $RPM_BUILD_ROOT%{_libdir}
283         mv $RPM_BUILD_ROOT%{_ulibdir}/*.so* $RPM_BUILD_ROOT%{_libdir}
284         mv $RPM_BUILD_ROOT%{_ulibdir}/*.a $RPM_BUILD_ROOT%{_libdir}
285 fi
286
287 %if %{with php}
288 %{__make} -C scripting/php install \
289         PHPDIR="$RPM_BUILD_ROOT`php-config --extension-dir`"
290 %endif
291
292 %if %{with perl}
293 cd scripting/perl
294 %{__make} install \
295         DESTDIR=$RPM_BUILD_ROOT
296 cd ../..
297 %endif
298
299 install %{SOURCE1}      $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
300 install %{SOURCE2}      $RPM_BUILD_ROOT/etc/pam.d/%{name}
301 install %{SOURCE3}      $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
302
303 gzip -9nf $RPM_BUILD_ROOT%{_datadir}/%{name}/model/*.ppd
304
305 # for internal HTTP browser:
306 cp doc/*.html   $RPM_BUILD_ROOT%{_ulibdir}/%{name}/cgi-bin
307 cp doc/*.css    $RPM_BUILD_ROOT%{_ulibdir}/%{name}/cgi-bin
308 cp doc/images/* $RPM_BUILD_ROOT%{_ulibdir}/%{name}/cgi-bin/images
309
310 touch $RPM_BUILD_ROOT/var/log/cups/{access_log,error_log,page_log}
311 touch $RPM_BUILD_ROOT/etc/security/blacklist.cups
312
313 # check-files cleanup
314 rm -rf $RPM_BUILD_ROOT%{_mandir}/{,es/,fr/}cat?
315
316 %clean
317 rm -rf $RPM_BUILD_ROOT
318
319 %post
320 /sbin/chkconfig --add cups
321 if [ -f /var/lock/subsys/cups ]; then
322         /etc/rc.d/init.d/cups restart 1>&2
323 else
324         echo "Run \"/etc/rc.d/init.d/cups start\" to start cups daemon."
325 fi
326
327 %preun
328 if [ "$1" = "0" ]; then
329         if [ -f /var/lock/subsys/cups ]; then
330                 /etc/rc.d/init.d/cups stop 1>&2
331         fi
332         /sbin/chkconfig --del cups
333 fi
334
335 %post   lib -p /sbin/ldconfig
336 %postun lib -p /sbin/ldconfig
337 %post   image-lib -p /sbin/ldconfig
338 %postun image-lib -p /sbin/ldconfig
339
340 %files
341 %defattr(644,root,root,755)
342 #%doc *.gz doc/*.html doc/*.css doc/images
343 %doc *.txt
344 %attr(640,root,root) %config %verify(not size mtime md5) /etc/pam.d/*
345 %attr(754,root,root) /etc/rc.d/init.d/cups
346 %dir %{_sysconfdir}/%{name}
347 %attr(640,root,lp) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/classes.conf
348 %attr(640,root,lp) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/cupsd.conf
349 %attr(640,root,lp) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/printers.conf
350 %attr(640,root,lp) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/*.convs
351 %attr(640,root,lp) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/*.types
352 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/security/blacklist.cups
353 %dir %{_sysconfdir}/%{name}/certs
354 %dir %{_sysconfdir}/%{name}/interfaces
355 %dir %{_sysconfdir}/%{name}/ppd
356 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/%{name}
357 %attr(4755,lp,root) %{_bindir}/lppasswd
358 %attr(755,root,root) %{_bindir}/cupstestppd
359 %attr(755,root,root) %{_bindir}/disable
360 %attr(755,root,root) %{_bindir}/enable
361 %dir %{_ulibdir}/cups
362 %dir %{_ulibdir}/cups/*
363 %attr(755,root,root) %{_ulibdir}/cups/*/*
364 %exclude %{_ulibdir}/cups/backend/usb
365 %exclude %{_ulibdir}/cups/backend/serial
366 %exclude %{_ulibdir}/cups/backend/parallel
367 %attr(755,root,root) %{_sbindir}/cupsd
368 %{_datadir}/cups
369 %{_mandir}/man1/backend.1*
370 %{_mandir}/man1/cupstestppd.1*
371 %{_mandir}/man1/filter.1*
372 %{_mandir}/man1/lppasswd.1*
373 %{_mandir}/man[58]/*
374 %lang(fr) %{_mandir}/fr/man1/backend.1*
375 %lang(fr) %{_mandir}/fr/man1/cupstestppd.1*
376 %lang(fr) %{_mandir}/fr/man1/filter.1*
377 %lang(fr) %{_mandir}/fr/man1/lppasswd.1*
378 %lang(fr) %{_mandir}/fr/man[58]/*
379 %lang(es) %{_mandir}/es/man1/backend.1*
380 %lang(es) %{_mandir}/es/man1/cupstestppd.1*
381 %lang(es) %{_mandir}/es/man1/filter.1*
382 %lang(es) %{_mandir}/es/man1/lppasswd.1*
383 %lang(es) %{_mandir}/es/man[58]/*
384 %{_datadir}/locale/C/cups_C
385 %lang(be) %{_datadir}/locale/be/cups_be
386 %lang(cs) %{_datadir}/locale/cs/cups_cs
387 %lang(de) %{_datadir}/locale/de/cups_de
388 %{_datadir}/locale/en/cups_en
389 %lang(en_US) %{_datadir}/locale/en_US/cups_en_US
390 %lang(es) %{_datadir}/locale/es/cups_es
391 %lang(fr) %{_datadir}/locale/fr/cups_fr
392 %lang(he) %{_datadir}/locale/he/cups_he
393 %lang(it) %{_datadir}/locale/it/cups_it
394 %lang(ru) %{_datadir}/locale/ru_RU/cups_ru_RU
395 %lang(sv) %{_datadir}/locale/sv/cups_sv
396 %lang(uk) %{_datadir}/locale/uk/cups_uk
397 %lang(uk) %{_datadir}/locale/uk_UA/cups_uk_UA
398 %lang(zh_CN) %{_datadir}/locale/zh_CN/cups_zh_CN
399 /var/spool/cups
400 %attr(750,root,logs) %dir /var/log/archiv/cups
401 %attr(750,root,logs) %dir /var/log/cups
402 %attr(640,root,logs) %ghost /var/log/cups/access_log
403 %attr(640,root,logs) %ghost /var/log/cups/error_log
404 %attr(640,root,logs) %ghost /var/log/cups/page_log
405
406 %files lib
407 %defattr(644,root,root,755)
408 %attr(755,root,root) %{_libdir}/libcups.so.*
409
410 %files clients
411 %defattr(644,root,root,755)
412 %attr(644,root,lp) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/%{name}/client.conf
413 %attr(755,root,root) %{_bindir}/cancel
414 %attr(755,root,root) %{_bindir}/lp
415 %attr(755,root,root) %{_bindir}/lpoptions
416 %attr(755,root,root) %{_bindir}/lpq
417 %attr(755,root,root) %{_bindir}/lpr
418 %attr(755,root,root) %{_bindir}/lprm
419 %attr(755,root,root) %{_bindir}/lpstat
420 %attr(755,root,root) %{_sbindir}/accept
421 %attr(755,root,root) %{_sbindir}/cupsaddsmb
422 %attr(755,root,root) %{_sbindir}/lpadmin
423 %attr(755,root,root) %{_sbindir}/lpc
424 %attr(755,root,root) %{_sbindir}/lpinfo
425 %attr(755,root,root) %{_sbindir}/lpmove
426 %attr(755,root,root) %{_sbindir}/reject
427 %{_mandir}/man1/cancel.1*
428 %{_mandir}/man1/lp.1*
429 %{_mandir}/man1/lpoptions.1*
430 %{_mandir}/man1/lpq.1*
431 %{_mandir}/man1/lpr.1*
432 %{_mandir}/man1/lprm.1*
433 %{_mandir}/man1/lpstat.1*
434 %lang(fr) %{_mandir}/fr/man1/cancel.1*
435 %lang(fr) %{_mandir}/fr/man1/lp.1*
436 %lang(fr) %{_mandir}/fr/man1/lpoptions.1*
437 %lang(fr) %{_mandir}/fr/man1/lpq.1*
438 %lang(fr) %{_mandir}/fr/man1/lpr.1*
439 %lang(fr) %{_mandir}/fr/man1/lprm.1*
440 %lang(fr) %{_mandir}/fr/man1/lpstat.1*
441 %lang(es) %{_mandir}/es/man1/lp.1*
442 %lang(es) %{_mandir}/es/man1/lpoptions.1*
443 %lang(es) %{_mandir}/es/man1/lpq.1*
444 %lang(es) %{_mandir}/es/man1/lpr.1*
445 %lang(es) %{_mandir}/es/man1/lprm.1*
446 %lang(es) %{_mandir}/es/man1/lpstat.1*
447
448 %files image-lib
449 %defattr(644,root,root,755)
450 %attr(755,root,root) %{_libdir}/libcupsimage.so.*
451
452 %files devel
453 %defattr(644,root,root,755)
454 %attr(755,root,root) %{_bindir}/cups-config
455 %{_includedir}/cups
456 %{_libdir}/lib*.so
457 %{_mandir}/man1/cups-config*
458 %{_mandir}/man3/*
459 %lang(fr) %{_mandir}/fr/man1/cups-config*
460 %lang(es) %{_mandir}/es/man1/cups-config*
461
462 %files static
463 %defattr(644,root,root,755)
464 %{_libdir}/*.a
465
466 %if %{with perl}
467 %files -n perl-cups
468 %defattr(644,root,root,755)
469 %{perl_vendorarch}/*.pm
470 %dir %{perl_vendorarch}/auto/CUPS
471 %{perl_vendorarch}/auto/CUPS/*.bs
472 %{perl_vendorarch}/auto/CUPS/autosplit.ix
473 %attr(755,root,root) %{perl_vendorarch}/auto/CUPS/*.so
474 %endif
475
476 %if %{with php}
477 %files -n php-cups
478 %defattr(644,root,root,755)
479 %attr(755,root,root) %(php-config --extension-dir)/*
480 %endif
481
482 %files backend-usb
483 %defattr(644,root,root,755)
484 %attr(755,root,root) %{_ulibdir}/cups/backend/usb
485
486 %files backend-serial
487 %defattr(644,root,root,755)
488 %attr(755,root,root) %{_ulibdir}/cups/backend/serial
489
490 %files backend-parallel
491 %defattr(644,root,root,755)
492 %attr(755,root,root) %{_ulibdir}/cups/backend/parallel
This page took 0.073995 seconds and 4 git commands to generate.