]> git.ipfire.org Git - thirdparty/cups.git/blame - packaging/cups.spec.in
Fix a performance regression with large PPDs (rdar://47040759)
[thirdparty/cups.git] / packaging / cups.spec.in
CommitLineData
ef416fc2 1#
7f5ce42e 2# RPM "spec" file for CUPS.
ef416fc2 3#
7f5ce42e 4# Original version by Jason McMullan <jmcc@ontv.com>.
ef416fc2 5#
3980a9c1 6# Copyright 2007-2017 by Apple Inc.
7f5ce42e 7# Copyright 1999-2007 by Easy Software Products, all rights reserved.
ef416fc2 8#
7f5ce42e
MS
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/".
ef416fc2 14#
15
ecdc0628 16# Conditional build options (--with name/--without name):
17#
18# dbus - Enable/disable DBUS support (default = enable)
f3c17241 19# dnssd - Enable/disable DNS-SD support (default = enable)
7f5ce42e 20# libusb1 - Enable/disable LIBUSB 1.0 support (default = enable)
f3c17241 21# static - Enable/disable static libraries (default = enable)
f495e905 22# systemd - Enable/disable systemd support (default = enable)
ecdc0628 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
37e7e6e0 28%{!?_with_dnssd: %{!?_without_dnssd: %define _with_dnssd --with-dnssd}}
64447b56
MS
29%{?_with_dnssd: %define _dnssd --enable-avahi}
30%{!?_with_dnssd: %define _dnssd --disable-avahi}
f3c17241 31
7f5ce42e
MS
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
d6ae789d 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
8c29c890
MS
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
9aff70cc 44Summary: CUPS
ef416fc2 45Name: cups
46Version: @CUPS_VERSION@
47Release: 0
48Epoch: 1
49License: GPL
50Group: System Environment/Daemons
f02c7d66 51Source: https://github.com/apple/cups/releases/download/v%{version}/cups-%{version}-source.tar.gz
ef416fc2 52Url: http://www.cups.org
f02c7d66
MS
53Packager: Anonymous <anonymous@example.com>
54Vendor: Example Corp
ef416fc2 55
7f5ce42e 56# Package names are as defined for Red Hat (and clone) distributions
93aa5239
MS
57BuildRequires: gnutls-devel, pam-devel
58
7f5ce42e
MS
59%if %{?_with_dbus:1}%{!?_with_dbus:0}
60BuildRequires: dbus-devel
61%endif
62
63%if %{?_with_dnssd:1}%{!?_with_dnssd:0}
64BuildRequires: avahi-devel
65%endif
66
67%if %{?_with_libusb1:1}%{!?_with_libusb1:0}
995b120a 68BuildRequires: libusb-devel >= 1.0
7f5ce42e
MS
69%endif
70
8c29c890
MS
71%if %{?_with_systemd:1}%{!?_with_systemd:0}
72BuildRequires: systemd-devel
73%endif
74
ef416fc2 75# Use buildroot so as not to disturb the version already installed
76BuildRoot: /tmp/%{name}-root
77
78# Dependencies...
79Requires: %{name}-libs = %{epoch}:%{version}
80Obsoletes: lpd, lpr, LPRng
81Provides: lpd, lpr, LPRng
75bd9771
MS
82Obsoletes: cups-da, cups-de, cups-es, cups-et, cups-fi, cups-fr, cups-he
83Obsoletes: cups-id, cups-it, cups-ja, cups-ko, cups-nl, cups-no, cups-pl
84Obsoletes: cups-pt, cups-ru, cups-sv, cups-zh
ef416fc2 85
86%package devel
9aff70cc 87Summary: CUPS - development environment
ef416fc2 88Group: Development/Libraries
89Requires: %{name}-libs = %{epoch}:%{version}
90
91%package libs
9aff70cc 92Summary: CUPS - shared libraries
ef416fc2 93Group: System Environment/Libraries
94Provides: libcups1
95
96%package lpd
9aff70cc 97Summary: CUPS - LPD support
ef416fc2 98Group: System Environment/Daemons
99Requires: %{name} = %{epoch}:%{version} xinetd
100
101%description
9aff70cc 102CUPS is the standards-based, open source printing system developed by
8072030b 103Apple Inc. for macOS® and other UNIX®-like operating systems.
ef416fc2 104
105%description devel
9aff70cc 106This package provides the CUPS headers and development environment.
ef416fc2 107
108%description libs
9aff70cc 109This package provides the CUPS shared libraries.
ef416fc2 110
111%description lpd
9aff70cc 112This package provides LPD client support.
ef416fc2 113
114%prep
115%setup
116
117%build
e1d6a774 118CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_OPT_FLAGS" \
f34c1c99 119 ./configure %{_dbus} %{_dnssd} %{_libusb1} %{_static} %{_systemd}
ef416fc2 120# If we got this far, all prerequisite libraries must be here.
121make
122
123%install
124# Make sure the RPM_BUILD_ROOT directory exists.
125rm -rf $RPM_BUILD_ROOT
126
127make BUILDROOT=$RPM_BUILD_ROOT install
ab428cc0 128rm -rf $RPM_BUILD_ROOT/usr/share/cups/banners $RPM_BUILD_ROOT/usr/share/cups/data
ef416fc2 129
130%post
75105fbd
MS
131%if %{?_with_systemd:1}%{!?_with_systemd:0}
132/bin/systemctl enable org.cups.cupsd.service
133
134if test $1 -ge 1; then
135 /bin/systemctl stop org.cups.cupsd.service
136 /bin/systemctl start org.cups.cupsd.service
137fi
138
139%else
bd7854cb 140/sbin/chkconfig --add cups
141/sbin/chkconfig cups on
ef416fc2 142
bd7854cb 143# Restart cupsd if we are upgrading...
144if test $1 -gt 1; then
145 /sbin/service cups stop
146 /sbin/service cups start
ef416fc2 147fi
75105fbd 148%endif
ef416fc2 149
bd7854cb 150%post libs
151/sbin/ldconfig
ef416fc2 152
153%preun
75105fbd
MS
154%if %{?_with_systemd:1}%{!?_with_systemd:0}
155if test $1 -ge 1; then
156 /bin/systemctl stop org.cups.cupsd.service
157 /bin/systemctl disable org.cups.cupsd.service
158fi
159
160%else
bd7854cb 161if test $1 = 0; then
162 /sbin/service cups stop
163 /sbin/chkconfig --del cups
ef416fc2 164fi
75105fbd 165%endif
ef416fc2 166
bd7854cb 167%postun
75105fbd
MS
168%if %{?_with_systemd:1}%{!?_with_systemd:0}
169if test $1 -ge 1; then
170 /bin/systemctl stop org.cups.cupsd.service
171 /bin/systemctl start org.cups.cupsd.service
172fi
173
174%else
bd7854cb 175if test $1 -ge 1; then
176 /sbin/service cups stop
177 /sbin/service cups start
ef416fc2 178fi
75105fbd 179%endif
ef416fc2 180
bd7854cb 181%postun libs
182/sbin/ldconfig
183
ef416fc2 184%clean
185rm -rf $RPM_BUILD_ROOT
186
187%files
bd7854cb 188%docdir /usr/share/doc/cups
ef416fc2 189%defattr(-,root,root)
190%dir /etc/cups
191%config(noreplace) /etc/cups/*.conf
1134a632 192/etc/cups/cups-files.conf.default
fa73b229 193/etc/cups/cupsd.conf.default
1134a632 194/etc/cups/snmp.conf.default
ef416fc2 195%dir /etc/cups/ppd
8ca02f3c 196%attr(0700,root,root) %dir /etc/cups/ssl
bd7854cb 197
ecdc0628 198%if %{?_with_dbus:1}%{!?_with_dbus:0}
bd7854cb 199# DBUS
200/etc/dbus-1/system.d/*
ecdc0628 201%endif
bd7854cb 202
203# PAM
ef416fc2 204%dir /etc/pam.d
205/etc/pam.d/*
206
8c29c890
MS
207%if %{?_with_systemd:1}%{!?_with_systemd:0}
208# SystemD
451d5797 209/usr/lib/systemd/system/org.cups.cupsd.*
ef416fc2 210
8c29c890
MS
211%else
212# Legacy init support on Linux
ef416fc2 213/etc/init.d/*
214/etc/rc0.d/*
215/etc/rc2.d/*
216/etc/rc3.d/*
217/etc/rc5.d/*
8c29c890 218%endif
ef416fc2 219
220/usr/bin/cancel
80ca4592 221/usr/bin/cupstestdsc
ef416fc2 222/usr/bin/cupstestppd
aaf19ab0 223/usr/bin/ipptool
ef416fc2 224/usr/bin/lp*
225%dir /usr/lib/cups
226%dir /usr/lib/cups/backend
f3c17241 227%if %{?_with_dnssd:1}%{!?_with_dnssd:0}
37e7e6e0 228# DNS-SD
75105fbd 229/usr/bin/ippfind
f3c17241
MS
230/usr/lib/cups/backend/dnssd
231%endif
e00b005a 232/usr/lib/cups/backend/http
f99f3698 233/usr/lib/cups/backend/https
7ff4fea9 234%attr(0700,root,root) /usr/lib/cups/backend/ipp
f99f3698 235/usr/lib/cups/backend/ipps
e00b005a 236%attr(0700,root,root) /usr/lib/cups/backend/lpd
89d46774 237/usr/lib/cups/backend/snmp
4400e98d 238/usr/lib/cups/backend/socket
e00b005a 239/usr/lib/cups/backend/usb
ef416fc2 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
f99f3698 245/usr/lib/cups/daemon/cups-exec
ef416fc2 246%dir /usr/lib/cups/driver
247%dir /usr/lib/cups/filter
248/usr/lib/cups/filter/*
bd7854cb 249%dir /usr/lib/cups/monitor
250/usr/lib/cups/monitor/*
ef416fc2 251%dir /usr/lib/cups/notifier
252/usr/lib/cups/notifier/*
253
254/usr/sbin/*
255%dir /usr/share/cups
634763e8
MS
256%dir /usr/share/cups/drv
257/usr/share/cups/drv/*
aaf19ab0
MS
258%dir /usr/share/cups/ipptool
259/usr/share/cups/ipptool/*
dd1abb6b
MS
260%dir /usr/share/cups/mime
261/usr/share/cups/mime/*
d6ae789d 262%dir /usr/share/cups/model
ac884b6a
MS
263%dir /usr/share/cups/ppdc
264/usr/share/cups/ppdc/*
d6ae789d 265%dir /usr/share/cups/templates
634763e8 266/usr/share/cups/templates/*
46cc8b81 267%if %{?_with_libusb1:1}%{!?_with_libusb1:0}
7f5ce42e 268# LIBUSB quirks files
89a65306
MS
269%dir /usr/share/cups/usb
270/usr/share/cups/usb/*
7f5ce42e 271%endif
89a65306 272
ef416fc2 273%dir /usr/share/doc/cups
274/usr/share/doc/cups/*.*
275%dir /usr/share/doc/cups/help
09a101d6 276/usr/share/doc/cups/help/accounting.html
4744bd90 277/usr/share/doc/cups/help/cgi.html
0ebe8e7c 278/usr/share/doc/cups/help/encryption.html
4744bd90 279/usr/share/doc/cups/help/glossary.html
355e94dc 280/usr/share/doc/cups/help/kerberos.html
4744bd90 281/usr/share/doc/cups/help/license.html
ef416fc2 282/usr/share/doc/cups/help/man-*.html
283/usr/share/doc/cups/help/network.html
4744bd90 284/usr/share/doc/cups/help/options.html
ef416fc2 285/usr/share/doc/cups/help/overview.html
8ca02f3c 286/usr/share/doc/cups/help/policies.html
4744bd90 287/usr/share/doc/cups/help/ref-*.html
288/usr/share/doc/cups/help/security.html
d2354e63 289/usr/share/doc/cups/help/sharing.html
4744bd90 290/usr/share/doc/cups/help/translation.html
ef416fc2 291%dir /usr/share/doc/cups/images
292/usr/share/doc/cups/images/*
37e7e6e0 293
8c29c890
MS
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/*
1134a632
MS
298%dir /usr/share/doc/cups/de
299/usr/share/doc/cups/de/*
f28a1eaf
MS
300%dir /usr/share/doc/cups/es
301/usr/share/doc/cups/es/*
8c29c890
MS
302#%dir /usr/share/doc/cups/fr
303#/usr/share/doc/cups/fr/*
1134a632
MS
304%dir /usr/share/doc/cups/ja
305/usr/share/doc/cups/ja/*
3980a9c1
MS
306%dir /usr/share/doc/cups/pt_BR
307/usr/share/doc/cups/pt_BR/*
1134a632
MS
308%dir /usr/share/doc/cups/ru
309/usr/share/doc/cups/ru/*
8c29c890 310
071b2906
MS
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
1134a632
MS
315%dir /usr/share/locale/de
316/usr/share/locale/de/cups_de.po
071b2906
MS
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
f463b80c
MS
321%dir /usr/share/locale/it
322/usr/share/locale/it/cups_it.po
071b2906
MS
323%dir /usr/share/locale/ja
324/usr/share/locale/ja/cups_ja.po
3980a9c1 325%dir /usr/share/locale/pt_BR
2b7e87a3 326/usr/share/locale/pt_BR/cups_pt_BR.po
071b2906
MS
327%dir /usr/share/locale/ru
328/usr/share/locale/ru/cups_ru.po
b3f6f8d2 329%dir /usr/share/locale/zh_CN
330/usr/share/locale/zh_CN/cups_zh_CN.po
ef416fc2 331
332%dir /usr/share/man/man1
333/usr/share/man/man1/cancel.1.gz
240214ef 334/usr/share/man/man1/cups.1.gz
80ca4592 335/usr/share/man/man1/cupstestdsc.1.gz
ef416fc2 336/usr/share/man/man1/cupstestppd.1.gz
75105fbd
MS
337%if %{?_with_dnssd:1}%{!?_with_dnssd:0}
338# DNS-SD
ad0357ca 339/usr/share/man/man1/ippfind.1.gz
75105fbd 340%endif
aaf19ab0 341/usr/share/man/man1/ipptool.1.gz
ef416fc2 342/usr/share/man/man1/lp.1.gz
343/usr/share/man/man1/lpoptions.1.gz
ef416fc2 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
ac884b6a 349/usr/share/man/man5/*.conf.5.gz
7470f0c7 350/usr/share/man/man5/cupsd-logs.5.gz
aaf19ab0 351/usr/share/man/man5/ipptoolfile.5.gz
ac884b6a 352/usr/share/man/man5/mime.*.5.gz
ef416fc2 353%dir /usr/share/man/man8
354/usr/share/man/man8/accept.8.gz
d95bd167
MS
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
ef416fc2 359/usr/share/man/man8/cupsaddsmb.8.gz
1f6f3dbc 360/usr/share/man/man8/cupsaccept.8.gz
bc44d920 361/usr/share/man/man8/cupsctl.8.gz
355e94dc 362/usr/share/man/man8/cupsfilter.8.gz
ef416fc2 363/usr/share/man/man8/cupsd.8.gz
240214ef 364/usr/share/man/man8/cupsd-helper.8.gz
ef416fc2 365/usr/share/man/man8/cupsdisable.8.gz
366/usr/share/man/man8/cupsenable.8.gz
1f6f3dbc 367/usr/share/man/man8/cupsreject.8.gz
ef416fc2 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
f7deaa1a 375%attr(0775,root,sys) %dir /var/cache/cups/rss
ef416fc2 376%dir /var/log/cups
377%dir /var/run/cups
bd7854cb 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
ef416fc2 381
e1d6a774 382# Desktop files
383/usr/share/applications/*
384/usr/share/icons/*
385
ef416fc2 386%files devel
387%defattr(-,root,root)
e6013cfa
MS
388%dir /usr/share/cups/examples
389/usr/share/cups/examples/*
ef416fc2 390%dir /usr/share/man/man1
ef416fc2 391/usr/share/man/man1/cups-config.1.gz
ac884b6a
MS
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
178cb736 397/usr/share/man/man7/notifier.7.gz
ef416fc2 398
399/usr/bin/cups-config
ac884b6a 400/usr/bin/ppd*
ef416fc2 401%dir /usr/include/cups
402/usr/include/cups/*
e1d6a774 403/usr/lib*/*.so
ef416fc2 404
d6ae789d 405%if %{?_with_static:1}%{!?_with_static:0}
406/usr/lib*/*.a
407%endif
408
ef416fc2 409%dir /usr/share/doc/cups/help
410/usr/share/doc/cups/help/api*.html
798d6e29 411/usr/share/doc/cups/help/cupspm.html
e6013cfa
MS
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
ef416fc2 415/usr/share/doc/cups/help/spec*.html
416
417%files libs
418%defattr(-,root,root)
e1d6a774 419/usr/lib*/*.so.*
ef416fc2 420
421%files lpd
422%defattr(-,root,root)
451d5797
MS
423%if %{?_with_systemd:1}%{!?_with_systemd:0}
424# SystemD
425/usr/lib/systemd/system/org.cups.cups-lpd*
426%else
427# Legacy xinetd
e1d6a774 428/etc/xinetd.d/cups-lpd
451d5797
MS
429%endif
430
ef416fc2 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