]> git.pld-linux.org Git - packages/cups-filters.git/blob - cups-filters.spec
9a71e677b2699cb3bd15c4905ef3e2f04bfe361d
[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.43
11 Release:        3
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:  50f760c4cb7be37544c1174a12b1900e
25 Patch0:         %{name}-dbus.patch
26 Patch1:         %{name}-php.patch
27 URL:            http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups-filters
28 BuildRequires:  autoconf >= 2.65
29 BuildRequires:  automake >= 1:1.11
30 BuildRequires:  avahi-devel
31 BuildRequires:  avahi-glib-devel
32 BuildRequires:  cups-devel >= 1:1.6.0
33 BuildRequires:  dbus-devel
34 BuildRequires:  fontconfig-devel >= 2.0.0
35 BuildRequires:  freetype-devel >= 2
36 # /usr/bin/gs, for features detection
37 BuildRequires:  ghostscript
38 BuildRequires:  ghostscript-ijs-devel
39 BuildRequires:  glib2-devel >= 1:2.30.2
40 BuildRequires:  lcms2-devel >= 2
41 BuildRequires:  libjpeg-devel
42 BuildRequires:  libpng-devel
43 BuildRequires:  libstdc++-devel
44 BuildRequires:  libtiff-devel
45 BuildRequires:  libtool
46 %{?with_perl:BuildRequires:     perl-devel}
47 %{?with_php:BuildRequires:      php-devel >= 5}
48 BuildRequires:  pkgconfig >= 1:0.20
49 # just for cpp/poppler-version.h
50 BuildRequires:  poppler-cpp-devel >= 0.18
51 BuildRequires:  poppler-devel >= 0.18
52 # /usr/bin/pdftops, for features detection
53 BuildRequires:  poppler-progs >= 0.18
54 BuildRequires:  rpmbuild(macros) >= 1.671
55 BuildRequires:  qpdf-devel >= 3.0.2
56 BuildRequires:  zlib-devel
57 # DejaVuSans.ttf (testing font for test scripts)
58 #BuildRequires: fonts-TTF-DejaVu
59 Requires:       %{name}-libs = %{version}-%{release}
60 Requires:       cups >= 1:1.6.0
61 Requires:       fontconfig >= 2.0.0
62 Suggests:       fonts-TTF-freefont
63 Requires:       ghostscript
64 Requires:       poppler-progs >= 0.18
65 Requires:       qpdf-libs >= 3.0.2
66 # pstopdf
67 Requires:       bc
68 Requires:       grep
69 Requires:       sed
70 Provides:       cups-filter-foomatic
71 Provides:       ghostscript-cups = 9.08
72 Obsoletes:      cups-filter-foomatic
73 Obsoletes:      foomatic-filters
74 Obsoletes:      ghostscript-cups < 9.08
75 Conflicts:      cups-backend-hp < 3.13.11-2
76 Conflicts:      hplip-ppd < 3.13.11-2
77 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
78
79 %define         _cups_serverbin         %(/usr/bin/cups-config --serverbin)
80
81 %description
82 Contains backends, filters, and other software that was once part of
83 the core CUPS distribution but is no longer maintained by Apple Inc.
84 In addition it contains additional filters developed independently of
85 Apple, especially filters for the PDF-centric printing workflow
86 introduced by OpenPrinting.
87
88 %description -l pl.UTF-8
89 Ten pakiet zawiera backendy, filtry i inne oprogramowanie, będące
90 kiedyś częścią CUPS-a, ale nie utrzymywane już przez firmę Apple Inc.
91 Dodatkowo pakiet zawiera dodatkowe filtry stworzone niezależnie od
92 Apple'a, w szczególności filtry dla PDF-ocentrycznego obiegu
93 drukowania wprowadzonego przez OpenPrinting.
94
95 %package libs
96 Summary:        OpenPrinting CUPS filters and backends - cupsfilters and fontembed libraries
97 Summary(pl.UTF-8):      Filtry i backendy CUPS-a z projektu OpenPrinting - biblioteki cupsfilters i fontembed
98 # LGPLv2: libcupsfilters
99 # MIT:    libfontembed
100 License:        LGPL v2, MIT
101 Group:          Libraries
102 Requires:       cups-lib >= 1:1.6.0
103
104 %description libs
105 This package provides cupsfilters and fontembed libraries.
106
107 %description libs -l pl.UTF-8
108 Ten pakiet udostępnia biblioteki cupsfilters i fontembed.
109
110 %package devel
111 Summary:        OpenPrinting CUPS filters and backends - development environment
112 Summary(pl.UTF-8):      Filtry i backendy CUPS-a z projektu OpenPrinting - środowisko programistyczne
113 License:        LGPL v2, MIT
114 Group:          Development/Libraries
115 Requires:       %{name}-libs = %{version}-%{release}
116 Requires:       cups-devel >= 1:1.6.0
117 Requires:       libjpeg-devel
118 Requires:       libpng-devel
119 Requires:       libtiff-devel
120
121 %description devel
122 This is the development package for OpenPrinting CUPS filters and
123 backends.
124
125 %description devel -l pl.UTF-8
126 To jest pakiet programistyczny dla filtrów i backendów CUPS-a z
127 projektu OpenPrinting.
128
129 %package static
130 Summary:        OpenPrinting CUPS filters and backends - static cupsfilters and fontembed libraries
131 Summary(pl.UTF-8):      Filtry i backendy CUPS-a z projektu OpenPrinting - statyczne biblioteki cupsfilters i fontembed
132 License:        LGPL v2, MIT
133 Group:          Development/Libraries
134 Requires:       %{name}-devel = %{version}-%{release}
135
136 %description static
137 This package provides static cupsfilters and fontembed libraries.
138
139 %description static -l pl.UTF-8
140 Ten pakiet udostępnia statyczne biblioteki cupsfilters i fontembed.
141
142 %package -n cups-browsed
143 Summary:        A daemon for browsing the Bonjour broadcasts of shared, remote CUPS printers
144 Summary(pl.UTF-8):      Demon do przeglądania broadcastów Bonjour współdzielonych, zdalnych drukarek CUPS
145 Group:          Applications/Printing
146 Requires(post,preun):   /sbin/chkconfig
147 Requires(post,preun,postun):    systemd-units
148 Requires:       glib2 >= 1:2.30.2
149 Requires:       systemd-units >= 38
150
151 %description -n cups-browsed
152 A daemon for browsing the Bonjour broadcasts of shared,
153 remote CUPS printers.
154
155 %description -n cups-browsed -l pl.UTF-8
156 Demon do przeglądania broadcastów Bonjour współdzielonych, zdalnych
157 drukarek CUPS.
158
159 %package -n cups-backend-parallel
160 Summary:        Parallel port backend for CUPS
161 Summary(pl.UTF-8):      Backend CUPS-a obsługujący porty równoległe
162 # must be larger than cups.spec before 1.6.0
163 Epoch:          2
164 License:        GPL v2 + OpenSSL exception
165 Group:          Applications/Printing
166 Requires:       cups >= 1:1.6.0
167
168 %description -n cups-backend-parallel
169 This package allow CUPS printing on printers connected by parallel
170 ports.
171
172 %description -n cups-backend-parallel -l pl.UTF-8
173 Ten pakiet umożliwia drukowanie z poziomu CUPS-a na drukarkach
174 podłączonych do portów równoległych.
175
176 %package -n cups-backend-serial
177 Summary:        Serial port backend for CUPS
178 Summary(pl.UTF-8):      Backend CUPS-a obsługujący porty szeregowe
179 # must be larger than cups.spec before 1.6.0
180 Epoch:          2
181 License:        GPL v2 + OpenSSL exception
182 Group:          Applications/Printing
183 Requires:       cups >= 1:1.6.0
184
185 %description -n cups-backend-serial
186 This package allow CUPS printing on printers connected by serial
187 ports.
188
189 %description -n cups-backend-serial -l pl.UTF-8
190 Ten pakiet umożliwia drukowanie z poziomu CUPS-a na drukarkach
191 podłączonych do portów szeregowych.
192
193 %package -n perl-cups
194 Summary:        Perl module for CUPS
195 Summary(pl.UTF-8):      Moduł Perla CUPS
196 # must be larger than cups.spec before 1.6.0
197 Epoch:          2
198 License:        GPL v2 + OpenSSL exception
199 Group:          Development/Languages/Perl
200 Requires:       cups-lib >= 1:1.6.0
201
202 %description -n perl-cups
203 Perl module for Common Unix Printing System.
204
205 %description -n perl-cups -l pl.UTF-8
206 Moduł Perla do ogólnego systemu druku dla Uniksa.
207
208 %package -n php-cups
209 Summary:        PHP module for CUPS
210 Summary(pl.UTF-8):      Moduł PHP CUPS
211 # must be larger than cups.spec before 1.6.0
212 Epoch:          2
213 License:        GPL v2 + OpenSSL exception
214 Group:          Development/Languages/PHP
215 Requires:       cups-lib >= 1:1.6.0
216 %{?requires_php_extension}
217 Requires:       /etc/php/conf.d
218 Requires:       php(core) >= 5.0.0
219
220 %description -n php-cups
221 PHP module for Common Unix Printing System.
222
223 %description -n php-cups -l pl.UTF-8
224 Moduł PHP do ogólnego systemu druku dla Uniksa.
225
226 # CREATE ANY NEW PACKAGES BEFORE cups-backend-* (EPOCH)
227
228 %prep
229 %setup -q
230 %patch0 -p1
231 %patch1 -p1
232
233 %build
234 %{__aclocal}
235 %{__autoconf}
236 %{__automake}
237
238 %configure \
239         --enable-dbus \
240         --disable-silent-rules \
241         %{!?with_static_libs:--disable-static} \
242         --with-acroread-path=/usr/bin/acroread \
243         --with-gs-path=/usr/bin/gs \
244         %{?with_php:--with-php} \
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 %clean
295 rm -rf $RPM_BUILD_ROOT
296
297 %post   libs -p /sbin/ldconfig
298 %postun libs -p /sbin/ldconfig
299
300 %post -n cups-browsed
301 if [ $1 -eq 1 ] ; then
302         # We can remove this after few releases, it's just for the introduction of cups-browsed.
303         if [ -f %{_sysconfdir}/cups/cups-browsed.conf ]; then
304                 echo -e "\n# NOTE: This file is not part of CUPS. You need to start & enable cups-browsed service." >>%{_sysconfdir}/cups/cups-browsed.conf
305         fi
306
307         # move BrowsePoll from cupsd.conf to cups-browsed.conf
308         if [ -f %{_sysconfdir}/cups/cupsd.conf ] && grep -iq "^BrowsePoll" %{_sysconfdir}/cups/cupsd.conf; then
309                 if ! grep -iq "^BrowsePoll" %{_sysconfdir}/cups/cups-browsed.conf; then
310                         echo "# Settings automatically moved from cupsd.conf by RPM package:" >>%{_sysconfdir}/cups/cups-browsed.conf
311                         grep -i "^BrowsePoll" %{_sysconfdir}/cups/cupsd.conf >> %{_sysconfdir}/cups/cups-browsed.conf || :
312                 fi
313                 sed -i -e "s,^BrowsePoll,#BrowsePoll directive moved to cups-browsed.conf\n#BrowsePoll,i" %{_sysconfdir}/cups/cupsd.conf || :
314         fi
315 fi
316 /sbin/chkconfig --add cups-browsed
317 %service cups-browsed restart
318 %systemd_post cups-browsed.service
319
320 %preun -n cups-browsed
321 if [ "$1" = "0" ]; then
322         %service cups-browsed stop
323         /sbin/chkconfig --del cups-browsed
324 fi
325 %systemd_preun cups-browsed.service
326
327 %postun -n cups-browsed
328 %systemd_reload
329
330 %files
331 %defattr(644,root,root,755)
332 %doc AUTHORS COPYING NEWS README
333 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fonts/conf.d/99pdftoopvp.conf
334 %attr(755,root,root) %{_cups_serverbin}/filter/bannertopdf
335 %attr(755,root,root) %{_cups_serverbin}/filter/commandtoescpx
336 %attr(755,root,root) %{_cups_serverbin}/filter/commandtopclx
337 %attr(755,root,root) %{_cups_serverbin}/filter/foomatic-rip
338 %attr(755,root,root) %{_cups_serverbin}/filter/gstopxl
339 %attr(755,root,root) %{_cups_serverbin}/filter/gstoraster
340 %attr(755,root,root) %{_cups_serverbin}/filter/imagetopdf
341 %attr(755,root,root) %{_cups_serverbin}/filter/imagetops
342 %attr(755,root,root) %{_cups_serverbin}/filter/imagetoraster
343 %attr(755,root,root) %{_cups_serverbin}/filter/pdftoijs
344 %attr(755,root,root) %{_cups_serverbin}/filter/pdftoippprinter
345 %attr(755,root,root) %{_cups_serverbin}/filter/pdftoopvp
346 %attr(755,root,root) %{_cups_serverbin}/filter/pdftopdf
347 %attr(755,root,root) %{_cups_serverbin}/filter/pdftops
348 %attr(755,root,root) %{_cups_serverbin}/filter/pdftoraster
349 %attr(755,root,root) %{_cups_serverbin}/filter/pstopdf
350 %attr(755,root,root) %{_cups_serverbin}/filter/rastertoescpx
351 %attr(755,root,root) %{_cups_serverbin}/filter/rastertopclx
352 %attr(755,root,root) %{_cups_serverbin}/filter/textonly
353 %attr(755,root,root) %{_cups_serverbin}/filter/texttopdf
354 %attr(755,root,root) %{_cups_serverbin}/filter/texttops
355 %attr(755,root,root) %{_cups_serverbin}/filter/urftopdf
356 %{_datadir}/cups/banners
357 %{_datadir}/cups/charsets
358 %{_datadir}/cups/data/default.pdf
359 %{_datadir}/cups/data/default-testpage.pdf
360 %{_datadir}/cups/data/testprint
361 %{_datadir}/cups/drv/cupsfilters.drv
362 %{_datadir}/cups/mime/cupsfilters.types
363 %{_datadir}/cups/mime/cupsfilters.convs
364 # definitions for drivers; pcl.h is used by cupsfilters.drv
365 %{_datadir}/cups/ppdc/escp.h
366 %{_datadir}/cups/ppdc/pcl.h
367 %{_datadir}/ppd/cupsfilters
368 %{_mandir}/man1/foomatic-rip.1*
369
370 %files libs
371 %defattr(644,root,root,755)
372 %doc fontembed/README
373 %attr(755,root,root) %{_libdir}/libcupsfilters.so.*.*.*
374 %attr(755,root,root) %ghost %{_libdir}/libcupsfilters.so.1
375 %attr(755,root,root) %{_libdir}/libfontembed.so.*.*.*
376 %attr(755,root,root) %ghost %{_libdir}/libfontembed.so.1
377
378 %files devel
379 %defattr(644,root,root,755)
380 %attr(755,root,root) %{_libdir}/libcupsfilters.so
381 %attr(755,root,root) %{_libdir}/libfontembed.so
382 %{_includedir}/cupsfilters
383 %{_includedir}/fontembed
384 %{_pkgconfigdir}/libcupsfilters.pc
385 %{_pkgconfigdir}/libfontembed.pc
386
387 %files static
388 %defattr(644,root,root,755)
389 %{_libdir}/libcupsfilters.a
390 %{_libdir}/libfontembed.a
391
392 %files -n cups-browsed
393 %defattr(644,root,root,755)
394 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/cups/cups-browsed.conf
395 %attr(755,root,root) %{_sbindir}/cups-browsed
396 %attr(754,root,root) /etc/rc.d/init.d/cups-browsed
397 %{systemdunitdir}/cups-browsed.service
398 %{_mandir}/man5/cups-browsed.conf.5*
399 %{_mandir}/man8/cups-browsed.8*
400
401 %files -n cups-backend-parallel
402 %defattr(644,root,root,755)
403 %attr(755,root,root) %{_cups_serverbin}/backend/parallel
404
405 %files -n cups-backend-serial
406 %defattr(644,root,root,755)
407 %attr(755,root,root) %{_cups_serverbin}/backend/serial
408
409 %if %{with perl}
410 %files -n perl-cups
411 %defattr(644,root,root,755)
412 %doc scripting/perl/README
413 %{perl_vendorarch}/CUPS.pm
414 %dir %{perl_vendorarch}/auto/CUPS
415 %{perl_vendorarch}/auto/CUPS/CUPS.bs
416 %{perl_vendorarch}/auto/CUPS/autosplit.ix
417 %attr(755,root,root) %{perl_vendorarch}/auto/CUPS/CUPS.so
418 %{_mandir}/man3/CUPS.3pm*
419 %endif
420
421 %if %{with php}
422 %files -n php-cups
423 %defattr(644,root,root,755)
424 %doc scripting/php/README
425 %attr(755,root,root) %{php_extensiondir}/libphpcups.so
426 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/phpcups.ini
427 %endif
This page took 0.064139 seconds and 2 git commands to generate.