]> git.ipfire.org Git - thirdparty/cups.git/blob - packaging/cups.spec.in
Fix a performance regression with large PPDs (rdar://47040759)
[thirdparty/cups.git] / packaging / cups.spec.in
1 #
2 # RPM "spec" file for CUPS.
3 #
4 # Original version by Jason McMullan <jmcc@ontv.com>.
5 #
6 # Copyright 2007-2017 by Apple Inc.
7 # Copyright 1999-2007 by Easy Software Products, all rights reserved.
8 #
9 # These coded instructions, statements, and computer programs are the
10 # property of Apple Inc. and are protected by Federal copyright
11 # law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 # which should have been included with this file. If this file is
13 # file is missing or damaged, see the license at "http://www.cups.org/".
14 #
15
16 # Conditional build options (--with name/--without name):
17 #
18 # dbus - Enable/disable DBUS support (default = enable)
19 # dnssd - Enable/disable DNS-SD support (default = enable)
20 # libusb1 - Enable/disable LIBUSB 1.0 support (default = enable)
21 # static - Enable/disable static libraries (default = enable)
22 # systemd - Enable/disable systemd support (default = enable)
23
24 %{!?_with_dbus: %{!?_without_dbus: %define _with_dbus --with-dbus}}
25 %{?_with_dbus: %define _dbus --enable-dbus}
26 %{!?_with_dbus: %define _dbus --disable-dbus}
27
28 %{!?_with_dnssd: %{!?_without_dnssd: %define _with_dnssd --with-dnssd}}
29 %{?_with_dnssd: %define _dnssd --enable-avahi}
30 %{!?_with_dnssd: %define _dnssd --disable-avahi}
31
32 %{!?_with_libusb1: %{!?_without_libusb1: %define _with_libusb1 --with-libusb1}}
33 %{?_with_libusb1: %define _libusb1 --enable-libusb}
34 %{!?_with_libusb1: %define _libusb1 --disable-libusb}
35
36 %{!?_with_static: %{!?_without_static: %define _without_static --without-static}}
37 %{?_with_static: %define _static --enable-static}
38 %{!?_with_static: %define _static --disable-static}
39
40 %{!?_with_systemd: %{!?_without_systemd: %define _with_systemd --with-systemd}}
41 %{?_with_systemd: %define _systemd --enable-systemd}
42 %{!?_with_systemd: %define _systemd --disable-systemd}
43
44 Summary: CUPS
45 Name: cups
46 Version: @CUPS_VERSION@
47 Release: 0
48 Epoch: 1
49 License: GPL
50 Group: System Environment/Daemons
51 Source: https://github.com/apple/cups/releases/download/v%{version}/cups-%{version}-source.tar.gz
52 Url: http://www.cups.org
53 Packager: Anonymous <anonymous@example.com>
54 Vendor: Example Corp
55
56 # Package names are as defined for Red Hat (and clone) distributions
57 BuildRequires: gnutls-devel, pam-devel
58
59 %if %{?_with_dbus:1}%{!?_with_dbus:0}
60 BuildRequires: dbus-devel
61 %endif
62
63 %if %{?_with_dnssd:1}%{!?_with_dnssd:0}
64 BuildRequires: avahi-devel
65 %endif
66
67 %if %{?_with_libusb1:1}%{!?_with_libusb1:0}
68 BuildRequires: libusb-devel >= 1.0
69 %endif
70
71 %if %{?_with_systemd:1}%{!?_with_systemd:0}
72 BuildRequires: systemd-devel
73 %endif
74
75 # Use buildroot so as not to disturb the version already installed
76 BuildRoot: /tmp/%{name}-root
77
78 # Dependencies...
79 Requires: %{name}-libs = %{epoch}:%{version}
80 Obsoletes: lpd, lpr, LPRng
81 Provides: lpd, lpr, LPRng
82 Obsoletes: cups-da, cups-de, cups-es, cups-et, cups-fi, cups-fr, cups-he
83 Obsoletes: cups-id, cups-it, cups-ja, cups-ko, cups-nl, cups-no, cups-pl
84 Obsoletes: cups-pt, cups-ru, cups-sv, cups-zh
85
86 %package devel
87 Summary: CUPS - development environment
88 Group: Development/Libraries
89 Requires: %{name}-libs = %{epoch}:%{version}
90
91 %package libs
92 Summary: CUPS - shared libraries
93 Group: System Environment/Libraries
94 Provides: libcups1
95
96 %package lpd
97 Summary: CUPS - LPD support
98 Group: System Environment/Daemons
99 Requires: %{name} = %{epoch}:%{version} xinetd
100
101 %description
102 CUPS is the standards-based, open source printing system developed by
103 Apple Inc. for macOS® and other UNIX®-like operating systems.
104
105 %description devel
106 This package provides the CUPS headers and development environment.
107
108 %description libs
109 This package provides the CUPS shared libraries.
110
111 %description lpd
112 This package provides LPD client support.
113
114 %prep
115 %setup
116
117 %build
118 CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_OPT_FLAGS" \
119 ./configure %{_dbus} %{_dnssd} %{_libusb1} %{_static} %{_systemd}
120 # If we got this far, all prerequisite libraries must be here.
121 make
122
123 %install
124 # Make sure the RPM_BUILD_ROOT directory exists.
125 rm -rf $RPM_BUILD_ROOT
126
127 make BUILDROOT=$RPM_BUILD_ROOT install
128 rm -rf $RPM_BUILD_ROOT/usr/share/cups/banners $RPM_BUILD_ROOT/usr/share/cups/data
129
130 %post
131 %if %{?_with_systemd:1}%{!?_with_systemd:0}
132 /bin/systemctl enable org.cups.cupsd.service
133
134 if test $1 -ge 1; then
135 /bin/systemctl stop org.cups.cupsd.service
136 /bin/systemctl start org.cups.cupsd.service
137 fi
138
139 %else
140 /sbin/chkconfig --add cups
141 /sbin/chkconfig cups on
142
143 # Restart cupsd if we are upgrading...
144 if test $1 -gt 1; then
145 /sbin/service cups stop
146 /sbin/service cups start
147 fi
148 %endif
149
150 %post libs
151 /sbin/ldconfig
152
153 %preun
154 %if %{?_with_systemd:1}%{!?_with_systemd:0}
155 if test $1 -ge 1; then
156 /bin/systemctl stop org.cups.cupsd.service
157 /bin/systemctl disable org.cups.cupsd.service
158 fi
159
160 %else
161 if test $1 = 0; then
162 /sbin/service cups stop
163 /sbin/chkconfig --del cups
164 fi
165 %endif
166
167 %postun
168 %if %{?_with_systemd:1}%{!?_with_systemd:0}
169 if test $1 -ge 1; then
170 /bin/systemctl stop org.cups.cupsd.service
171 /bin/systemctl start org.cups.cupsd.service
172 fi
173
174 %else
175 if test $1 -ge 1; then
176 /sbin/service cups stop
177 /sbin/service cups start
178 fi
179 %endif
180
181 %postun libs
182 /sbin/ldconfig
183
184 %clean
185 rm -rf $RPM_BUILD_ROOT
186
187 %files
188 %docdir /usr/share/doc/cups
189 %defattr(-,root,root)
190 %dir /etc/cups
191 %config(noreplace) /etc/cups/*.conf
192 /etc/cups/cups-files.conf.default
193 /etc/cups/cupsd.conf.default
194 /etc/cups/snmp.conf.default
195 %dir /etc/cups/ppd
196 %attr(0700,root,root) %dir /etc/cups/ssl
197
198 %if %{?_with_dbus:1}%{!?_with_dbus:0}
199 # DBUS
200 /etc/dbus-1/system.d/*
201 %endif
202
203 # PAM
204 %dir /etc/pam.d
205 /etc/pam.d/*
206
207 %if %{?_with_systemd:1}%{!?_with_systemd:0}
208 # SystemD
209 /usr/lib/systemd/system/org.cups.cupsd.*
210
211 %else
212 # Legacy init support on Linux
213 /etc/init.d/*
214 /etc/rc0.d/*
215 /etc/rc2.d/*
216 /etc/rc3.d/*
217 /etc/rc5.d/*
218 %endif
219
220 /usr/bin/cancel
221 /usr/bin/cupstestdsc
222 /usr/bin/cupstestppd
223 /usr/bin/ipptool
224 /usr/bin/lp*
225 %dir /usr/lib/cups
226 %dir /usr/lib/cups/backend
227 %if %{?_with_dnssd:1}%{!?_with_dnssd:0}
228 # DNS-SD
229 /usr/bin/ippfind
230 /usr/lib/cups/backend/dnssd
231 %endif
232 /usr/lib/cups/backend/http
233 /usr/lib/cups/backend/https
234 %attr(0700,root,root) /usr/lib/cups/backend/ipp
235 /usr/lib/cups/backend/ipps
236 %attr(0700,root,root) /usr/lib/cups/backend/lpd
237 /usr/lib/cups/backend/snmp
238 /usr/lib/cups/backend/socket
239 /usr/lib/cups/backend/usb
240 %dir /usr/lib/cups/cgi-bin
241 /usr/lib/cups/cgi-bin/*
242 %dir /usr/lib/cups/daemon
243 /usr/lib/cups/daemon/cups-deviced
244 /usr/lib/cups/daemon/cups-driverd
245 /usr/lib/cups/daemon/cups-exec
246 %dir /usr/lib/cups/driver
247 %dir /usr/lib/cups/filter
248 /usr/lib/cups/filter/*
249 %dir /usr/lib/cups/monitor
250 /usr/lib/cups/monitor/*
251 %dir /usr/lib/cups/notifier
252 /usr/lib/cups/notifier/*
253
254 /usr/sbin/*
255 %dir /usr/share/cups
256 %dir /usr/share/cups/drv
257 /usr/share/cups/drv/*
258 %dir /usr/share/cups/ipptool
259 /usr/share/cups/ipptool/*
260 %dir /usr/share/cups/mime
261 /usr/share/cups/mime/*
262 %dir /usr/share/cups/model
263 %dir /usr/share/cups/ppdc
264 /usr/share/cups/ppdc/*
265 %dir /usr/share/cups/templates
266 /usr/share/cups/templates/*
267 %if %{?_with_libusb1:1}%{!?_with_libusb1:0}
268 # LIBUSB quirks files
269 %dir /usr/share/cups/usb
270 /usr/share/cups/usb/*
271 %endif
272
273 %dir /usr/share/doc/cups
274 /usr/share/doc/cups/*.*
275 %dir /usr/share/doc/cups/help
276 /usr/share/doc/cups/help/accounting.html
277 /usr/share/doc/cups/help/cgi.html
278 /usr/share/doc/cups/help/encryption.html
279 /usr/share/doc/cups/help/glossary.html
280 /usr/share/doc/cups/help/kerberos.html
281 /usr/share/doc/cups/help/license.html
282 /usr/share/doc/cups/help/man-*.html
283 /usr/share/doc/cups/help/network.html
284 /usr/share/doc/cups/help/options.html
285 /usr/share/doc/cups/help/overview.html
286 /usr/share/doc/cups/help/policies.html
287 /usr/share/doc/cups/help/ref-*.html
288 /usr/share/doc/cups/help/security.html
289 /usr/share/doc/cups/help/sharing.html
290 /usr/share/doc/cups/help/translation.html
291 %dir /usr/share/doc/cups/images
292 /usr/share/doc/cups/images/*
293
294 #%dir /usr/share/doc/cups/ca
295 #/usr/share/doc/cups/ca/*
296 #%dir /usr/share/doc/cups/cs
297 #/usr/share/doc/cups/cs/*
298 %dir /usr/share/doc/cups/de
299 /usr/share/doc/cups/de/*
300 %dir /usr/share/doc/cups/es
301 /usr/share/doc/cups/es/*
302 #%dir /usr/share/doc/cups/fr
303 #/usr/share/doc/cups/fr/*
304 %dir /usr/share/doc/cups/ja
305 /usr/share/doc/cups/ja/*
306 %dir /usr/share/doc/cups/pt_BR
307 /usr/share/doc/cups/pt_BR/*
308 %dir /usr/share/doc/cups/ru
309 /usr/share/doc/cups/ru/*
310
311 %dir /usr/share/locale/ca
312 /usr/share/locale/ca/cups_ca.po
313 %dir /usr/share/locale/cs
314 /usr/share/locale/cs/cups_cs.po
315 %dir /usr/share/locale/de
316 /usr/share/locale/de/cups_de.po
317 %dir /usr/share/locale/es
318 /usr/share/locale/es/cups_es.po
319 %dir /usr/share/locale/fr
320 /usr/share/locale/fr/cups_fr.po
321 %dir /usr/share/locale/it
322 /usr/share/locale/it/cups_it.po
323 %dir /usr/share/locale/ja
324 /usr/share/locale/ja/cups_ja.po
325 %dir /usr/share/locale/pt_BR
326 /usr/share/locale/pt_BR/cups_pt_BR.po
327 %dir /usr/share/locale/ru
328 /usr/share/locale/ru/cups_ru.po
329 %dir /usr/share/locale/zh_CN
330 /usr/share/locale/zh_CN/cups_zh_CN.po
331
332 %dir /usr/share/man/man1
333 /usr/share/man/man1/cancel.1.gz
334 /usr/share/man/man1/cups.1.gz
335 /usr/share/man/man1/cupstestdsc.1.gz
336 /usr/share/man/man1/cupstestppd.1.gz
337 %if %{?_with_dnssd:1}%{!?_with_dnssd:0}
338 # DNS-SD
339 /usr/share/man/man1/ippfind.1.gz
340 %endif
341 /usr/share/man/man1/ipptool.1.gz
342 /usr/share/man/man1/lp.1.gz
343 /usr/share/man/man1/lpoptions.1.gz
344 /usr/share/man/man1/lpq.1.gz
345 /usr/share/man/man1/lpr.1.gz
346 /usr/share/man/man1/lprm.1.gz
347 /usr/share/man/man1/lpstat.1.gz
348 %dir /usr/share/man/man5
349 /usr/share/man/man5/*.conf.5.gz
350 /usr/share/man/man5/cupsd-logs.5.gz
351 /usr/share/man/man5/ipptoolfile.5.gz
352 /usr/share/man/man5/mime.*.5.gz
353 %dir /usr/share/man/man8
354 /usr/share/man/man8/accept.8.gz
355 /usr/share/man/man8/cups-deviced.8.gz
356 /usr/share/man/man8/cups-driverd.8.gz
357 /usr/share/man/man8/cups-exec.8.gz
358 /usr/share/man/man8/cups-snmp.8.gz
359 /usr/share/man/man8/cupsaddsmb.8.gz
360 /usr/share/man/man8/cupsaccept.8.gz
361 /usr/share/man/man8/cupsctl.8.gz
362 /usr/share/man/man8/cupsfilter.8.gz
363 /usr/share/man/man8/cupsd.8.gz
364 /usr/share/man/man8/cupsd-helper.8.gz
365 /usr/share/man/man8/cupsdisable.8.gz
366 /usr/share/man/man8/cupsenable.8.gz
367 /usr/share/man/man8/cupsreject.8.gz
368 /usr/share/man/man8/lpadmin.8.gz
369 /usr/share/man/man8/lpc.8.gz
370 /usr/share/man/man8/lpinfo.8.gz
371 /usr/share/man/man8/lpmove.8.gz
372 /usr/share/man/man8/reject.8.gz
373
374 %dir /var/cache/cups
375 %attr(0775,root,sys) %dir /var/cache/cups/rss
376 %dir /var/log/cups
377 %dir /var/run/cups
378 %attr(0711,lp,sys) %dir /var/run/cups/certs
379 %attr(0710,lp,sys) %dir /var/spool/cups
380 %attr(1770,lp,sys) %dir /var/spool/cups/tmp
381
382 # Desktop files
383 /usr/share/applications/*
384 /usr/share/icons/*
385
386 %files devel
387 %defattr(-,root,root)
388 %dir /usr/share/cups/examples
389 /usr/share/cups/examples/*
390 %dir /usr/share/man/man1
391 /usr/share/man/man1/cups-config.1.gz
392 /usr/share/man/man1/ppd*.1.gz
393 %dir /usr/share/man/man5
394 /usr/share/man/man5/ppdcfile.5.gz
395 /usr/share/man/man7/backend.7.gz
396 /usr/share/man/man7/filter.7.gz
397 /usr/share/man/man7/notifier.7.gz
398
399 /usr/bin/cups-config
400 /usr/bin/ppd*
401 %dir /usr/include/cups
402 /usr/include/cups/*
403 /usr/lib*/*.so
404
405 %if %{?_with_static:1}%{!?_with_static:0}
406 /usr/lib*/*.a
407 %endif
408
409 %dir /usr/share/doc/cups/help
410 /usr/share/doc/cups/help/api*.html
411 /usr/share/doc/cups/help/cupspm.html
412 /usr/share/doc/cups/help/postscript-driver.html
413 /usr/share/doc/cups/help/ppd-compiler.html
414 /usr/share/doc/cups/help/raster-driver.html
415 /usr/share/doc/cups/help/spec*.html
416
417 %files libs
418 %defattr(-,root,root)
419 /usr/lib*/*.so.*
420
421 %files lpd
422 %defattr(-,root,root)
423 %if %{?_with_systemd:1}%{!?_with_systemd:0}
424 # SystemD
425 /usr/lib/systemd/system/org.cups.cups-lpd*
426 %else
427 # Legacy xinetd
428 /etc/xinetd.d/cups-lpd
429 %endif
430
431 %dir /usr/lib/cups
432 %dir /usr/lib/cups/daemon
433 /usr/lib/cups/daemon/cups-lpd
434 %dir /usr/share/man/man8
435 /usr/share/man/man8/cups-lpd.8.gz