3 %bcond_without static_libs # static libraries
4 %bcond_without perl # Perl module
5 %bcond_without php # PHP extension
7 Summary: OpenPrinting CUPS filters and backends
8 Summary(pl.UTF-8): Filtry i backendy CUPS-a z projektu OpenPrinting
12 # For a breakdown of the licensing, see COPYING file
13 # GPLv2: filters: commandto*, imagetoraster, pdftops, rasterto*,
14 # imagetopdf, pstopdf, texttopdf
15 # backends: parallel, serial
16 # GPLv2+: filters: gstopxl, textonly, texttops, imagetops
17 # GPLv3: filters: bannertopdf
18 # GPLv3+: filters: urftopdf
19 # LGPLv2+: utils: cups-browsed
20 # MIT: filters: gstoraster, pdftoijs, pdftoopvp, pdftopdf, pdftoraster
21 License: GPL v2, GPL v2+, GPL v3, GPL v3+, LGPL v2+, MIT
22 Group: Applications/Printing
23 Source0: http://www.openprinting.org/download/cups-filters/%{name}-%{version}.tar.xz
24 # Source0-md5: 3047524b51f2ac064663f1997c7d2c81
25 Patch0: %{name}-cups15.patch
26 Patch1: %{name}-pdf-landscape.patch
27 Patch2: %{name}-dbus.patch
28 Patch3: %{name}-php.patch
29 URL: http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups-filters
30 BuildRequires: autoconf >= 2.65
31 BuildRequires: automake >= 1:1.11
32 BuildRequires: avahi-devel
33 BuildRequires: avahi-glib-devel
34 BuildRequires: cups-devel >= 1:1.6.0
35 BuildRequires: dbus-devel
36 BuildRequires: fontconfig-devel >= 2.0.0
37 BuildRequires: freetype-devel >= 2
38 # /usr/bin/gs, for features detection
39 BuildRequires: ghostscript
40 BuildRequires: ghostscript-ijs-devel
41 BuildRequires: glib2-devel >= 1:2.30.2
42 BuildRequires: lcms2-devel >= 2
43 BuildRequires: libjpeg-devel
44 BuildRequires: libpng-devel
45 BuildRequires: libstdc++-devel
46 BuildRequires: libtiff-devel
47 BuildRequires: libtool
48 %{?with_perl:BuildRequires: perl-devel}
49 %{?with_php:BuildRequires: php-devel >= 5}
50 BuildRequires: pkgconfig >= 1:0.20
51 # just for cpp/poppler-version.h
52 BuildRequires: poppler-cpp-devel >= 0.18
53 BuildRequires: poppler-devel >= 0.18
54 # /usr/bin/pdftops, for features detection
55 BuildRequires: poppler-progs >= 0.18
56 BuildRequires: rpmbuild(macros) >= 1.671
57 BuildRequires: qpdf-devel >= 3.0.2
58 BuildRequires: zlib-devel
59 # DejaVuSans.ttf (testing font for test scripts)
60 #BuildRequires: fonts-TTF-DejaVu
61 Requires: %{name}-libs = %{version}-%{release}
62 Requires: cups >= 1:1.6.0
63 Requires: fontconfig >= 2.0.0
64 Suggests: fonts-TTF-freefont
66 Requires: poppler-progs >= 0.18
67 Requires: qpdf-libs >= 3.0.2
72 Provides: ghostscript-cups = 9.08
73 Obsoletes: ghostscript-cups < 9.08
74 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
76 %define _cups_serverbin %(/usr/bin/cups-config --serverbin)
79 Contains backends, filters, and other software that was once part of
80 the core CUPS distribution but is no longer maintained by Apple Inc.
81 In addition it contains additional filters developed independently of
82 Apple, especially filters for the PDF-centric printing workflow
83 introduced by OpenPrinting.
85 %description -l pl.UTF-8
86 Ten pakiet zawiera backendy, filtry i inne oprogramowanie, będące
87 kiedyś częścią CUPS-a, ale nie utrzymywane już przez firmę Apple Inc.
88 Dodatkowo pakiet zawiera dodatkowe filtry stworzone niezależnie od
89 Apple'a, w szczególności filtry dla PDF-ocentrycznego obiegu
90 drukowania wprowadzonego przez OpenPrinting.
93 Summary: OpenPrinting CUPS filters and backends - cupsfilters and fontembed libraries
94 Summary(pl.UTF-8): Filtry i backendy CUPS-a z projektu OpenPrinting - biblioteki cupsfilters i fontembed
95 # LGPLv2: libcupsfilters
99 Requires: cups-lib >= 1:1.6.0
102 This package provides cupsfilters and fontembed libraries.
104 %description libs -l pl.UTF-8
105 Ten pakiet udostępnia biblioteki cupsfilters i fontembed.
108 Summary: OpenPrinting CUPS filters and backends - development environment
109 Summary(pl.UTF-8): Filtry i backendy CUPS-a z projektu OpenPrinting - środowisko programistyczne
110 License: LGPL v2, MIT
111 Group: Development/Libraries
112 Requires: %{name}-libs = %{version}-%{release}
113 Requires: cups-devel >= 1:1.6.0
114 Requires: libjpeg-devel
115 Requires: libpng-devel
116 Requires: libtiff-devel
119 This is the development package for OpenPrinting CUPS filters and
122 %description devel -l pl.UTF-8
123 To jest pakiet programistyczny dla filtrów i backendów CUPS-a z
124 projektu OpenPrinting.
127 Summary: OpenPrinting CUPS filters and backends - static cupsfilters and fontembed libraries
128 Summary(pl.UTF-8): Filtry i backendy CUPS-a z projektu OpenPrinting - statyczne biblioteki cupsfilters i fontembed
129 License: LGPL v2, MIT
130 Group: Development/Libraries
131 Requires: %{name}-devel = %{version}-%{release}
134 This package provides static cupsfilters and fontembed libraries.
136 %description static -l pl.UTF-8
137 Ten pakiet udostępnia statyczne biblioteki cupsfilters i fontembed.
139 %package -n cups-browsed
140 Summary: A daemon for browsing the Bonjour broadcasts of shared, remote CUPS printers
141 Summary(pl.UTF-8): Demon do przeglądania broadcastów Bonjour współdzielonych, zdalnych drukarek CUPS
142 Group: Applications/Printing
143 Requires(post,preun): /sbin/chkconfig
144 Requires(post,preun,postun): systemd-units
145 Requires: glib2 >= 1:2.30.2
146 Requires: systemd-units >= 38
148 %description -n cups-browsed
149 A daemon for browsing the Bonjour broadcasts of shared,
150 remote CUPS printers.
152 %description -n cups-browsed -l pl.UTF-8
153 Demon do przeglądania broadcastów Bonjour współdzielonych, zdalnych
156 %package -n cups-backend-parallel
157 Summary: Parallel port backend for CUPS
158 Summary(pl.UTF-8): Backend CUPS-a obsługujący porty równoległe
159 # must be larger than cups.spec before 1.6.0
161 License: GPL v2 + OpenSSL exception
162 Group: Applications/Printing
163 Requires: cups >= 1:1.6.0
165 %description -n cups-backend-parallel
166 This package allow CUPS printing on printers connected by parallel
169 %description -n cups-backend-parallel -l pl.UTF-8
170 Ten pakiet umożliwia drukowanie z poziomu CUPS-a na drukarkach
171 podłączonych do portów równoległych.
173 %package -n cups-backend-serial
174 Summary: Serial port backend for CUPS
175 Summary(pl.UTF-8): Backend CUPS-a obsługujący porty szeregowe
176 # must be larger than cups.spec before 1.6.0
178 License: GPL v2 + OpenSSL exception
179 Group: Applications/Printing
180 Requires: cups >= 1:1.6.0
182 %description -n cups-backend-serial
183 This package allow CUPS printing on printers connected by serial
186 %description -n cups-backend-serial -l pl.UTF-8
187 Ten pakiet umożliwia drukowanie z poziomu CUPS-a na drukarkach
188 podłączonych do portów szeregowych.
190 %package -n perl-cups
191 Summary: Perl module for CUPS
192 Summary(pl.UTF-8): Moduł Perla CUPS
193 # must be larger than cups.spec before 1.6.0
195 License: GPL v2 + OpenSSL exception
196 Group: Development/Languages/Perl
197 Requires: cups-lib >= 1:1.6.0
199 %description -n perl-cups
200 Perl module for Common Unix Printing System.
202 %description -n perl-cups -l pl.UTF-8
203 Moduł Perla do ogólnego systemu druku dla Uniksa.
206 Summary: PHP module for CUPS
207 Summary(pl.UTF-8): Moduł PHP CUPS
208 # must be larger than cups.spec before 1.6.0
210 License: GPL v2 + OpenSSL exception
211 Group: Development/Languages/PHP
212 Requires: cups-lib >= 1:1.6.0
213 %{?requires_php_extension}
214 Requires: /etc/php/conf.d
215 Requires: php(core) >= 5.0.0
217 %description -n php-cups
218 PHP module for Common Unix Printing System.
220 %description -n php-cups -l pl.UTF-8
221 Moduł PHP do ogólnego systemu druku dla Uniksa.
223 # CREATE ANY NEW PACKAGES BEFORE cups-backend-* (EPOCH)
239 --disable-silent-rules \
240 %{!?with_static_libs:--disable-static} \
241 --with-acroread-path=/usr/bin/acroread \
242 --with-gs-path=/usr/bin/gs \
243 %{?with_php:--with-php} \
244 --with-pdftocairo-path=/usr/bin/pdftocairo \
245 --with-pdftops=hybrid \
246 --with-pdftops-path=/usr/bin/pdftops \
247 --with-rcdir=/etc/rc.d/init.d \
249 --with-test-font-path=/usr/share/fonts/TTF/DejaVuSans.ttf
255 %{__perl} Makefile.PL \
257 OPTIMIZE="%{rpmcflags}"
264 rm -rf $RPM_BUILD_ROOT
265 install -d $RPM_BUILD_ROOT%{systemdunitdir}
268 DESTDIR=$RPM_BUILD_ROOT
271 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
272 cat > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/phpcups.ini << 'EOF'
273 ; Enable phpcups extension module
274 extension=libphpcups.so
279 %{__make} -C scripting/perl install \
280 DESTDIR=$RPM_BUILD_ROOT
283 install -p utils/cups-browsed.service $RPM_BUILD_ROOT%{systemdunitdir}
285 # obsoleted by pkg-config
286 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.la
288 %{__rm} $RPM_BUILD_ROOT%{_libdir}/php/libphpcups.la
290 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/cups-filters
291 # Not sure what is this good for.
292 %{__rm} $RPM_BUILD_ROOT%{_bindir}/ttfread
294 # currently in foomatic-filters; to be packaged here after new stable foomatic-filters release
295 %{__rm} $RPM_BUILD_ROOT%{_cups_serverbin}/filter/foomatic-rip \
296 $RPM_BUILD_ROOT%{_mandir}/man1/foomatic-rip.1
299 rm -rf $RPM_BUILD_ROOT
301 %post libs -p /sbin/ldconfig
302 %postun libs -p /sbin/ldconfig
304 %post -n cups-browsed
305 if [ $1 -eq 1 ] ; then
306 # We can remove this after few releases, it's just for the introduction of cups-browsed.
307 if [ -f %{_sysconfdir}/cups/cups-browsed.conf ]; then
308 echo -e "\n# NOTE: This file is not part of CUPS. You need to start & enable cups-browsed service." >>%{_sysconfdir}/cups/cups-browsed.conf
311 # move BrowsePoll from cupsd.conf to cups-browsed.conf
312 if [ -f %{_sysconfdir}/cups/cupsd.conf ] && grep -iq "^BrowsePoll" %{_sysconfdir}/cups/cupsd.conf; then
313 if ! grep -iq "^BrowsePoll" %{_sysconfdir}/cups/cups-browsed.conf; then
314 echo "# Settings automatically moved from cupsd.conf by RPM package:" >>%{_sysconfdir}/cups/cups-browsed.conf
315 grep -i "^BrowsePoll" %{_sysconfdir}/cups/cupsd.conf >> %{_sysconfdir}/cups/cups-browsed.conf || :
317 sed -i -e "s,^BrowsePoll,#BrowsePoll directive moved to cups-browsed.conf\n#BrowsePoll,i" %{_sysconfdir}/cups/cupsd.conf || :
320 /sbin/chkconfig --add cups-browsed
321 %service cups-browsed restart
322 %systemd_post cups-browsed.service
324 %preun -n cups-browsed
325 if [ "$1" = "0" ]; then
326 %service cups-browsed stop
327 /sbin/chkconfig --del cups-browsed
329 %systemd_preun cups-browsed.service
331 %postun -n cups-browsed
335 %defattr(644,root,root,755)
336 %doc AUTHORS COPYING NEWS README
337 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fonts/conf.d/99pdftoopvp.conf
338 %attr(755,root,root) %{_cups_serverbin}/filter/bannertopdf
339 %attr(755,root,root) %{_cups_serverbin}/filter/commandtoescpx
340 %attr(755,root,root) %{_cups_serverbin}/filter/commandtopclx
341 %attr(755,root,root) %{_cups_serverbin}/filter/gstopxl
342 %attr(755,root,root) %{_cups_serverbin}/filter/gstoraster
343 %attr(755,root,root) %{_cups_serverbin}/filter/imagetopdf
344 %attr(755,root,root) %{_cups_serverbin}/filter/imagetops
345 %attr(755,root,root) %{_cups_serverbin}/filter/imagetoraster
346 %attr(755,root,root) %{_cups_serverbin}/filter/pdftoijs
347 %attr(755,root,root) %{_cups_serverbin}/filter/pdftoippprinter
348 %attr(755,root,root) %{_cups_serverbin}/filter/pdftoopvp
349 %attr(755,root,root) %{_cups_serverbin}/filter/pdftopdf
350 %attr(755,root,root) %{_cups_serverbin}/filter/pdftops
351 %attr(755,root,root) %{_cups_serverbin}/filter/pdftoraster
352 %attr(755,root,root) %{_cups_serverbin}/filter/pstopdf
353 %attr(755,root,root) %{_cups_serverbin}/filter/rastertoescpx
354 %attr(755,root,root) %{_cups_serverbin}/filter/rastertopclx
355 %attr(755,root,root) %{_cups_serverbin}/filter/textonly
356 %attr(755,root,root) %{_cups_serverbin}/filter/texttopdf
357 %attr(755,root,root) %{_cups_serverbin}/filter/texttops
358 %attr(755,root,root) %{_cups_serverbin}/filter/urftopdf
359 %{_datadir}/cups/banners
360 %{_datadir}/cups/charsets
361 %{_datadir}/cups/data/default.pdf
362 %{_datadir}/cups/data/default-testpage.pdf
363 %{_datadir}/cups/data/testprint
364 %{_datadir}/cups/drv/cupsfilters.drv
365 %{_datadir}/cups/mime/cupsfilters.types
366 %{_datadir}/cups/mime/cupsfilters.convs
367 # definitions for drivers; pcl.h is used by cupsfilters.drv
368 %{_datadir}/cups/ppdc/escp.h
369 %{_datadir}/cups/ppdc/pcl.h
370 %{_datadir}/ppd/cupsfilters
373 %defattr(644,root,root,755)
374 %doc fontembed/README
375 %attr(755,root,root) %{_libdir}/libcupsfilters.so.*.*.*
376 %attr(755,root,root) %ghost %{_libdir}/libcupsfilters.so.1
377 %attr(755,root,root) %{_libdir}/libfontembed.so.*.*.*
378 %attr(755,root,root) %ghost %{_libdir}/libfontembed.so.1
381 %defattr(644,root,root,755)
382 %attr(755,root,root) %{_libdir}/libcupsfilters.so
383 %attr(755,root,root) %{_libdir}/libfontembed.so
384 %{_includedir}/cupsfilters
385 %{_includedir}/fontembed
386 %{_pkgconfigdir}/libcupsfilters.pc
387 %{_pkgconfigdir}/libfontembed.pc
390 %defattr(644,root,root,755)
391 %{_libdir}/libcupsfilters.a
392 %{_libdir}/libfontembed.a
394 %files -n cups-browsed
395 %defattr(644,root,root,755)
396 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/cups/cups-browsed.conf
397 %attr(755,root,root) %{_sbindir}/cups-browsed
398 %attr(754,root,root) /etc/rc.d/init.d/cups-browsed
399 %{systemdunitdir}/cups-browsed.service
400 %{_mandir}/man5/cups-browsed.conf.5*
401 %{_mandir}/man8/cups-browsed.8*
403 %files -n cups-backend-parallel
404 %defattr(644,root,root,755)
405 %attr(755,root,root) %{_cups_serverbin}/backend/parallel
407 %files -n cups-backend-serial
408 %defattr(644,root,root,755)
409 %attr(755,root,root) %{_cups_serverbin}/backend/serial
413 %defattr(644,root,root,755)
414 %doc scripting/perl/README
415 %{perl_vendorarch}/CUPS.pm
416 %dir %{perl_vendorarch}/auto/CUPS
417 %{perl_vendorarch}/auto/CUPS/CUPS.bs
418 %{perl_vendorarch}/auto/CUPS/autosplit.ix
419 %attr(755,root,root) %{perl_vendorarch}/auto/CUPS/CUPS.so
420 %{_mandir}/man3/CUPS.3pm*
425 %defattr(644,root,root,755)
426 %doc scripting/php/README
427 %attr(755,root,root) %{php_extensiondir}/libphpcups.so
428 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/phpcups.ini