]> git.pld-linux.org Git - packages/cups-filters.git/blob - cups-filters.spec
- revert incorrectly changed version
[packages/cups-filters.git] / cups-filters.spec
1 #
2 # Conditional build:
3 %bcond_without  static_libs     # static libraries
4 %bcond_without  perl            # Perl module
5 %bcond_without  php             # PHP extension
6 #
7 Summary:        OpenPrinting CUPS filters and backends
8 Summary(pl.UTF-8):      Filtry i backendy CUPS-a z projektu OpenPrinting
9 Name:           cups-filters
10 Version:        1.0.42
11 Release:        2
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
65 Requires:       ghostscript
66 Requires:       poppler-progs >= 0.18
67 Requires:       qpdf-libs >= 3.0.2
68 # pstopdf
69 Requires:       bc
70 Requires:       grep
71 Requires:       sed
72 Provides:       ghostscript-cups = 9.08
73 Obsoletes:      ghostscript-cups < 9.08
74 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
75
76 %define         _cups_serverbin         %(/usr/bin/cups-config --serverbin)
77
78 %description
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.
84
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.
91
92 %package libs
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
96 # MIT:    libfontembed
97 License:        LGPL v2, MIT
98 Group:          Libraries
99 Requires:       cups-lib >= 1:1.6.0
100
101 %description libs
102 This package provides cupsfilters and fontembed libraries.
103
104 %description libs -l pl.UTF-8
105 Ten pakiet udostępnia biblioteki cupsfilters i fontembed.
106
107 %package devel
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
117
118 %description devel
119 This is the development package for OpenPrinting CUPS filters and
120 backends.
121
122 %description devel -l pl.UTF-8
123 To jest pakiet programistyczny dla filtrów i backendów CUPS-a z
124 projektu OpenPrinting.
125
126 %package static
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}
132
133 %description static
134 This package provides static cupsfilters and fontembed libraries.
135
136 %description static -l pl.UTF-8
137 Ten pakiet udostępnia statyczne biblioteki cupsfilters i fontembed.
138
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
147
148 %description -n cups-browsed
149 A daemon for browsing the Bonjour broadcasts of shared,
150 remote CUPS printers.
151
152 %description -n cups-browsed -l pl.UTF-8
153 Demon do przeglądania broadcastów Bonjour współdzielonych, zdalnych
154 drukarek CUPS.
155
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
160 Epoch:          2
161 License:        GPL v2 + OpenSSL exception
162 Group:          Applications/Printing
163 Requires:       cups >= 1:1.6.0
164
165 %description -n cups-backend-parallel
166 This package allow CUPS printing on printers connected by parallel
167 ports.
168
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.
172
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
177 Epoch:          2
178 License:        GPL v2 + OpenSSL exception
179 Group:          Applications/Printing
180 Requires:       cups >= 1:1.6.0
181
182 %description -n cups-backend-serial
183 This package allow CUPS printing on printers connected by serial
184 ports.
185
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.
189
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
194 Epoch:          2
195 License:        GPL v2 + OpenSSL exception
196 Group:          Development/Languages/Perl
197 Requires:       cups-lib >= 1:1.6.0
198
199 %description -n perl-cups
200 Perl module for Common Unix Printing System.
201
202 %description -n perl-cups -l pl.UTF-8
203 Moduł Perla do ogólnego systemu druku dla Uniksa.
204
205 %package -n php-cups
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
209 Epoch:          2
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
216
217 %description -n php-cups
218 PHP module for Common Unix Printing System.
219
220 %description -n php-cups -l pl.UTF-8
221 Moduł PHP do ogólnego systemu druku dla Uniksa.
222
223 # CREATE ANY NEW PACKAGES BEFORE cups-backend-* (EPOCH)
224
225 %prep
226 %setup -q
227 %patch0 -p1
228 %patch1 -p1
229 %patch2 -p1
230 %patch3 -p1
231
232 %build
233 %{__aclocal}
234 %{__autoconf}
235 %{__automake}
236
237 %configure \
238         --enable-dbus \
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 \
248         --with-rclevels= \
249         --with-test-font-path=/usr/share/fonts/TTF/DejaVuSans.ttf
250
251 %{__make}
252
253 %if %{with perl}
254 cd scripting/perl
255 %{__perl} Makefile.PL \
256         INSTALLDIRS=vendor \
257         OPTIMIZE="%{rpmcflags}"
258
259 %{__make}
260 cd ../..
261 %endif
262
263 %install
264 rm -rf $RPM_BUILD_ROOT
265 install -d $RPM_BUILD_ROOT%{systemdunitdir}
266
267 %{__make} install \
268         DESTDIR=$RPM_BUILD_ROOT
269
270 %if %{with php}
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
275 EOF
276 %endif
277
278 %if %{with perl}
279 %{__make} -C scripting/perl install \
280         DESTDIR=$RPM_BUILD_ROOT
281 %endif
282
283 install -p utils/cups-browsed.service $RPM_BUILD_ROOT%{systemdunitdir}
284
285 # obsoleted by pkg-config
286 %{__rm} $RPM_BUILD_ROOT%{_libdir}/lib*.la
287 # dlopened module
288 %{__rm} $RPM_BUILD_ROOT%{_libdir}/php/libphpcups.la
289 # packaged as %doc
290 %{__rm} -r $RPM_BUILD_ROOT%{_docdir}/cups-filters
291 # Not sure what is this good for.
292 %{__rm} $RPM_BUILD_ROOT%{_bindir}/ttfread
293
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
297
298 %clean
299 rm -rf $RPM_BUILD_ROOT
300
301 %post   libs -p /sbin/ldconfig
302 %postun libs -p /sbin/ldconfig
303
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
309         fi
310
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 || :
316                 fi
317                 sed -i -e "s,^BrowsePoll,#BrowsePoll directive moved to cups-browsed.conf\n#BrowsePoll,i" %{_sysconfdir}/cups/cupsd.conf || :
318         fi
319 fi
320 /sbin/chkconfig --add cups-browsed
321 %service cups-browsed restart
322 %systemd_post cups-browsed.service
323
324 %preun -n cups-browsed
325 if [ "$1" = "0" ]; then
326         %service cups-browsed stop
327         /sbin/chkconfig --del cups-browsed
328 fi
329 %systemd_preun cups-browsed.service
330
331 %postun -n cups-browsed
332 %systemd_reload
333
334 %files
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
371
372 %files libs
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
379
380 %files devel
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
388
389 %files static
390 %defattr(644,root,root,755)
391 %{_libdir}/libcupsfilters.a
392 %{_libdir}/libfontembed.a
393
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*
402
403 %files -n cups-backend-parallel
404 %defattr(644,root,root,755)
405 %attr(755,root,root) %{_cups_serverbin}/backend/parallel
406
407 %files -n cups-backend-serial
408 %defattr(644,root,root,755)
409 %attr(755,root,root) %{_cups_serverbin}/backend/serial
410
411 %if %{with perl}
412 %files -n perl-cups
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*
421 %endif
422
423 %if %{with php}
424 %files -n php-cups
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
429 %endif
This page took 0.076336 seconds and 3 git commands to generate.