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