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