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