-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathsnapcraft.yaml
689 lines (671 loc) · 19.2 KB
/
snapcraft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
name: cups
base: core22 # The base Snap is the execution environment for this Snap
version: '2.4.11-3'
grade: stable
summary: CUPS-based printing stack Snap
description: Complete printing environment in a Snap
confinement: strict
adopt-info: cups
# We need snapd 2.55 or later to have the needed support for the
# `cups` interface in snapd
assumes: [snapd2.55]
# Only build on the architectures supported
architectures:
- build-on: amd64
- build-on: arm64
- build-on: armhf
# When expanding to RISC-V: We use "jq" (JSON interpreter) for
# auto-versioning and this is probably similar to "yq" (YAML
# interpreter) and this one needed special attention for RISC-V. See
# https://ubuntu.com//blog/we-wish-you-risc-v-holidays
# System user for filters and backends to drop privileges, "lp" is not
# available in a Snap
# See https://forum.snapcraft.io/t/system-usernames/
system-usernames:
snap_daemon: shared
# Make fontconfig for the texttopdf and bannertopdf filters working by
# mirroring the needed directories to the places where libfontconfig is
# searching for them
layout:
/etc/fonts:
bind: $SNAP/etc/fonts
/usr/share/fonts:
bind: $SNAP/usr/share/fonts
/var/cache/fontconfig:
bind: $SNAP_DATA/var/cache/fontconfig
/etc/papersize:
bind-file: $SNAP_COMMON/etc/papersize
environment:
CUPS_SERVERROOT: /var/snap/cups/common/etc/cups
CUPS_DATADIR: /snap/cups/current/share/cups
CUPS_SERVERBIN: /snap/cups/current/lib/cups
plugs:
# This interface is needed for checking whether CUPS in this Snap
# should run as a proxy for the system's CUPS or whether this Snap's
# CUPS is the standard CUPS for the system. This interface also
# serves for scripts which do a migration of the configuration and
# print queues of a classically installed CUPS when it is replaced
# by this CUPS Snap
etc-cups:
interface: system-files
read:
- /etc/cups
# Alias name for our cupsd to plug the host system's cups-control to
# access the host system's cupsd in proxy mode while we also have a
# slot named cups-control for snapped printer setup tools to be able
# to manage our cupsd. The plug also allows the utilities included
# with this Snap to do admin tasks on a CUPS daemon which is not
# from this Snap.
cups-host:
interface: cups-control
slots:
# Provide the cups-control and cups slots for other Snaps to connect to
cups-control:
interface: cups-control
cups:
interface: cups
cups-socket-directory: $SNAP_COMMON/run
apps:
cupsd:
command: scripts/run-cupsd
stop-command: scripts/stop-cupsd
reload-command: scripts/reload-cupsd
restart-condition: always
daemon: simple
plugs: [network, network-bind, avahi-control, raw-usb, etc-cups, cups-host]
cups-browsed:
command: scripts/run-cups-browsed
stop-command: scripts/stop-cups-browsed
reload-command: scripts/reload-cups-browsed
restart-condition: always
daemon: simple
plugs: [network, network-bind, network-manager-observe, avahi-control]
lpinfo:
command: scripts/run-util sbin/lpinfo
plugs: [network, cups-host]
lpadmin:
command: scripts/run-util sbin/lpadmin
plugs: [network, avahi-control, home, cups-host]
lpstat:
command: scripts/run-util bin/lpstat
plugs: [network, avahi-control, cups-host]
lpq:
command: scripts/run-util bin/lpq
plugs: [network, cups-host]
lpc:
command: scripts/run-util sbin/lpc
plugs: [network, cups-host]
lpoptions:
command: scripts/run-util bin/lpoptions
plugs: [network, home, cups-host]
lp:
command: scripts/run-util bin/lp
plugs: [network, home, cups-host]
lpr:
command: scripts/run-util bin/lpr
plugs: [network, home, cups-host]
cancel:
command: scripts/run-util bin/cancel
plugs: [network, cups-host]
lprm:
command: scripts/run-util bin/lprm
plugs: [network, cups-host]
cupsenable:
command: scripts/run-util sbin/cupsenable
plugs: [network, cups-host]
cupsdisable:
command: scripts/run-util sbin/cupsdisable
plugs: [network, cups-host]
cupsaccept:
command: scripts/run-util sbin/cupsaccept
plugs: [network, cups-host]
cupsreject:
command: scripts/run-util sbin/cupsreject
plugs: [network, cups-host]
accept:
command: scripts/run-util sbin/cupsaccept
plugs: [network, cups-host]
reject:
command: scripts/run-util sbin/cupsreject
plugs: [network, cups-host]
cupsctl:
command: scripts/run-util sbin/cupsctl
plugs: [network, cups-host]
cupsfilter:
command: scripts/run-util sbin/cupsfilter
plugs: [network, home]
cupstestppd:
command: scripts/run-util bin/cupstestppd
plugs: [network, home]
ipptool:
command: scripts/run-util bin/ipptool
plugs: [network, avahi-control, home]
ippfind:
command: scripts/run-util bin/ippfind
plugs: [network, avahi-control]
driverless:
command: scripts/run-util bin/driverless
plugs: [network, avahi-control]
ippeveprinter:
command: scripts/run-util bin/ippeveprinter
plugs: [network, network-bind, avahi-control, home, raw-usb]
gs:
command: bin/gs
plugs: [home, etc-cups]
parts:
cups:
source: https://github.com/OpenPrinting/cups.git
source-type: git
source-tag: 'v2.4.11'
source-depth: 1
# ext:updatesnap
# version-format:
# lower-than: '3'
# no-9x-revisions: true
plugin: autotools
autotools-configure-parameters:
- --prefix=/
- --exec-prefix=/
# Prevent the libraries from being put into lib64
- --libdir=/lib
- --datadir=/share
- --datarootdir=/share
- --includedir=/include
- --sysconfdir=/var/snap/cups/common/etc
- --with-system-groups=root
- --enable-libpaper
- --disable-pam
- --disable-systemd
- --without-rcdir
- --with-docdir=/share/cups/doc
- --with-container=snap
# We use "--with-tls=gnutls" here, as current CUPS defaults to SSL here
# and this is buggy, causing a segfault when serving out a HTTPS web
# interface page.
- --with-tls=gnutls
#- --enable-debug-printfs
override-pull: |
set -eux
# Do the actual pull task
craftctl default
# Settings:
# Patch to use snapctl with the slot name "cups-server" for Snap mediation
#patch -p1 < $CRAFT_PROJECT_DIR/patches/use-snapctl-with-slot-cups-server.patch
# Longer timeout for Avahi resolving for cupsGetDests() API function, used
# by "lpstat -l -e" (https://github.com/OpenPrinting/cups/issues/751)
perl -p -i -e 's/(#\s*define\s+_CUPS_DNSSD_GET_DESTS\s+)250(\s+)/\1 1000\2/' cups/dest.c
build-packages:
- git
- sed
- curl
- perl-base
- patch
- autoconf
- automake
- libtool
- autotools-dev
- pkg-config
- g++
- libavahi-client-dev
- libavahi-common-dev
- libavahi-compat-libdnssd-dev
- libdbus-1-dev
- libgnutls28-dev
- libkrb5-dev
- libpam0g-dev
- libpaper-dev
- libsystemd-dev
- libusb-1.0-0-dev
- po4a
- po-debconf
- zlib1g-dev
- libapparmor-dev
- libsnapd-glib-dev
stage-packages:
- libusb-1.0-0
- libavahi-common3
- libavahi-client3
- libpaper1
- libsnapd-glib1
- libapparmor1
organize:
var/snap/cups/common/etc: etc
stage:
# The *.la file which gets installed by "make install" contains a
# wrong prefix, breaking parts of this Snap which use this library
- -lib/lib*.la
prime:
- -etc/fonts
- -var
- -include
- -share/man
- -share/doc
- -share/lintian
- -usr/share/fonts
- -usr/share/man
- -usr/share/doc
- -usr/share/doc-base
- -usr/share/lintian
# Reported unused by snapcraft linter
- -lib/libcupsimage.*
- -usr/lib/*/libdconf.*
- -usr/lib/*/libicuio.*
- -usr/lib/*/libicutest.*
- -usr/lib/*/libicutu.*
- -usr/lib/*/libicui18n.*
qpdf:
source: https://github.com/qpdf/qpdf/
source-type: git
source-tag: 'v11.9.1'
source-depth: 1
# ext:updatesnap
# version-format:
# lower-than: '12'
# no-9x-revisions: true
plugin: cmake
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/
- -DCMAKE_BUILD_RPATH_USE_ORIGIN=1
- -DUSE_IMPLICIT_CRYPTO=0
- -DREQUIRE_CRYPTO_GNUTLS=1
- -DSHOW_FAILED_TEST_OUTPUT=1
- -DCMAKE_BUILD_TYPE=RelWithDebInfo
- -DQTEST_COLOR=0
build-packages:
- cmake
- g++
- libjpeg-dev
- zlib1g-dev
- libgnutls28-dev
stage-packages:
- libjpeg-turbo8
stage:
# The *.la file which gets installed by "make install" contains a
# wrong prefix, breaking parts of this Snap which use this library
- -usr/lib/lib*.la
prime:
- -etc/fonts
- -var
- -include
- -share/man
- -share/doc
- -share/lintian
- -usr/share/fonts
- -usr/share/man
- -usr/share/doc
- -usr/share/doc-base
- -usr/share/lintian
- -usr/lib/libqpdf.a
ghostscript:
# use GitHub mirror of GhostPDL here, as original GIT, self-hosted by
# Artifex is not supported by ubuntu/desktop-snaps
#source: https://git.ghostscript.com/ghostpdl.git
source: https://github.com/ArtifexSoftware/ghostpdl.git
source-type: git
source-tag: 'ghostpdl-10.05.0-test-base-001'
source-depth: 1
# ext:updatesnap
# version-format:
# format: "ghostpdl-%M.%m.%R"
# lower-than: '11'
# no-9x-revisions: true
plugin: autotools
autotools-configure-parameters:
- --prefix=/
- --without-x
- --disable-gtk
- --with-drivers=pdfwrite,pdfimage8,pdfimage24,pdfimage32,ps2write,cups,pwgraster,appleraster,urf,PCLm,PCLm8,pxlmono,pxlcolor
- --enable-cups
- --enable-freetype
- --without-tesseract
- --datarootdir=/snap/cups/current/share/
- --with-fontpath=/snap/cups/current/share/cups/fonts
- --with-cups-serverbin=/snap/cups/current/lib/cups
- --with-cups-serverroot=/var/snap/cups/common/etc/cups
- --with-cups-datadir=/snap/cups/current/share/cups
override-pull: |
set -eux
# Do the actual pull task
craftctl default
# The repo is actually ghostpdl and not only Ghostscript, so a wider
# variety of print data renderers/interpreters/converters. One of
# them, gpdl, does not build with our ./configure settings but we
# actually do not need it. So delete its source directory to skip
# it.
# We also delete the source directories pcl and xps to not build
# further storage-space-consuming tools.
rm -rf gpdl pcl xps
build-environment:
# To find the libraries built in this Snap
- LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib:$CRAFT_STAGE/lib"
stage-packages:
- libpaper1
- libfontconfig1
- libfreetype6
- libpng16-16
prime:
- -etc/fonts
- -var
- -include
- -share/man
- -share/doc
- -share/lintian
- -usr/share/fonts
- -usr/share/man
- -usr/share/doc
- -usr/share/doc-base
- -usr/share/lintian
- -snap/cups
organize:
snap/cups/current/share: share
after: [cups]
libcupsfilters:
source: https://github.com/OpenPrinting/libcupsfilters
source-type: git
source-tag: '2.1.0'
source-depth: 1
# ext:updatesnap
# version-format:
# lower-than: '3'
# no-9x-revisions: true
plugin: autotools
autotools-configure-parameters:
- --prefix=/
- --exec-prefix=/
- --datadir=/share
- --datarootdir=/share
- --includedir=/include
- --disable-avahi
- --disable-mutool
build-environment:
# To find the libraries built in this Snap
- LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib:$CRAFT_STAGE/lib"
build-packages:
- gettext
- autoconf
- automake
- autotools-dev
- pkg-config
- g++
- sharutils
- liblcms2-dev
- libpoppler-cpp-dev
- libpng-dev
- libjpeg-dev
- libtiff5-dev
- zlib1g-dev
- libfontconfig1-dev
- libdbus-1-dev
- libexif-dev
stage-packages:
- libpoppler-cpp0v5
- libjbig0
- liblcms2-2
- libnspr4
- libnss3
- libopenjp2-7
- libpoppler118
- libtiff5
- libwebp7
- libexif12
stage:
- -lib/lib*.la
# The *.la file which gets installed by "make install" contains a
# wrong prefix, breaking parts of this Snap which use this library
prime:
- -etc
- -var
- -include
- -lib/pkgconfig
- -share/man
- -share/doc
- -share/lintian
- -usr/share/man
- -usr/share/doc
- -usr/share/doc-base
- -usr/share/lintian
- share/cups
- lib/lib*.so*
- lib/*/lib*.so*
- usr/lib/lib*.so*
- usr/lib/*/lib*.so*
- usr/lib/*/nss
# Reported unused by snapcraft linter
- -usr/lib/*/libssl3.*
after: [cups, qpdf, ghostscript]
libppd:
source: https://github.com/OpenPrinting/libppd
source-type: git
source-tag: '2.1.0'
source-depth: 1
# ext:updatesnap
# version-format:
# lower-than: '3'
# no-9x-revisions: true
plugin: autotools
# We only need libppd itself
autotools-configure-parameters:
- --prefix=/
- --exec-prefix=/
- --datadir=/share
- --datarootdir=/share
- --includedir=/include
- --disable-mutool
- --disable-pdftocairo
- --disable-acroread
- --with-pdftops-path=/snap/cups/current/usr/bin/pdftops
build-environment:
# To find the libraries built in this Snap
- LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib:$CRAFT_STAGE/lib"
# We have to force-define the macros for the properties of the
# external executables here, as the tests do not work in the Snap
# build environment
- CFLAGS: "$CFLAGS -DHAVE_GHOSTSCRIPT_PS2WRITE -DHAVE_POPPLER_PDFTOPS_WITH_ORIGPAGESIZES -DHAVE_POPPLER_PDFTOPS_WITH_RESOLUTION"
build-packages:
- gettext
- autoconf
- automake
- autotools-dev
- pkg-config
- g++
- sharutils
- poppler-utils
stage:
# The *.la file which gets installed by "make install" contains a
# wrong prefix, breaking parts of this Snap which use this library
- -lib/lib*.la
prime:
- -etc
- -var
- -include
- -lib/pkgconfig
- -share/man
- -share/doc
- -share/lintian
- -usr/share/ppdc
- -usr/share/fonts
- -usr/share/man
- -usr/share/doc
- -usr/share/doc-base
- -usr/share/lintian
- lib/lib*.so*
- lib/*/lib*.so*
- usr/lib/lib*.so*
- usr/lib/*/lib*.so*
- usr/lib/*/nss
after: [cups, ghostscript, libcupsfilters]
cups-filters:
source: https://github.com/OpenPrinting/cups-filters.git
source-type: git
source-tag: '2.0.1'
source-depth: 1
# ext:updatesnap
# version-format:
# lower-than: '3'
# no-9x-revisions: true
plugin: autotools
autotools-configure-parameters:
- --prefix=/
- --exec-prefix=/
- --datadir=/share
- --datarootdir=/share
- --includedir=/include
- --disable-mutool
- --disable-universal-cups-filter
- --enable-individual-cups-filters
build-environment:
# To find the libraries built in this Snap
- LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib:$CRAFT_STAGE/lib"
build-packages:
- autoconf
- autotools-dev
- pkg-config
- g++
- sharutils
- poppler-utils
- liblcms2-dev
- libpoppler-cpp-dev
- zlib1g-dev
- libavahi-common-dev
- libavahi-client-dev
stage-packages:
- poppler-utils
- libpoppler-cpp0v5
- libdb5.3
- fonts-freefont-ttf
- fonts-arphic-uming
- fontconfig-config
organize:
var/snap/cups/common/etc: etc
prime:
- -var
- -include
- -share/man
- -share/doc
- -share/lintian
- -usr/share/man
- -usr/share/doc
- -usr/share/doc-base
- -usr/share/lintian
# Reported unused by snapcraft linter
- -usr/lib/*/libssl3.*
after: [cups, qpdf, ghostscript, libcupsfilters, libppd]
cups-browsed:
source: https://github.com/OpenPrinting/cups-browsed.git
source-type: git
source-tag: '2.1.0'
source-depth: 1
# ext:updatesnap
# version-format:
# lower-than: '3'
# no-9x-revisions: true
plugin: autotools
autotools-configure-parameters:
- --prefix=/
- --exec-prefix=/
- --datadir=/share
- --datarootdir=/share
- --includedir=/include
- --without-rcdir
build-environment:
# To find the libraries built in this Snap
- LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib:$CRAFT_STAGE/lib"
build-packages:
- autoconf
- autotools-dev
- pkg-config
- g++
- sharutils
- libglib2.0-dev
- libldap2-dev
- zlib1g-dev
- libdbus-1-dev
- libavahi-common-dev
- libavahi-client-dev
- libavahi-glib-dev
stage-packages:
- libavahi-glib1
- libldap-2.5-0
- libsasl2-2
- libdb5.3
organize:
var/snap/cups/common/etc: etc
prime:
- -var
- -include
- -share/man
- -share/doc
- -share/lintian
- -usr/share/man
- -usr/share/doc
- -usr/share/doc-base
- -usr/share/lintian
after: [cups, libcupsfilters, libppd]
utils:
plugin: nil
source: .
stage-packages:
- perl-base
- sed
- grep
- libbinutils
organize:
usr/bin/: bin/
usr/lib/: lib/
usr/share/: share/
prime:
- bin/
- lib/
- share/
- -share/gdb
- -share/info
- -share/man
- -share/doc
- -share/lintian
# Reported unused by snapcraft linter
- -lib/*/libopcodes-*
- -lib/*/libbfd-*
scripts:
plugin: dump
source: scripts/
override-build: |
set -eux
gcc -o port-occupied port-occupied.c
craftctl default
organize:
run-cupsd: scripts/run-cupsd
stop-cupsd: scripts/stop-cupsd
reload-cupsd: scripts/reload-cupsd
run-cups-browsed: scripts/run-cups-browsed
stop-cups-browsed: scripts/stop-cups-browsed
reload-cups-browsed: scripts/reload-cups-browsed
run-util: scripts/run-util
port-occupied: scripts/port-occupied
prime:
- scripts/
build-packages:
- gcc
after: [cups, cups-filters, utils]
cups-proxyd:
plugin: make
source: cups-proxyd
override-build: |
set -eux
# We do "make clean" here that we do not accidentally use
# binaries manually built in the source tree for development and
# copied into a local Snap build process
make clean
craftctl default
build-environment:
# To find the libraries built in this Snap
- LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib:$CRAFT_STAGE/lib"
build-packages:
- gcc
- libglib2.0-dev
- libavahi-common-dev
- libavahi-client-dev
- libavahi-glib-dev
organize:
usr/lib/cups/backend: lib/cups/backend
usr/sbin: sbin
after: [cups, cups-filters]