From b4a6815e32c9e1660eed0322ffd5d322053961e0 Mon Sep 17 00:00:00 2001 From: castrojo Date: Wed, 16 Sep 2026 12:57:53 -0400 Subject: [PATCH 1/9] refactor: cut over OCI builds to FSDK Assisted-by: GitHub Copilot GPT-5.6 via pi --- .github/workflows/update-fsdk-sources.yml | 4 +- .gitignore | 1 - README.md | 215 +-- docs/oci-physical-validation.md | 4 +- docs/skills/fsdk-cups-patching.md | 6 +- .../plans/2026-09-16-fsdk-cutover.md | 24 + rockcraft.yaml | 1615 ----------------- scripts/run-avahi.sh | 17 - scripts/start-server.sh | 24 - scripts/update-fsdk-sources.py | 7 +- 10 files changed, 91 insertions(+), 1826 deletions(-) create mode 100644 docs/superpowers/plans/2026-09-16-fsdk-cutover.md delete mode 100644 rockcraft.yaml delete mode 100644 scripts/run-avahi.sh delete mode 100644 scripts/start-server.sh diff --git a/.github/workflows/update-fsdk-sources.yml b/.github/workflows/update-fsdk-sources.yml index 41805a9..d713808 100644 --- a/.github/workflows/update-fsdk-sources.yml +++ b/.github/workflows/update-fsdk-sources.yml @@ -30,7 +30,7 @@ jobs: - name: Check for updates id: changes run: | - if git diff --quiet -- VERSION elements; then + if git diff --quiet -- VERSION README.md elements; then echo "changed=false" >> "$GITHUB_OUTPUT" else echo "changed=true" >> "$GITHUB_OUTPUT" @@ -59,7 +59,7 @@ jobs: git config user.name 'mergeraptor[bot]' git config user.email '${{ secrets.MERGERAPTOR_APP_ID }}+mergeraptor[bot]@users.noreply.github.com' git switch --create "$branch" - git add VERSION elements + git add VERSION README.md elements git commit -m 'chore(deps): update FSDK appliance sources' basic="$(printf 'x-access-token:%s' "$GH_TOKEN" | base64 -w0)" echo "::add-mask::$basic" diff --git a/.gitignore b/.gitignore index d8fb923..06a921f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ *.snap -*.rock .DS_Store .scratch/ .worktrees/ diff --git a/README.md b/README.md index e8b8150..6efb516 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Your contributions are welcome. Please post [issues and pull requests](https://github.com/OpenPrinting/ghostscript-printer-app). -### Contained Printer Drivers (in the Snap) +### Contained Printer Drivers - **Ghostscript built-in**: ``` @@ -59,8 +59,8 @@ requests](https://github.com/OpenPrinting/ghostscript-printer-app). - **`pnm2ppa`**: Driver for some older HP printers with proprietary protocol, probably the only HP printers **NOT supported by - HPLIP**. even not with HP's proprietary plugin. The configuration - file in the Snap is user-editable, see below. + HPLIP**. even not with HP's proprietary plugin. Its configuration file is + user-editable in persistent application state, see below. - **`pxljr`**: For HP Color LaserJet 3500/3550/3600, should give better output quality than HPLIP. @@ -71,8 +71,8 @@ requests](https://github.com/OpenPrinting/ghostscript-printer-app). facility for HP is not included in this Printer Application, use the [HPLIP Printer Application](https://snapcraft.io/hplip-printer-app) (download proprietary plugin in-app, via web interface) for these - printers, the firmware is proprietary anyway. In the Snap the user - can add color profiles, see below. + printers, the firmware is proprietary anyway. Users can add color profiles + in persistent application state, see below. - **`SpliX`**: Driver for laser printers with proprietary languages, from Dell, Lexmark, Samsung, Toshiba, Xerox @@ -93,8 +93,8 @@ requests](https://github.com/OpenPrinting/ghostscript-printer-app). - **`ptouch`**: Driver for Brother's P-Touch label printers - **`c2050`, `cjet`, `min12xxw`, `m2300w`**: Drivers for older - Lexmark, Canon, and Minolta printers. For `m2300w` in the Snap the - user can add color profiles, see below. + Lexmark, Canon, and Minolta printers. Users can add `m2300w` color profiles + in persistent application state, see below. - **`CUPS`, `cups-filters`**: Included drivers for PCL, dot-matrix (Oki, Epson), label printers (Dymo, Intellitech, Zebra), and some @@ -340,177 +340,72 @@ If you mess up any configuration file under `/var/snap/ghostscript-printer-app/common/`, simply delete it (or move it away) and restart the Snap to get it restored. -## THE ROCK (OCI CONTAINER IMAGE) +## OCI CONTAINER IMAGE -### Install from Docker Hub -#### Prerequisites +The OCI appliance is published only to the GitHub Container Registry under +immutable application-version tags. The version is recorded in [`VERSION`](VERSION); +there is no `latest`, `edge`, or `stable` OCI tag. -1. **Docker Installed**: Ensure Docker is installed on your system. You can download it from the [official Docker website](https://www.docker.com/get-started). -```sh - sudo snap install docker -``` - -#### Step-by-Step Guide - -You can pull the `ghostscript-printer-app` Docker image from either the GitHub Container Registry or Docker Hub. - -**From GitHub Container Registry**
-To pull the image from the GitHub Container Registry, run the following command: -```sh - sudo docker pull ghcr.io/openprinting/ghostscript-printer-app:latest -``` - -Create a Docker volume: -```sh - sudo docker volume create ghostscript-printer-app -``` - -To run the container after pulling the image from the GitHub Container Registry, use: -```sh - sudo docker run -d \ - --name ghostscript-printer-app \ - --network host \ - -e PORT= \ - -v ghostscript-printer-app:/var/lib/ghostscript-printer-app \ - -v /dev/bus/usb:/dev/bus/usb:ro \ - --device-cgroup-rule='c 189:* rmw' \ - ghcr.io/openprinting/ghostscript-printer-app:latest -``` - -**From Docker Hub**
-Alternatively, you can pull the image from Docker Hub, by running: -```sh - sudo docker pull openprinting/ghostscript-printer-app -``` - -Create a Docker volume: -```sh - sudo docker volume create ghostscript-printer-app -``` - -To run the container after pulling the image from Docker Hub, use: -```sh - sudo docker run -d \ - --name ghostscript-printer-app \ - --network host \ - -e PORT= \ - -v ghostscript-printer-app:/var/lib/ghostscript-printer-app \ - -v /dev/bus/usb:/dev/bus/usb:ro \ - --device-cgroup-rule='c 189:* rmw' \ - openprinting/ghostscript-printer-app:latest -``` +### Run the published image -- `PORT` is an optional environment variable used to start the printer-app on a specified port. If not provided, it will start on the default port 8000 or, if port 8000 is busy, on 8001 and so on. -- **The container must be started in `--network host` mode** to allow the Printer-Application instance inside the container to access and discover printers available in the local network where the host system is in. -- Alternatively using the internal network of the Docker instance (`-p :8000` instead of `--network host -e PORT=`) only gives access to local printers running on the host system itself. -- `-v ghostscript-printer-app:/var/lib/ghostscript-printer-app` maps a volume for persistent storage. -- The following volume and device settings are crucial for USB printer access: - - `-v /dev/bus/usb:/dev/bus/usb:ro` mounts the host's USB device directory read-only inside the container for USB printer access. - - `--device-cgroup-rule='c 189:* rmw'` allows the container to read, write, and mknod to USB devices. +Install Podman, then select an explicit release: -### Setting Up and Running ghostscript-printer-app locally - -#### Prerequisites - -**Docker Installed**: Ensure Docker is installed on your system. You can download it from the [official Docker website](https://www.docker.com/get-started) or from the Snap Store: -```sh - sudo snap install docker -``` - -**Rockcraft**: Rockcraft should be installed. You can install Rockcraft using the following command: ```sh - sudo snap install rockcraft --classic -``` - -**Skopeo**: Skopeo should be installed to compile `*.rock` files into Docker images. It comes bundled with Rockcraft, so no separate installation is required. - -#### Step-by-Step Guide - -**Build ghostscript-printer-app rock** - -The first step is to build the Rock from the `rockcraft.yaml`. This image will contain all the configurations and dependencies required to run ghostscript-printer-app. - -Open your terminal and navigate to the directory containing your `rockcraft.yaml`, then run the following command: +version=10.07.1-1 +image="ghcr.io/projectbluefin/ghostscript-printer-app:${version}" +podman pull "$image" +podman volume create ghostscript-printer-app +podman run -d \ + --name ghostscript-printer-app \ + --network host \ + -e PORT=8000 \ + -v ghostscript-printer-app:/var/lib/ghostscript-printer-app:Z,U \ + "$image" +``` + +Open `http://localhost:8000/` and use the web interface to add a printer. +`PORT` is optional; without it, the application selects port 8000 or the next +available port. Host networking is required for local-network printer discovery. +The named volume preserves Printer Application state and user-edited driver +configuration across upgrades. + +For USB printers, add these options to `podman run`: ```sh - rockcraft pack -v +--device /dev/bus/usb --group-add keep-groups ``` -**Compile to Docker Image** +The host user must already have permission to access the printer device. Do not +work around host permissions by running the appliance as root. -Once the rock is built, you need to compile docker image from it. +### Build and verify locally -```sh - sudo rockcraft.skopeo --insecure-policy copy oci-archive: docker-daemon:ghostscript-printer-app:latest -``` +The OCI image is built with BuildStream inside the pinned builder container. +Install Podman and `just`, then run: -Create a Docker volume: ```sh - sudo docker volume create ghostscript-printer-app +just build +just verify ``` -**Run the ghostscript-printer-app Docker Container** - -```sh - sudo docker run -d \ - --name ghostscript-printer-app \ - --network host \ - -e PORT= \ - -v ghostscript-printer-app:/var/lib/ghostscript-printer-app \ - -v /dev/bus/usb:/dev/bus/usb:ro \ - --device-cgroup-rule='c 189:* rmw' \ - ghostscript-printer-app:latest -``` -- `PORT` is an optional environment variable used to start the printer-app on a specified port. If not provided, it will start on the default port 8000 or, if port 8000 is busy, on 8001 and so on. -- **The container must be started in `--network host` mode** to allow the Printer-Application instance inside the container to access and discover printers available in the local network where the host system is in. -- Alternatively using the internal network of the Docker instance (`-p :8000` instead of `--network host -e PORT=`) only gives access to local printers running on the host system itself. -- `-v ghostscript-printer-app:/var/lib/ghostscript-printer-app` maps a volume for persistent storage. -- The following volume and device settings are crucial for USB printer access: - - `-v /dev/bus/usb:/dev/bus/usb:ro` mounts the host's USB device directory read-only inside the container for USB printer access. - - `--device-cgroup-rule='c 189:* rmw'` allows the container to read, write, and mknod to USB devices. +`just build` exports and tags the local image as +`ghcr.io/projectbluefin/ghostscript-printer-app:build`. `just verify` is the +authoritative appliance gate: it checks the BuildStream graph and patch chain, +starts the real image, exercises every driver slice, verifies lifecycle and +persistence behavior, audits the advertised payload and complete ELF closure, +and enforces the uncompressed size ceiling. -#### Setting up +For real hardware, follow the separate +[USB and network printer validation procedure](docs/oci-physical-validation.md). +Synthetic CI results are not physical-printer evidence. -Enter the web interface +### Releases -```sh -http://localhost:/ -``` - -Use the web interface to add a printer. Supply a name, select the -discovered printer, then select make and model. Also set the installed -accessories, loaded media and the option defaults. If the printer is a -PostScript printer, accessory configuration and option defaults can -also often get polled from the printer. - - -## Included Components - - pappl v1.4.10 - - qpdf v11.10.1 - - ghostscript ghostpdl-10.06.0rc1_test001 - - cups v2.4.16 - - libcupsfilters 2.1.1 - - libppd 2.1.1 - - cups-filters 2.0.1 - - pyppd release-1-1-0 - - foomatic-db 20240504 - - hplip debian/3.22.10+dfsg0-8 - - c2050 debian/0.3-7 - - cjet debian/0.8.9-11 - - min12xxw debian/0.0.9-11 - - pnm2ppa debian/1.13-14 - - c2esp debian/27-11 - - dymo-cups-drivers debian/1.4.0-12 - - foo2zjs debian/20200505dfsg0-4 - - fxlinuxprint debian/1.1.0+ds-4 - - m2300w debian/0.51-15 - - printer-driver-oki 1.0.2 - - pxljr debian/1.4+repack0-6 - - rastertosag-gdi debian/0.1-8 - - splix debian/2.0.1-1 - - brlaser v6 - - ptouch-driver debian/1.7-1 - +Maintainers publish by pushing a Git tag exactly matching `v$(cat VERSION)`. +The tag workflow builds and verifies native amd64 and arm64 images, publishes +the matching immutable GHCR multi-architecture index, and verifies its SPDX +SBOM, keyless signatures, GitHub provenance, and OCI metadata. It never +publishes a mutable channel alias. ## BUILDING WITHOUT PACKAGING OR INSTALLATION diff --git a/docs/oci-physical-validation.md b/docs/oci-physical-validation.md index 6c956ab..de5e4d0 100644 --- a/docs/oci-physical-validation.md +++ b/docs/oci-physical-validation.md @@ -10,9 +10,9 @@ Run: just verify ``` -The x86_64 image has a 500 MiB (524,288,000-byte) uncompressed ceiling. The implementation baseline measured 449,525,807 bytes on 2026-09-16. `tests/appliance-parity.sh` measures the local image through Podman and fails above that ceiling. The gate also checks OCI metadata, payload inventory, absence of development content, interpreter policy, and every ELF dependency. +The x86_64 image has a 500 MiB (524,288,000-byte) uncompressed ceiling. The implementation baseline measured 449,525,881 bytes on 2026-09-16. `tests/appliance-parity.sh` measures the local image through Podman and fails above that ceiling. The gate also checks OCI metadata, payload inventory, absence of development content, interpreter policy, and every ELF dependency. -The OCI driver contract is the complete list under [Contained Printer Drivers](../README.md#contained-printer-drivers-in-the-snap), not a sample. Despite the historical heading, the FSDK image must retain every listed Ghostscript/Foomatic driver and every named external driver family. The parity gate requires each legacy Ghostscript name as either a compiled Ghostscript device or an exact Foomatic PPD entry, then separately checks all external driver, filter, backend, and PPD-provider families. +The OCI driver contract is the complete list under [Contained Printer Drivers](../README.md#contained-printer-drivers), not a sample. The FSDK image must retain every listed Ghostscript/Foomatic driver and every named external driver family. The parity gate requires each legacy Ghostscript name as either a compiled Ghostscript device or an exact Foomatic PPD entry, then separately checks all external driver, filter, backend, and PPD-provider families. ## USB printer diff --git a/docs/skills/fsdk-cups-patching.md b/docs/skills/fsdk-cups-patching.md index b608c07..ceb89f1 100644 --- a/docs/skills/fsdk-cups-patching.md +++ b/docs/skills/fsdk-cups-patching.md @@ -23,13 +23,13 @@ metadata: ## Core Process -1. Treat `rockcraft.yaml`, `snap/snapcraft.yaml`, and root `patches/` as the existing behavior contract. +1. Treat `snap/snapcraft.yaml`, the FSDK elements, and root `patches/` as the current behavior contract; consult Git history only when auditing the retired OCI implementation. 2. Keep one CUPS artifact owner. The FSDK junction must continue to own CUPS so its reverse dependencies build against the same libraries. 3. Keep CUPS-only source patches under `patches/cups/`. The `patch_queue` plugin applies every file in its directory, so unrelated patches must stay elsewhere. 4. Stage `patches/cups/` into the FSDK junction with a `local` source. Apply `patches/freedesktop-sdk/` at the junction project level; that project patch injects the nested CUPS source `patch_queue` and adjusts FSDK's CUPS configuration. 5. Do not use `config.overrides` for small CUPS patches or feature switches. BuildStream documents overrides as complete downstream ownership that stops inheriting upstream element updates. 6. Do not stage a second CUPS implementation. Duplicate `libcups.so*` ownership creates an artifact overlap and can compile reverse dependencies against a different library than the application receives. -7. When moving a shared patch, update both Snap and Rock references while Rock remains. Apply patches from the source root when their paths start with `a/backend/` and use `-p1`. +7. Shared CUPS patches remain under `patches/cups/` for both Snap and FSDK. Apply patches from the source root when their paths start with `a/backend/` and use `-p1`. 8. Cross-junction source checkouts nest under `//`; the CUPS probe therefore checks `freedesktop-sdk/components-_private-cups-base/`, not the checkout root. 9. Match FSDK's multiarch install layout for every repository-built library. Define `gcc-triplet`, `lib`, and `libdir` in the root project and pass `--libdir=%{libdir}` to Autotools; FSDK's `pkg-config` searches `/usr/lib//pkgconfig`, not `/usr/lib/pkgconfig`. 10. Do not `chown` high numeric runtime IDs inside the BuildStream sandbox; user-namespace mappings can reject them with `EINVAL`. After composition, reapply writable directory modes in the final OCI layer. Remove inherited `/run` service directories and let the numeric runtime user recreate them so ownership checks observe the actual user. @@ -74,7 +74,7 @@ metadata: - [ ] The graph contains exactly one FSDK private CUPS base. - [ ] The staged CUPS source contains the DNS-SD and `USB_QUIRK_DIR` changes. - [ ] The CUPS base still exposes `cups-libs` and `cups-license`. -- [ ] Both current Snap and Rock CUPS source versions accept the canonical patches while both packaging paths exist. +- [ ] The Snap and FSDK CUPS source versions both accept the canonical patches. - [ ] Repository-built libraries install their `.pc` files in FSDK's multiarch pkg-config directory and are discoverable from a dependent element's build sandbox. - [ ] The exported image runs with the numeric UID/GID, creates runtime directories, and reaches application readiness. - [ ] TERM yields signal exit status `143`, not Podman's SIGKILL timeout status `137`; killing a required child makes the container exit nonzero. diff --git a/docs/superpowers/plans/2026-09-16-fsdk-cutover.md b/docs/superpowers/plans/2026-09-16-fsdk-cutover.md new file mode 100644 index 0000000..b1df2f0 --- /dev/null +++ b/docs/superpowers/plans/2026-09-16-fsdk-cutover.md @@ -0,0 +1,24 @@ +# FSDK OCI Cutover Plan + +**Goal:** Make BuildStream the sole OCI implementation while preserving the independent Snap product. + +**Architecture:** Delete the obsolete Rockcraft manifest and its two service launchers. Keep `snap/`, shared source patches, and Snap automation. Replace the README's Docker Hub, mutable-tag, and Rockcraft instructions with the immutable Project Bluefin GHCR image, BuildStream development commands, numeric-user persistence, host networking, USB requirements, release policy, and physical-validation link. + +## Task 1: Remove the legacy OCI path + +- [x] Delete `rockcraft.yaml`, `scripts/start-server.sh`, and `scripts/run-avahi.sh`. +- [x] Remove the obsolete `*.rock` ignore rule. +- [x] Update FSDK patching guidance to treat the retired OCI path as Git history rather than a live contract. + +## Task 2: Replace operator documentation + +- [x] Document immutable `ghcr.io/projectbluefin/ghostscript-printer-app:` use. +- [x] Document `just build`, `just verify`, host networking, writable persistence, optional `PORT`, and USB access. +- [x] Link physical validation and describe tag-only signed multi-architecture releases. +- [x] Remove Docker Hub, mutable OCI tags, obsolete prerequisites, and the stale component list. + +## Task 3: Verify and publish + +- [ ] Run `just verify`, Snap validation, workflow lint, shell syntax checks, stale-reference searches, and `git diff --check`. +- [x] Review the full diff from `feat/fsdk-dependency-updates` and resolve all blocking findings. +- [ ] Resolve issue 10, commit and push `feat/fsdk-cutover`, and open a stacked PR based on `feat/fsdk-dependency-updates`. diff --git a/rockcraft.yaml b/rockcraft.yaml deleted file mode 100644 index 7d829eb..0000000 --- a/rockcraft.yaml +++ /dev/null @@ -1,1615 +0,0 @@ -name: ghostscript-printer-app -base: ubuntu@22.04 -version: '10.06.0-7' -summary: Ghostscript Printer Application -description: | - The Ghostscript Printer Application is a PAPPL (Printer Application - Framework) based Printer Application to support printers using - Ghostscript's built-in printer drivers (and some extra filters). - -adopt-info: ghostscript - -# Only build on the architectures supported -platforms: - arm64: - amd64: - armhf: - -run-user: _daemon_ - -services: - avahi-daemon: - command: /scripts/run-avahi.sh - override: replace - on-failure: restart - startup: enabled - - ghostscript-printer-app: - command: /scripts/start-server.sh - override: replace - on-failure: shutdown - startup: enabled - after: [avahi-daemon] - -parts: - pappl: - source: https://github.com/michaelrsweet/pappl - source-type: git - source-tag: 'v1.4.10' - source-depth: 1 -# ext:updatesnap -# version-format: -# lower-than: '2' -# no-9x-revisions: true - plugin: autotools - override-build: | - set -eux - # Raise the supported number of vendor-specific options/attributes in - # PAPPL to 256, as the original 32 can be too small for some busy PPD - # files - perl -p -i -e 's/(define\s+PAPPL_MAX_VENDOR\s+)32/\1 256/' pappl/printer.h - # De-activate log-rotating. It does not work with the forked processes - # of the filters - perl -p -i -e 's/(system->logmaxsize\s+=).*/\1 0;/' pappl/system.c - # As we do not use PAPPL's own backends but the CUPS backends using the - # "cups" device scheme of pappl-retrofit, we let the manual "Network - # Printer" device on the "Add Printer" page of the web interface use a - # "cups:socket://..." URI instead of simply "socket://..." - perl -p -i -e 's/(httpAssembleURI\(.*?)"socket"(.*?\))/\1"cups:socket"\2/' pappl/system-webif.c - # PAPPL's build system does not insert the LDFLAGS when linking. - # Patching Makedefs.in to fix this - perl -p -i -e 's/^(\s*DSOFLAGS\s*=\s*\S*\s+)/\1\$\(LDFLAGS\) /' Makedefs.in - craftctl default - autotools-configure-parameters: - - --prefix=/usr - - --enable-libjpeg - - --enable-libpng - - --enable-libusb - - --with-dnssd=avahi - build-packages: - - libavahi-client-dev - - libgnutls28-dev - - libjpeg-dev - - libpam0g-dev - - libpng-dev - - libusb-1.0-0-dev - - zlib1g-dev - - perl-base - stage-packages: - # We have libavahi-client3 already in this Snap via the "cups" part, - # so here we do not stage it again to avoid any file clashes. - #- libavahi-client3 - - libpng16-16 - - libusb-1.0-0 - prime: - - -etc/fonts - - -var - - lib/*/lib*.so* - - usr/lib/lib*.so* - - usr/lib/*/lib*.so* - - -usr/include - - -usr/lib/pkgconfig - - -usr/share/fonts - - -usr/share/man - - -usr/share/doc - - -usr/share/doc-base - - -usr/share/lintian - after: [cups] - - pappl-retrofit: - source: https://github.com/openprinting/pappl-retrofit - source-type: git - # source-tag: '1.0b2' - source-depth: 1 -# ext:updatesnap -# version-format: -# ignore: true -# format: '%V' - plugin: autotools - autotools-configure-parameters: - - --prefix=/usr - # To find the libraries built in this Snap - build-environment: - - LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib" - build-packages: - - autoconf - - automake - - libtool - - autotools-dev - - pkg-config - - perl-base - stage-packages: - - libusb-1.0-0 - organize: - usr/share/legacy-printer-app/testpage.pdf: usr/share/ghostscript-printer-app/testpage.pdf - prime: - - lib/*/lib*.so* - - usr/lib/lib*.so* - - usr/lib/*/lib*.so* - - usr/share/ghostscript-printer-app/testpage.pdf - - -var - - -usr/var - - -usr/bin/legacy-printer-app - - -usr/include - - -usr/lib/pkgconfig - - -usr/lib/legacy-printer-app - - -usr/share/legacy-printer-app - - -usr/share/fonts - - -usr/share/man - - -usr/share/doc - - -usr/share/doc-base - - -usr/share/lintian - after: [cups, pappl, libcupsfilters, libppd] - - qpdf: - source: https://github.com/qpdf/qpdf - source-type: git - source-tag: 'v11.10.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: - - lib/*/lib*.so* - - usr/lib/lib*.so* - - usr/lib/*/lib*.so* - - -etc/fonts - - -var - - -usr/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 - - -usr/lib/libqpdf.la - - -usr/lib/pkgconfig - - ghostscript: - #source: https://git.ghostscript.com/ghostpdl.git - source: https://github.com/ArtifexSoftware/ghostpdl.git - source-type: git - source-tag: 'ghostpdl-10.06.0rc1_test001' - source-depth: 1 -# ext:updatesnap -# version-format: -# format: "ghostpdl-%M.%m.%R" -# lower-than: '11' -# no-9x-revisions: true - plugin: autotools - # As this Printer Application supports Ghostscript's built-in drivers, - # we build them all. - autotools-configure-parameters: - - --prefix=/usr - - --without-x - - --disable-gtk - - --with-drivers=ALL - - --enable-freetype - - --without-tesseract - build-packages: - - curl - stage-packages: - - libpaper1 - - libfontconfig1 - - libfreetype6 - - libpng16-16 - prime: - - usr/bin/gs - - lib/*/lib*.so* - - usr/lib/*/lib*.so* - - usr/share/ghostscript - - -etc/fonts - - -var - - -usr/include - - -usr/lib/pkgconfig - - -usr/share/fonts - - -usr/share/man - - -usr/share/doc - - -usr/share/doc-base - - -usr/share/lintian - after: [cups] - - cups: - source: https://github.com/OpenPrinting/cups - source-type: git - source-tag: 'v2.4.16' - source-depth: 1 -# ext:updatesnap -# version-format: -# lower-than: '3' -# no-9x-revisions: true - plugin: autotools - # We only need libcups (with headers, ...), the rastertoepson, - # rastertohp, and rastertolabel filters (for the PCL-5 PPD files from - # Ricoh and OEM, and for sample.drv PPDs), the backends, and the - # sample.drv file - override-build: | - set -eux - patch -p1 < $CRAFT_PROJECT_DIR/patches/cups/cups-dnssd-backend-socket-only.patch - # Have USB quirk files in user-modifiable space for debugging - patch -p1 < $CRAFT_PROJECT_DIR/patches/cups/cups-usb-quirk-dir.patch - # 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. - ./configure --with-tls=gnutls - cd cups - make - cd .. - cd filter - make rastertoepson - make rastertohp - make rastertolabel - cd .. - cd backend - make snmp dnssd socket ipp ipps lpd usb - cd .. - mkdir -p $CRAFT_PART_INSTALL/usr/lib - cp cups/libcups*.a $CRAFT_PART_INSTALL/usr/lib/ - cp -P cups/libcups*.so* $CRAFT_PART_INSTALL/usr/lib/ - mkdir -p $CRAFT_PART_INSTALL/usr/include/cups - cp cups/*.h $CRAFT_PART_INSTALL/usr/include/cups/ - mkdir -p $CRAFT_PART_INSTALL/usr/bin - cp cups-config $CRAFT_PART_INSTALL/usr/bin/ - mkdir -p $CRAFT_PART_INSTALL/usr/lib/ghostscript-printer-app/filter - cp filter/rastertoepson $CRAFT_PART_INSTALL/usr/lib/ghostscript-printer-app/filter - cp filter/rastertohp $CRAFT_PART_INSTALL/usr/lib/ghostscript-printer-app/filter - cp filter/rastertolabel $CRAFT_PART_INSTALL/usr/lib/ghostscript-printer-app/filter - mkdir -p $CRAFT_PART_INSTALL/usr/lib/ghostscript-printer-app/backend/ - ( cd backend; \ - cp snmp dnssd socket ipp ipps lpd usb org.cups.usb-quirks $CRAFT_PART_INSTALL/usr/lib/ghostscript-printer-app/backend/ \ - ) - cp conf/snmp.conf $CRAFT_PART_INSTALL/usr/lib/ghostscript-printer-app/backend/ - mkdir -p $CRAFT_PART_INSTALL/usr/share/ppd - cp ppdc/sample.drv $CRAFT_PART_INSTALL/usr/share/ppd/cups.drv - build-packages: - - patch - - gettext - - autoconf - - automake - - libtool - - autotools-dev - - pkg-config - - libavahi-client-dev - - libavahi-common-dev - - libavahi-compat-libdnssd-dev - - libdbus-1-dev - - libfontconfig1-dev - - libfreetype6-dev - - libgnutls28-dev - - libjpeg-dev - - libldap2-dev - - libkrb5-dev - - libpam0g-dev - - libpaper-dev - - libpng-dev - - libusb-1.0-0-dev - - perl-base - stage-packages: - - libusb-1.0-0 - - libavahi-common3 - - libavahi-client3 - - libicu70 - prime: - - -etc/fonts - - -var - - -usr/include - - -usr/lib/pkgconfig - - -usr/share/fonts - - -usr/share/man - - -usr/share/doc - - -usr/share/doc-base - - -usr/share/lintian - - lib/*/lib*.so* - - usr/lib/lib*.so* - - usr/lib/*/lib*.so* - - usr/share/ppd/cups.drv - - usr/lib/ghostscript-printer-app/filter/* - - usr/lib/ghostscript-printer-app/backend/* - # Reported unused by snapcraft linter - - -usr/lib/*/libdconf.* - - -usr/lib/*/libicuio.* - - -usr/lib/*/libicutest.* - - -usr/lib/*/libicutu.* - - -usr/lib/*/libicuuc.* - - -usr/lib/*/libicui18n.* - - libcupsfilters: - source: https://github.com/OpenPrinting/libcupsfilters - source-type: git - source-tag: '2.1.1' - source-depth: 1 -# ext:updatesnap -# version-format: -# lower-than: '3' -# no-9x-revisions: true - plugin: autotools - # We only need libcupsfilters itself. so we simply do not prime the - # auxiliary files (/usr/share) - autotools-configure-parameters: - - --prefix=/usr - - --disable-avahi - - --disable-mutool - 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: - # 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 - - -var - - -usr/include - - -usr/lib/pkgconfig - - usr/share/cups - - -usr/share/fonts - - -usr/share/man - - -usr/share/doc - - -usr/share/doc-base - - -usr/share/lintian - - 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.1' - source-depth: 1 -# ext:updatesnap -# version-format: -# lower-than: '3' -# no-9x-revisions: true - plugin: autotools - # We need libppd itself, the PPD compiler ppdc and its auxiliary files - # (/usr/share/ppdc/) - autotools-configure-parameters: - - --prefix=/usr - - --disable-mutool - - --disable-pdftocairo - - --disable-acroread - - --enable-ppdc-utils - # To find the libraries built in this Snap - build-environment: - - LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib" - build-packages: - - gettext - - autoconf - - automake - - autotools-dev - - pkg-config - - g++ - - sharutils - - poppler-utils - prime: - - -etc - - -var - - -usr/bin/ppdc - - -usr/include - - -usr/lib/pkgconfig - - -usr/share/fonts - - -usr/share/man - - -usr/share/doc - - -usr/share/doc-base - - -usr/share/lintian - - lib/*/lib*.so* - - usr/lib/lib*.so* - - usr/lib/*/lib*.so* - - usr/lib/*/nss - - usr/share/ppdc/* - after: [cups, ghostscript, libcupsfilters] - - cups-filters: - source: https://github.com/OpenPrinting/cups-filters - source-type: git - source-tag: '2.0.1' - source-depth: 1 -# ext:updatesnap -# version-format: -# lower-than: '3' -# no-9x-revisions: true - plugin: autotools - # To find the libraries built in this Snap - build-environment: - - LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib" - # We need foomatic-rip (for the Foomatic PPDs for the Ghostscript drivers - # and also for the PCL-XL PPDs from Ricoh and OEM), gstoraster (for SpliX), - # the rastertoepson, rastertopclx (for the included PPD files), and also - # all PPD and *.drv files - override-build: | - set -eux - ./autogen.sh - ./configure --disable-mutool --enable-ppdc-utils - make foomatic-rip - make gstoraster - make pdftops - make rastertoescpx - make rastertopclx - mkdir -p $CRAFT_PART_INSTALL - cp foomatic-rip $CRAFT_PART_INSTALL - cp gstoraster $CRAFT_PART_INSTALL - cp pdftops $CRAFT_PART_INSTALL - cp rastertoescpx $CRAFT_PART_INSTALL - cp rastertopclx $CRAFT_PART_INSTALL - mkdir -p $CRAFT_PART_INSTALL/usr/share/ppdc - cp filter/escp.h filter/pcl.h $CRAFT_PART_INSTALL/usr/share/ppdc/ - # Compile cupsfilters.drv into PPD files - $CRAFT_STAGE/usr/bin/ppdc -I $CRAFT_PART_INSTALL/usr/share/ppdc -I $CRAFT_STAGE/usr/share/ppdc -d ppd drv/cupsfilters.drv - # Remove PPD files which are not useful in the Printer Application - rm -f ppd/test.ppd ppd/test2.ppd ppd/textonly.ppd - # Compress the included PPD files, both ready-made and compiled - cp ppdfiles/*.ppd ppd - pyppd -v -o cups-filters-ppds ppd - rm -rf ppd - mkdir -p $CRAFT_PART_INSTALL/usr/share/ppd - mv cups-filters-ppds $CRAFT_PART_INSTALL/usr/share/ppd - build-packages: - - gettext - - autoconf - - automake - - autotools-dev - - pkg-config - - g++ - - sharutils - - pyppd - stage-packages: - - poppler-utils - organize: - foomatic-rip: usr/lib/ghostscript-printer-app/filter/foomatic-rip - gstoraster: usr/lib/ghostscript-printer-app/filter/gstoraster - pdftops: usr/lib/ghostscript-printer-app/filter/pdftops - rastertoescpx: usr/lib/ghostscript-printer-app/filter/rastertoescpx - rastertopclx: usr/lib/ghostscript-printer-app/filter/rastertopclx - prime: - - -etc/fonts - - -var - - -usr/include - - -usr/lib/pkgconfig - - -usr/share/fonts - - -usr/share/man - - -usr/share/doc - - -usr/share/doc-base - - -usr/share/lintian - - lib/*/lib*.so* - - usr/lib/lib*.so* - - usr/lib/*/lib*.so* - - usr/lib/*/nss - - usr/bin/pdftops - - usr/lib/ghostscript-printer-app - - usr/share/ppd/cups-filters-ppds - - usr/share/ppdc/* - # Reported unused by snapcraft linter - - -usr/lib/*/libcairo.* - - -usr/lib/*/libssl3.* - - -usr/lib/*/libX11.* - - -usr/lib/*/libXau.* - - -usr/lib/*/libXdmcp.* - - -usr/lib/*/libXext.* - - -usr/lib/*/libXrender.* - - -usr/lib/*/libpixman-1.* - - -usr/lib/*/libxcb.* - - -usr/lib/*/libxcb-render.* - - -usr/lib/*/libxcb-shm.* - after: [cups, qpdf, ghostscript, pyppd, libcupsfilters, libppd] - - pyppd: - source: https://github.com/OpenPrinting/pyppd - source-type: git - source-tag: 'release-1-1-0' - source-depth: 1 -# ext:updatesnap -# version-format: -# format: 'release-%M-%m-%R' -# lower-than: '2' -# no-9x-revisions: true - plugin: python - build-packages: - - python3.10 - stage-packages: - - python3.10 - stage: - - -usr/bin/pydoc3.10 - - -usr/lib/python3.10 - override-prime: "" - - foomatic-db: - source: https://github.com/OpenPrinting/foomatic-db - source-type: git - source-tag: '20240504' - source-depth: 1 -# ext:updatesnap -# version-format: -# format: '%V' - plugin: nil - override-build: | - set -eux - ./make_configure - ./configure --disable-ppds-to-cups --disable-gzip-ppds --prefix=/usr --with-drivers=NOOBSOLETES,NOEMPTYCMDLINE - make DESTDIR=`pwd`/../install install - cd ../install - # Remove all PostScript PPDs, these printers are supported by the - # PostScript Printer Application - rm usr/share/foomatic/db/source/PPD/*/*.ppd - rm -rf usr/share/foomatic/db/source/PPD/Kyocera - rm -rf usr/share/foomatic/db/source/PPD/Utax - rm -rf usr/share/foomatic/db/source/PPD/Oce - rm -rf usr/share/foomatic/db/source/PPD/*/PS - # Remove executable bits on the files - find usr/share/foomatic/db -executable -type f -print0 | xargs -0 chmod -x || : - # Remove non-PPD files from the PPD file directories - find usr/share/foomatic/db/source/PPD -type f \! -name '*.ppd' -print0 | xargs -0 rm || : - # Correct common errors in PPD files: "*CloseUI" without ':' and - # "*1284DeviceId" instead of "*1284DeviceID" - for f in `find usr/share/foomatic/db/source/PPD -name '*.ppd'`; do perl -p -i -e 's/^\*CloseUI(\s+)/*CloseUI:\1/' $f; perl -p -i -e 's/\*1284DeviceId/*1284DeviceID/' $f; done - # Remove drivers which need external filters we cannot get hold on - # Note that the "./configure; make install" process of foomatic-db - # already removed driver entries marked obsolete and entries without - # driver command line prototype. - ( cd usr/share/foomatic/db/source/driver; \ - rm bjc800j.xml; \ - rm c2070.xml; \ - rm drv_x125.xml; \ - rm lm1100.xml; \ - rm lpstyl.xml; \ - rm ml85p.xml; \ - rm pbm2l2030.xml; \ - rm pbm2l7k.xml; \ - rm pbm2lwxl.xml; \ - rm pentaxpj.xml; \ - rm ppmtomd.xml; \ - ) - # Pre-build all PPDs from the Foomatic XML data - FOOMATICDB=usr/share/foomatic foomatic-compiledb -j 4 -t ppd -d ppd `ls -1 usr/share/foomatic/db/source/driver/*.xml | perl -p -e 's:^.*db/source/driver/(\S*)\.xml\s*$:\1\n:'` - # Compress the Foomatic PPDs in a self-extracting archive - pyppd -v -o foomatic-ppds ppd - rm -rf ppd - # Compress the manufacturer PPDs in a self-extracting archive - mv usr/share/foomatic/db/source/PPD ppd - pyppd -v -o manufacturer-ppds ppd - build-packages: - - perl-base - - python3 - - xz-utils - - foomatic-db-engine - - python3.10 - - pyppd - stage-packages: - - python3 - - xz-utils - - python3.10 - organize: - foomatic-ppds: usr/share/ppd/foomatic-ppds - manufacturer-ppds: usr/share/ppd/manufacturer-ppds - stage: - - usr/bin - - -usr/bin/py3clean - - -usr/bin/py3compile - - -usr/bin/pydoc3.10 - - usr/share/ppd - prime: - - usr/bin/xz - - -usr/bin/pdb3 - - -usr/bin/pydoc3 - - -usr/bin/pygettext3 - - usr/share/ppd - after: [pyppd] - - hplip: - # We need only the hpijs executable (for the Foomatic PPDs HPIJS is used - # here for non-HP PCL 5c/e printers, works better than Ghostscript's - # built-in drivers - # - # We use the Debian package source instead of the upstream source code - # of HPLIP as the Debian package has ~80 patches fixing bugs which are - # reported upstream but the patches not adopted upstream. - # This way we should have the same user experience in terms of reliability - # and quality as with the Debian package. - # Note that the repository has all patches already applied, so we do - # not need to apply them before building. - # Debian source - source: https://salsa.debian.org/printing-team/hplip.v2.git - source-type: git - source-tag: 'debian/3.22.10+dfsg0-8' -# ext:updatesnap -# version-format: -# format: 'debian/%V' - source-depth: 1 - # Upstream source - #source: https://sourceforge.net/projects/hplip/files/hplip/3.22.10/hplip-3.22.10.tar.gz - plugin: autotools - build-environment: - - PYTHON: python3 - - LD_LIBRARY_PATH: $CRAFT_STAGE/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} - - CUPS_DATADIR: $CRAFT_STAGE/usr/share/cups - - on arm64: - - BUILDARCH: aarch64-unknown-linux-gnu - - else: - - BUILDARCH: $CRAFT_ARCH_TRIPLET - # Paremeter list here only needed for upstream source, but no need to - # comment out for Debian source - autotools-configure-parameters: - - --build=$BUILDARCH - - --prefix=/usr - - --disable-foomatic-rip-hplip-install - - --without-docdir - - --without-htmldir - - --without-hpppddir - - --without-drvdir - - --without-icondir - - --disable-hpcups-install - - --disable-cups-drv-install - - --disable-cups-ppd-install - - --enable-hpijs-install - - --disable-foomatic-drv-install - - --disable-foomatic-ppd-install - - --enable-network-build - - --disable-class-driver - - --disable-scan-build - - --disable-gui-build - - --disable-fax-build - - --disable-qt3 - - --disable-qt4 - - --disable-qt5 - - --disable-policykit - # We need only the hpijs executable - override-build: | - set -eux - # Correct hard-coded /etc/hp/ path in Makefile - perl -p -i -e 's:/etc/hp:/ghostscript-printer-app/current/etc/hp:' Makefile* - # Do the "./configure" (for Debian source) - sh debian/autogen.sh - ./configure \ - --build=$BUILDARCH \ - --prefix=/usr \ - --disable-foomatic-rip-hplip-install \ - --without-docdir \ - --without-htmldir \ - --without-hpppddir \ - --without-drvdir \ - --without-icondir \ - --disable-hpcups-install \ - --disable-cups-drv-install \ - --disable-cups-ppd-install \ - --enable-hpijs-install \ - --disable-foomatic-drv-install \ - --disable-foomatic-ppd-install \ - --enable-network-build \ - --disable-class-driver \ - --disable-scan-build \ - --disable-gui-build \ - --disable-fax-build \ - --disable-qt3 \ - --disable-qt4 \ - --disable-qt5 \ - --disable-policykit - # Following step needed because of the Debian patches (for Debian source) - # Compress various files before building, they are needed for the build, - # and were compressed in the non-repacked upstream tarballs - find . -name '*.ppd' | xargs gzip -f - find data/ -regextype posix-extended -regex '.*\.(ldl|pcl|ps|pdf)' | xargs gzip -f - # Following step needed because of the Debian patches (for Debian source) - # Rebuild the .drv.in files from drv.in.template - python3 ./dat2drv.py - # Correct hard-coded paths in C/C++ source code - # The /etc/... and /usr/... paths in these files do not need to get - # corrected, only the /var/... ones - perl -p -i -e 's:\"/var/lib/hp:\"/var/ghostscript-printer-app/common/var/:' common/utils.[ch] - # Do the "./configure; make; make install" (for upstream source) - # craftctl default - # Do the "make; make install" (for Debian source) - make - make DESTDIR=`pwd`/../install install - # Correct hard-coded paths in hplip.conf - ( cd ../install/ghostscript-printer-app/current/etc/hp; \ - perl -p -i -e 's:/var/:/var/ghostscript-printer-app/common/var/:' hplip.conf; \ - perl -p -i -e 's:/usr/share/:/ghostscript-printer-app/current/usr/share/:' hplip.conf; \ - perl -p -i -e 's:/usr/share/ppd/hplip:/usr/share/ppd:' hplip.conf; \ - perl -p -i -e 's:/usr/share/ppd/HP:/usr/share/ppd:' hplip.conf; \ - perl -p -i -e 's:/usr/lib/cups/:/ghostscript-printer-app/current/usr/lib/ghostscript-printer-app/:' hplip.conf; \ - ) - build-packages: - - ubuntu-dev-tools - - dpkg-dev - - fakeroot - - autoconf - - automake - - gawk - - python3-dev - - libpython3-dev - - fdupes - - libavahi-client-dev - - libavahi-core-dev - - libdbus-1-dev - - libjpeg-dev - - libsnmp-dev - - libssl-dev - - libtool - - libudev-dev - - libusb-1.0-0-dev - - perl-base - - python3 - - xz-utils - - pyppd - - python3-dev - stage-packages: - - libsnmp40 - - python3-dev - - libavahi-client-dev - organize: - ghostscript-printer-app/current/etc/hp/hplip.conf: etc/hp/hplip.conf - prime: - - etc/hp/hplip.conf - - usr/bin/hpijs - - lib/*/lib*.so* - - usr/lib/lib*.so* - - usr/lib/*/lib*.so* - # Reported unused by snapcraft linter - - -usr/lib/libhpipp.* - - -usr/lib/*/libgdbm.* - - -usr/lib/*/libgdbm_compat.* - - -usr/lib/*/libnetsnmpagent.* - - -usr/lib/*/libnetsnmpmibs.* - - -usr/lib/*/libpci* - - -usr/lib/*/libperl.* - - -usr/lib/*/libsensors.* - - -usr/lib/*/libsnmp.* - after: [cups, cups-filters] - - # Unmaintained printer drivers which come as a filter to convert generic - # raster output of GhostScript into the printer's data format. The PPDs - # for these drivers come as part of Foomatic, so we build and install - # only the filters here. - - c2050: - # Upstream source is not available any more, using Debian packaging - # GIT instead - source: https://salsa.debian.org/printing-team/c2050.git - source-type: git - source-tag: 'debian/0.3-7' - source-depth: 1 -# ext:updatesnap -# version-format: -# format: 'debian/%V' - plugin: make - override-build: | - set -eux - make -j2 - mkdir -p $CRAFT_PART_INSTALL/usr/bin - cp c2050 $CRAFT_PART_INSTALL/usr/bin - stage-packages: - - libjbig0 - - libjpeg-turbo8 - - libpng16-16 - - libtiff5 - - libwebp7 - prime: - - usr/bin/c2050 - - lib/*/lib*.so* - - usr/lib/lib*.so* - - usr/lib/*/lib*.so* - - cjet: - # Upstream source is not available any more, using Debian packaging - # GIT instead - source: https://salsa.debian.org/printing-team/cjet.git - source-type: git - source-tag: 'debian/0.8.9-11' - source-depth: 1 -# ext:updatesnap -# version-format: -# format: 'debian/%V' - plugin: make - override-build: | - set -eux - make -j2 - mkdir -p $CRAFT_PART_INSTALL/usr/bin - cp cjet $CRAFT_PART_INSTALL/usr/bin - prime: - - usr/bin/cjet - - min12xxw: - # Upstream source is still available but to include Debian's patches, we - # are using Debian packaging GIT instead - # Original homepage: http://www.hinterbergen.de/mala/min12xxw/ - source: https://salsa.debian.org/printing-team/min12xxw.git - source-type: git - source-tag: debian/0.0.9-11 - source-depth: 1 -# ext:updatesnap -# version-format: -# format: 'debian/%V' - plugin: autotools - autotools-configure-parameters: - - --prefix=/usr - override-build: | - set -eux - # Refresh build system, because of the Debian patches - autoreconf --install - craftctl default - build-packages: - - autoconf - prime: - - usr/bin/min12xxw - - pnm2ppa: - # Upstream source is still available but to include Debian's patches, we - # are using Debian packaging GIT instead - # Original homepage: http://pnm2ppa.sourceforge.net/ - source: https://salsa.debian.org/printing-team/pnm2ppa.git - source-type: git - source-tag: 'debian/1.13-14' - source-depth: 1 -# ext:updatesnap -# version-format: -# format: 'debian/%M.%m-%R' -# lower-than: '2' -# no-9x-revisions: true - plugin: autotools - autotools-configure-parameters: - - --prefix=/usr - - --sysconfdir=/etc - override-build: | - set -eux - # "Unlock" config file - perl -p -i -e 's/^\s*version\s+0\s+/version 710 /' pnm2ppa.conf - # Set config file path (we copy the config file to an editable place - # on server startup) - perl -p -i -e 's:(\s+)SYSCONFDIR "(/pnm2ppa\.):\1"/var/ghostscript-printer-app/common/pnm2ppa\2:' pnm2ppa.h - # Update config.guess/config.sub, pnm2ppa seems to be of pre-arm64 era - cp /usr/share/misc/config.* . - craftctl default - build-packages: - - autotools-dev - prime: - - etc/pnm2ppa.conf - - usr/bin/calibrate_ppa - - usr/bin/pnm2ppa - - # Unmaintained printer drivers which come as complete package of either - # CUPS filter(s) or filters to use together with Ghostscript and - # foomatic-rip and of PPD files or PPD file generators (*.drv files for - # /usr/share/cups/drv or executables for /usr/lib/cups/driver) - - c2esp: - # Upstream source is still available but to include Debian's patches, we - # are using Debian packaging GIT instead - # Original homepage: https://sourceforge.net/projects/cupsdriverkodak/ - source: https://salsa.debian.org/printing-team/c2esp.git - source-type: git - source-tag: debian/27-11 - source-depth: 1 -# ext:updatesnap -# version-format: -# format: 'debian/%M-%m' -# lower-than: '8' -# no-9x-revisions: true - plugin: autotools - autotools-configure-parameters: - - --prefix=/usr - # To find the libraries built in this Snap - build-environment: - - LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib" - override-build: | - set -eux - # In libcupsfilter2 the API for driver-relevant functions has changed - # to introduce log functions. This patch does the needed adaptations - # on the code of c2esp. - patch -p1 < $CRAFT_PROJECT_DIR/patches/c2esp-libcupsfilters2-api.patch - autoreconf --install - craftctl default - perl -p -i -e 's:/usr/lib/cups/filter/::g' */*.drv - mkdir -p $CRAFT_PART_INSTALL/usr/share/ppd - cp */*.drv $CRAFT_PART_INSTALL/usr/share/ppd/ - build-packages: - - autoconf - - automake - organize: - usr/lib/cups/filter: usr/lib/ghostscript-printer-app/filter - prime: - - usr/lib/ghostscript-printer-app/filter/* - - usr/share/ppd/*.drv - after: [cups, libcupsfilters, libppd, cups-filters] - - dymo-cups-drivers: - # Upstream source is still available but to include Debian's patches, we - # are using Debian packaging GIT instead - # Original homepage: - #https://www.dymo-label-printers.co.uk/news/download-dymo-sdk-for-linux.html - source: https://salsa.debian.org/printing-team/dymo-cups-drivers.git - source-type: git - source-tag: debian/1.4.0-12 - source-depth: 1 -# ext:updatesnap -# version-format: -# format: 'debian/%V' - plugin: autotools - autotools-configure-parameters: - - --prefix=/usr - override-build: | - set -eux - autoreconf --install - craftctl default - # Compress the included PPD files - pyppd -v -o dymo-ppds ppd - mkdir -p $CRAFT_PART_INSTALL/usr/share/ppd - mv dymo-ppds $CRAFT_PART_INSTALL/usr/share/ppd - build-packages: - - autoconf - - automake - - pyppd - organize: - usr/lib/cups/filter: usr/lib/ghostscript-printer-app/filter - prime: - - usr/lib/ghostscript-printer-app/filter/* - - usr/share/ppd/dymo-ppds - after: [cups, pyppd] - - foo2zjs: - # Upstream source is not available any more, using Debian packaging - # GIT instead - # We do support color profiles in the sub-directories of - # /var/snap/ghostscript-printer-app/common/foo2zjs but we do not - # support automatic loading of firmware files. For those printers the - # HPLIP Printer Application (with plugin loaded in-app) should be used. - source: https://salsa.debian.org/printing-team/foo2zjs.git - source-type: git - source-tag: 'debian/20200505dfsg0-4' - source-depth: 1 -# ext:updatesnap -# version-format: -# format: 'debian/%V' - plugin: nil - override-build: | - set -eux - cp printer-profile.in printer-profile - # Adjust paths in Makefile - cp Makefile Makefile.orig - perl -p -i -e 's:\$\(PREFIX\)/share/foo2:/var/ghostscript-printer-app/common/foo2zjs/foo2:' Makefile - make all PREFIX=/ghostscript-printer-app/current/usr CUPS_SERVERBIN=$CRAFT_PART_INSTALL/usr/lib/ghostscript-printer-app CUPS_DEVEL=1 CUPS_GOODAPI=1 - cp Makefile.orig Makefile - make install PREFIX=$CRAFT_PART_INSTALL/usr CUPS_SERVERBIN=$CRAFT_PART_INSTALL/usr/lib/ghostscript-printer-app - # Install missing files - mkdir -p $CRAFT_PART_INSTALL/usr/bin/ - cp getweb $CRAFT_PART_INSTALL/usr/bin/ - mkdir -p $CRAFT_PART_INSTALL/usr/lib/ghostscript-printer-app/filter - rm -f $CRAFT_PART_INSTALL/usr/lib/ghostscript-printer-app/filter/command2foo2lava-pjl - cp command2foo2lava-pjl $CRAFT_PART_INSTALL/usr/lib/ghostscript-printer-app/filter - # Adjust the paths to the auxiliary files - perl -p -i -e 's:PREFIX=.*:PREFIX=/ghostscript-printer-app/current/usr:' $CRAFT_PART_INSTALL/usr/bin/*-wrapper - perl -p -i -e 's:\$PREFIX/share/foo2:/var/ghostscript-printer-app/common/foo2zjs/foo2:' $CRAFT_PART_INSTALL/usr/bin/*-wrapper - perl -p -i -e 's:/usr/share/":/var/ghostscript-printer-app/common/foo2zjs/":' $CRAFT_PART_INSTALL/usr/bin/getweb - perl -p -i -e 's:/usr/share/\$FOO:/var/ghostscript-printer-app/common/foo2zjs/\$FOO:' $CRAFT_PART_INSTALL/usr/bin/printer-profile* - # Use $TMPDIR for temporary directory - perl -p -i -e 's:/tmp:\$TMPDIR:' $CRAFT_PART_INSTALL/usr/bin/*-wrapper - # Add "-dNOINTERPOLATE" to the Ghostscript command lines to make - # Ghostscript rendering the pages significantly faster - perl -p -i -e 's/dNOPAUSE/dNOPAUSE -dNOINTERPOLATE/g' $CRAFT_PART_INSTALL/usr/bin/*-wrapper - # Set up the PPD file collection - cp -r PPD ppd - # Remove the PPDs of printers which need their firmware loaded whenever - # they are turned on. User should use the HPLIP Printer Application - # with them - for model in `cat Makefile | grep install-usermap | cut -d j -f 2 | cut -d ' ' -f 1`; do - rm ppd/HP-LaserJet_$model.ppd - done - # Compress the included PPD files - pyppd -v -o foo2zjs-ppds ppd - rm -rf ppd - mkdir -p $CRAFT_PART_INSTALL/usr/share/ppd - mv foo2zjs-ppds $CRAFT_PART_INSTALL/usr/share/ppd - build-packages: - - dc - - pyppd - stage-packages: - - psutils - - bsdutils - - dc - prime: - - usr/bin/* - - usr/lib/ghostscript-printer-app/filter/command2foo2lava-pjl - - usr/share/ppd/foo2zjs-ppds - - usr/share/foo2* - after: [cups, pyppd] - - fxlinuxprint: - # Upstream source is not available any more, using Debian packaging - # GIT instead - # Fuji Xerox probably stopped with this driver as this is a PDF driver - # and nowadays PDF printers use driverless IPP. The driver seems to be - # for the pre-driverless-IPP PDF printers. - source: https://salsa.debian.org/printing-team/fxlinuxprint - source-type: git - source-tag: debian/1.1.0+ds-4 - source-depth: 1 -# ext:updatesnap -# version-format: -# format: 'debian/%V' - plugin: autotools - autotools-configure-parameters: - - --prefix=/usr - override-build: | - set -eux - autoreconf --install - craftctl default - # Compress the included PPD file - pyppd -v -o fxlinuxprint-ppds . - mkdir -p $CRAFT_PART_INSTALL/usr/share/ppd - mv fxlinuxprint-ppds $CRAFT_PART_INSTALL/usr/share/ppd - build-packages: - - autoconf - - automake - - pyppd - organize: - usr/lib/cups/filter: usr/lib/ghostscript-printer-app/filter - prime: - - usr/lib/ghostscript-printer-app/filter/* - - usr/share/ppd/fxlinuxprint-ppds - after: [cups, pyppd] - - m2300w: - # Upstream source is still available but to include Debian's patches, we - # are using Debian packaging GIT instead - # Original homepage: https://sourceforge.net/projects/m2300w/ - # There is a successor (native CUPS!) on - # https://github.com/ondrej-zary/m2x00w-cups - # but as it is a very invasive change we stay with m2300w for the - # 2300w qnd 2400w printers. We have no printers for testing. - # Color profiles in the appropriate sub-directories of - # /var/snap/ghostscript-printer-app/common/m2300w are supported. - source: https://salsa.debian.org/printing-team/m2300w.git - source-type: git - source-tag: debian/0.51-15 - source-depth: 1 -# ext:updatesnap -# version-format: -# format: 'debian/%M.%m-%R' -# lower-than: '1' -# no-9x-revisions: true - plugin: autotools - autotools-configure-parameters: - - --prefix=/usr - override-build: | - set -eux - # Explicitly call "./configure; make; make install" as "make install" - # uses "INSTROOT" instead of "DESTDIR" (and in core20 the "autotools" - # plugin is hardwired to "DESTDIR") - autoreconf --install - ./configure --prefix=/usr - make -j2 - make INSTROOT=$CRAFT_PART_INSTALL install - # Adjust the paths to the auxiliary files - perl -p -i -e 's:PREFIX=.*:PREFIX=/ghostscript-printer-app/current/usr:' $CRAFT_PART_INSTALL/usr/bin/*-wrapper - perl -p -i -e 's:SHARE=.*:SHARE=/var/ghostscript-printer-app/common/m2300w:' $CRAFT_PART_INSTALL/usr/bin/*-wrapper - # Use $TMPDIR for temporary directory - perl -p -i -e 's:/tmp:\$TMPDIR:' $CRAFT_PART_INSTALL/usr/bin/*-wrapper - # Remove unneeded old foomatic-rip file - rm -rf $CRAFT_PART_INSTALL/usr/share/m2300w/0.51/foomatic - # Package the two PPDs and their second version counterpart. - mkdir -p $CRAFT_PART_INSTALL/ppd - for n in 2300 2400; do - mv $CRAFT_PART_INSTALL/usr/share/cups/model/Minolta/magicolor_${n}W-m${n}w.ppd $CRAFT_PART_INSTALL/ppd/Minolta-magicolor_${n}W-m2300w.ppd - # Create copies for "KONICA MINOLTA" manufacturer name - perl -p -e 's/Minolta/KONICA MINOLTA/g' $CRAFT_PART_INSTALL/ppd/Minolta-magicolor_${n}W-m2300w.ppd > $CRAFT_PART_INSTALL/ppd/KONICA_MINOLTA-magicolor_${n}W-m2300w.ppd - # Correct originals for "Minolta" manufacturer name - perl -p -i -e 's/KONICA MINOLTA/Minolta/g' $CRAFT_PART_INSTALL/ppd/Minolta-magicolor_${n}W-m2300w.ppd - done - rm -rf $CRAFT_PART_INSTALL/usr/share/cups - # Compress the PPD files - ( cd $CRAFT_PART_INSTALL - pyppd -v -o m2300w-ppds ppd - rm -rf ppd - mkdir -p $CRAFT_PART_INSTALL/usr/share/ppd - mv m2300w-ppds $CRAFT_PART_INSTALL/usr/share/ppd - ) - build-packages: - - autoconf - - automake - - pyppd - stage-packages: - - psutils - prime: - - usr/bin/* - - usr/share/ppd/m2300w-ppds - - usr/share/m2300w/* - after: [cups, pyppd] - - printer-driver-oki: - # There is no Debian packaging GIT, using "Upstream" GIT from - # Debian maintainer Balint Reczey: - # https://github.com/rbalint/printer-driver-oki - # Original download place at Okidata: - # ftp://ftp2.okidata.com/pub/drivers/linux/ - # Original Debian packaging GIT (server removed): - # git://anonscm.debian.org/collab-maint/printer-driver-oki.git - source: https://github.com/rbalint/printer-driver-oki - source-type: git - source-tag: '1.0.2' - source-depth: 1 -# ext:updatesnap -# version-format: -# lower-than: '2' -# no-9x-revisions: true - plugin: make - make-parameters: - - PREFIX=/usr - - DESTDIR=/ghostscript-printer-app/current - override-build: | - set -eux - # Correct path to CUPS filters - perl -p -i -e 's:/usr/lib/cups/filter:/ghostscript-printer-app/current/usr/lib/ghostscript-printer-app/filter:' filters/* - # Correct path for Ghostscript - perl -p -i -e 's:/usr/bin/gs:/ghostscript-printer-app/current/usr/bin/gs:' filters/* - # Do not overwrite $PATH environment variable - perl -p -i -e 's:^(\s*(export |)PATH):#\1:' filters/* - # Do not set $GSCRIPT_LIB environment variable - perl -p -i -e 's:^(\s*(export |)GSCRIPT_LIB):#\1:' filters/* - # Use $TMPDIR for temporary directory - perl -p -i -e 's:/tmp:\$TMPDIR:' filters/* - # Create filter installation directory - mkdir -p $CRAFT_PART_INSTALL/usr/lib/cups/filter/ - # Correct language in PPD file - perl -p -i -e 's/^(\*LanguageVersion:\s+).*/\1Portuguese/' MFP/OK4X1PSBR.ppd - # Install the files - craftctl default - # Compress the included PPD files - ( cd $CRAFT_PART_INSTALL/usr/share/ppd - ln -s okidata ppd - pyppd -v -o oki-ppds ppd - rm ppd - ) - organize: - usr/lib/cups/filter: usr/lib/ghostscript-printer-app/filter - prime: - - usr/lib/ghostscript-printer-app/filter/* - - usr/share/ppd/oki-ppds - after: [cups, pyppd] - - pxljr: - # Upstream source is still available but to include Debian's patches, we - # are using Debian packaging GIT instead - # Original homepage: http://hp-pxl-jetready.sourceforge.net/ - source: https://salsa.debian.org/printing-team/pxljr.git - source-type: git - source-tag: debian/1.4+repack0-6 - source-depth: 1 -# ext:updatesnap -# version-format: -# format: 'debian/%V' - plugin: autotools - autotools-configure-parameters: - - --prefix=/usr - override-build: | - set -eux - autoreconf --install - craftctl default - # Generate PPD files for the HP LaserJet 3500 and 3600 - mkdir ppd - cp HP-Color_LaserJet_3550-pxljr.ppd ppd - cd ppd - for n in 3500 3600; do - perl -p -e "s:3550(?!\"):${n}:g" HP-Color_LaserJet_3550-pxljr.ppd > HP-Color_LaserJet_${n}-pxljr.ppd - done - # Allow also PDF as input data format - perl -p -i -e 's,^\*cupsFilter:\s*\"application/vnd.cups-postscript\s+0\s+foomatic-rip\",*cupsFilter: "application/vnd.cups-postscript 100 foomatic-rip"\n*cupsFilter: "application/vnd.cups-pdf 0 foomatic-rip",' *.ppd - # Make the page rendering by Ghostscript faster - perl -p -i -e 's,(\-sDEVICE=ijs),-dNOINTERPOLATE \1,' *.ppd - # Compress the PPD files - cd .. - pyppd -v -o pxljr-ppds ppd - rm -rf ppd - mkdir -p $CRAFT_PART_INSTALL/usr/share/ppd - mv pxljr-ppds $CRAFT_PART_INSTALL/usr/share/ppd - build-packages: - - autoconf - - automake - - libijs-dev - - libjpeg-dev - - pyppd - stage-packages: - - libijs-0.35 - organize: - usr/lib/cups/filter: usr/lib/ghostscript-printer-app/filter - prime: - - usr/bin/ijs_pxljr - - usr/lib/*/libijs*.so* - - usr/share/ppd/pxljr-ppds - after: [cups, pyppd] - - rastertosag-gdi: - # Upstream source is still available but to include Debian's patches, we - # are using Debian packaging GIT instead - # Original homepage: https://www.openprinting.org/download/printing/rastertosag-gdi/ - source: https://salsa.debian.org/printing-team/rastertosag-gdi.git - source-type: git - source-tag: debian/0.1-8 - source-depth: 1 -# ext:updatesnap -# version-format: -# format: 'debian/%M.%m-%R' -# lower-than: '1' -# no-9x-revisions: true - plugin: nil - override-build: | - set -eux - # Copy the filter to the right place - mkdir -p $CRAFT_PART_INSTALL/usr/lib/ghostscript-printer-app/filter - cp rastertosag-gdi $CRAFT_PART_INSTALL/usr/lib/ghostscript-printer-app/filter - # Compress the PPD files - pyppd -v -o rastertosag-gdi-ppds ppd - mkdir -p $CRAFT_PART_INSTALL/usr/share/ppd - mv rastertosag-gdi-ppds $CRAFT_PART_INSTALL/usr/share/ppd - prime: - - usr/lib/ghostscript-printer-app/filter/rastertosag-gdi - - usr/share/ppd/rastertosag-gdi-ppds - after: [pyppd] - - splix: - # Upstream source is still available but to include Debian's patches, we - # are using Debian packaging GIT instead - # Original homepage: http://splix.ap2c.org/, - # https://sourceforge.net/projects/splix/ - source: https://salsa.debian.org/printing-team/splix.git - source-type: git - source-tag: 'debian/2.0.1-1' - source-depth: 1 -# ext:updatesnap -# version-format: -# format: 'debian/%V' - plugin: nil - override-build: | - set -eux - make V=1 rastertoqpdl_LIBS="-lcupsimage -lcups -lpthread -ljbig -L$CRAFT_STAGE/usr/lib/" pstoqpdl_LIBS="-lcupsimage -lcups -ljbig -L$CRAFT_STAGE/usr/lib/" CUPSFILTER="/ghostscript-printer-app/current/usr/lib/ghostscript-printer-app/filter" - # Copy the filters to the right place - mkdir -p $CRAFT_PART_INSTALL/usr/lib/ghostscript-printer-app/filter - cp optimized/*toqpdl $CRAFT_PART_INSTALL/usr/lib/ghostscript-printer-app/filter - # Compress the PPD files - cp *.ppd ppd - pyppd -v -o splix-ppds ppd - mkdir -p $CRAFT_PART_INSTALL/usr/share/ppd - mv splix-ppds $CRAFT_PART_INSTALL/usr/share/ppd - build-packages: - - libjbig-dev - - pyppd - stage-packages: - - libjbig0 - prime: - - usr/lib/ghostscript-printer-app/filter/pstoqpdl - - usr/lib/ghostscript-printer-app/filter/rastertoqpdl - - usr/lib/*/libjbig*.so* - - usr/share/ppd/splix-ppds - after: [cups, pyppd] - - # Maintained(?) printer drivers which come as complete package of either - # CUPS filter(s) or filters to use together with Ghostscript and - # foomatic-rip and of PPD files or PPD file generators (*.drv files for - # /usr/share/cups/drv or executables for /usr/lib/cups/driver) - - brlaser: - # Upstream source GIT is ahead of the release version 6 Debian uses - # and Debian does not apply any patch, so we use the current upstream - # GIT master here. - # Debian GIT: https://salsa.debian.org/printing-team/brlaser.git - source: https://github.com/pdewacht/brlaser.git - source-type: git - source-tag: 'v6' - source-depth: 1 -# ext:updatesnap -# version-format: -# format: 'v%V' - plugin: cmake - cmake-parameters: - - -DCMAKE_INSTALL_PREFIX=/usr - override-build: | - set -eux - craftctl default - mkdir -p $CRAFT_PART_INSTALL/usr/share/ppd - cp *.drv $CRAFT_PART_INSTALL/usr/share/ppd - organize: - usr/lib/cups/filter: usr/lib/ghostscript-printer-app/filter - prime: - - usr/lib/ghostscript-printer-app/filter/rastertobrlaser - - usr/share/ppd/*.drv - after: [cups, cups-filters] - - ptouch-driver: - # Github source: https://github.com/philpem/printer-driver-ptouch.git - source: https://salsa.debian.org/printing-team/ptouch-driver.git - source-type: git - source-tag: 'debian/1.7-1' - source-depth: 1 -# ext:updatesnap -# version-format: -# format: 'debian/%M.%m-%R' -# lower-than: '2' -# no-9x-revisions: true - plugin: autotools - autotools-configure-parameters: - - --prefix=/usr - override-build: | - set -eux - autoreconf --install - craftctl default - # Generate PPDs files from Foomatic data - mkdir foomatic-db - cp -r $CRAFT_PART_INSTALL/usr/share/foomatic/* foomatic-db/ - echo '#' > foomatic-db/db/oldprinterids - rm -rf $CRAFT_PART_INSTALL/usr/share/foomatic - FOOMATICDB=foomatic-db foomatic-compiledb -j 2 -t ppd -d ppd `ls -1 foomatic-db/db/source/driver/*ptouch*.xml | perl -p -e 's:^.*db/source/driver/(\S*)\.xml\s*$:\1\n:'` - rm -rf foomatic-db - pyppd -v -o ptouch-ppds ppd - rm -rf ppd - mkdir -p $CRAFT_PART_INSTALL/usr/share/ppd - mv ptouch-ppds $CRAFT_PART_INSTALL/usr/share/ppd - build-packages: - - autoconf - - automake - - foomatic-db-engine - - libxml-libxml-perl - - pyppd - organize: - usr/lib/cups/filter: usr/lib/ghostscript-printer-app/filter - prime: - - usr/lib/ghostscript-printer-app/filter/rastertoptch - - usr/share/ppd/ptouch-ppds - after: [cups, pyppd] - - ghostscript-printer-app: - plugin: make - source: . - make-parameters: - - LDFLAGS="$LDFLAGS -ljpeg" - - VERSION="$VERSION" - - SNAP=1 - # To find the libraries built in this Snap - build-environment: - - LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib" - # To improve convenience for developers (and everyone who wants to - # build from source), we do a "make clean" before "make" here, - # because if we had done "make" off-Snap, directly in the source - # tree and afterwards build the Snap with snapcraft, the build - # sucks in our local binary of ghostscript-printer-app instead of - # compiling its own one in the Snap harness with the appropriate - # libraries, ending up with the Snap containing an executable - # which does not work inside the Snap. The "make clean" removes - # any accidentally grabbed binary. - # - # We need to directly call the "make" and "make install" commands - # here as we cannot inject an environment variable into the default - # build process ("craftctl default") and we also cannot call - # "craftctl get version" in the lines of "make-parameters:" or - # "build-environment:". This way we get the version number of our - # Snap (which is extracted from the Ghostscript upstream source) - # inyo the ghostscript-printer-app executable. - override-build: | - set -eux - make clean - VERSION="`craftctl get version`" - make -j"8" LDFLAGS="$LDFLAGS -ljpeg" SNAP=1 VERSION="$VERSION" - make -j"8" install LDFLAGS="$LDFLAGS -ljpeg" SNAP=1 VERSION="$VERSION" DESTDIR="$CRAFT_PART_INSTALL" - #craftctl default - build-packages: - - libusb-1.0-0-dev - stage-packages: - - libusb-1.0-0 - - libjbig0 - - liblcms2-2 - - libtiff5 - - libwebp7 - stage: - - -usr/lib/ghostscript-printer-app - prime: - - usr/bin/ghostscript-printer-app - - lib/*/lib*.so* - - usr/lib/*/lib*.so* - - usr/share/ghostscript-printer-app - - -var - - -usr/share/man - after: [avahi, pappl-retrofit, pappl, ghostscript, libcupsfilters, libppd, cups-filters, foomatic-db] - - avahi: - plugin: autotools - source: https://github.com/avahi/avahi.git - source-type: git - autotools-configure-parameters: - - --prefix=/usr - - --disable-qt3 - - --disable-qt4 - - --disable-qt5 - - --disable-gtk - - --disable-gtk3 - - --disable-gdbm - - --disable-python - - --disable-pygtk - - --disable-python-dbus - - --disable-mono - - --disable-monodoc - - --disable-manpages - - --disable-xmltoman - - --with-avahi-user=_daemon_ - - --with-avahi-group=_daemon_ - # - --with-avahi-priv-access-group=netdev - # - --with-distro=debian - - --disable-gobject - - --datadir=/usr/share - - --libdir=/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR} - - --with-systemdsystemunitdir=/usr/lib/systemd/system - - --localstatedir=/var - - --sysconfdir=/etc - build-packages: - - g++ - - gcc - - gettext - - intltool - - libdaemon-dev - - libdbus-1-dev - - libevent-dev - - libexpat1-dev - - libglib2.0-dev - - libsystemd-dev - - xmltoman - override-build: | - craftctl default - # for reference sort systemd service files - sed -i \ - -e 's|\(.*\)avahi-daemon -s.*|\1avahi-daemon -s --no-drop-root|g' \ - -e 's|\(.*\)avahi-daemon -r.*|\1avahi-daemon -r --no-drop-root|g' \ - ${CRAFT_PART_INSTALL}/usr/lib/systemd/system/avahi-daemon.service - mkdir -p \ - ${CRAFT_PART_INSTALL}/usr/lib/systemd/system/multi-user.target.wants - ln -sf \ - ../avahi-daemon.service \ - ${CRAFT_PART_INSTALL}/usr/lib/systemd/system/multi-user.target.wants/avahi-daemon.service - build-environment: - - LD_LIBRARY_PATH: "${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$CRAFT_STAGE/usr/lib" - override-prime: | - set -eux - craftctl default - sed -i 's/use-ipv6=yes/use-ipv6=no/' ${CRAFT_PRIME}/etc/avahi/avahi-daemon.conf - sed -i 's|messagebus|_daemon_|; //,/<\/policy>/d' $CRAFT_PRIME/usr/share/dbus-1/system.conf - sed -i 's///g; s///g' $CRAFT_PRIME/usr/share/dbus-1/system.d/avahi-dbus.conf - stage-packages: - - libdaemon0 - - libevent-2.1-7 - - avahi-utils - - mdns-scan - # - libavahi-client3 - # - libavahi-common3 - stage: - - etc/avahi - - usr - - -usr/lib/**/libavahi-client.a - - -usr/lib/**/libavahi-common.a - - -usr/lib/**/libavahi-client.so* - - -usr/lib/**/libavahi-common.so* - - -usr/lib/**/*.acd - - -usr/lib/**/*.la - - -usr/lib/**/avahi - - -usr/lib/**/libavahi-glib* - - -usr/lib/**/libavahi-libevent* - - -usr/lib/**/libevent-* - # - -usr/lib/**/libnss_mdns* - - -usr/lib/**/pkgconfig - - -usr/include - - -usr/share/doc - - -usr/share/man - - -usr/share/locale - after: [pappl-retrofit, pappl, ghostscript, libcupsfilters, libppd, cups-filters, foomatic-db] - - utils: - plugin: nil - overlay-packages: - - python3 - - dbus - - libnss-mdns - override-prime: | - set -eux - craftctl default - - # Set up Avahi Daemon runtime directory - mkdir -p "$CRAFT_PRIME/var/run/avahi-daemon" - chown 584792:584792 "$CRAFT_PRIME/var/run/avahi-daemon" - chmod 777 "$CRAFT_PRIME/var/run/avahi-daemon" - - # Set up D-Bus runtime directory - mkdir -p "$CRAFT_PRIME/var/run/dbus" - chown 584792:584792 "$CRAFT_PRIME/var/run/dbus" - chmod 777 "$CRAFT_PRIME/var/run/dbus" - - # Set up the CUPS SSL server root directory - CUPS_SERVERROOT="$CRAFT_PRIME/etc/cups/ssl" - mkdir -p "$CUPS_SERVERROOT" - chown 584792:584792 "$CUPS_SERVERROOT" - chmod 770 "$CUPS_SERVERROOT" - - # Set up the state directory and file for the printer app - STATE_DIR="$CRAFT_PRIME/var/lib/ghostscript-printer-app" - mkdir -p "$STATE_DIR" - chown 584792:584792 "$STATE_DIR" - chmod 770 "$STATE_DIR" - - # Create a state file inside the state directory - STATE_FILE="$STATE_DIR/ghostscript-printer-app.state" - touch "$STATE_FILE" - chown 584792:584792 "$STATE_FILE" - chmod 644 "$STATE_FILE" - - # Ensure the spool directory is owned properly - SPOOL_DIR="$CRAFT_PRIME/var/spool/ghostscript-printer-app" - mkdir -p "$SPOOL_DIR" - chown 584792:584792 "$SPOOL_DIR" - chmod 770 "$SPOOL_DIR" - - # Create and set permissions for the application log file - touch $CRAFT_PRIME/ghostscript-printer-app.log - chown 584792:584792 $CRAFT_PRIME/ghostscript-printer-app.log - chmod 644 $CRAFT_PRIME/ghostscript-printer-app.log - - # Setting up permissions to USB backend - USB_BACKEND="$CRAFT_PRIME/usr/lib/ghostscript-printer-app/backend/usb" - chmod u+s "$USB_BACKEND" - after: [ghostscript-printer-app, avahi, pappl-retrofit, pappl, ghostscript, libcupsfilters, libppd, cups-filters, foomatic-db] - - scripts: - plugin: dump - source: scripts/ - organize: - start-server.sh: /scripts/start-server.sh - run-avahi.sh: /scripts/run-avahi.sh - override-prime: | - set -eux - craftctl default - chmod +x $CRAFT_PRIME/scripts/* diff --git a/scripts/run-avahi.sh b/scripts/run-avahi.sh deleted file mode 100644 index 5f3d854..0000000 --- a/scripts/run-avahi.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -set -eux - -# Start dbus-daemon in the background -/usr/bin/dbus-daemon --system --nofork & - -# Wait for the D-Bus system bus to be ready -while [ ! -e /var/run/dbus/system_bus_socket ]; do - echo "Waiting for dbus-daemon to initialize..." - sleep 1 -done - -# Start avahi-daemon after dbus-daemon is ready -/usr/sbin/avahi-daemon -f /etc/avahi/avahi-daemon.conf --no-drop-root --debug - -# Keep the container running -exec tail -f /dev/null diff --git a/scripts/start-server.sh b/scripts/start-server.sh deleted file mode 100644 index e583a1a..0000000 --- a/scripts/start-server.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -set -eux - -# Precheck: Ensure PORT is a number or undefined -if [ -n "${PORT:-}" ]; then - if ! echo "$PORT" | grep -Eq '^[0-9]+$'; then - echo "Error: PORT must be a valid number" >&2 - exit 1 - fi -fi - -# Wait for avahi-daemon to initialize -while true; do - if [ -f "/var/run/avahi-daemon/pid" ] || [ -f "/run/avahi-daemon/pid" ]; then - echo "avahi-daemon is active. Starting ps-printer-app..." - break - fi - - echo "Waiting for avahi-daemon to initialize..." - sleep 1 -done - -# Start the ghostscript-printer-app server -ghostscript-printer-app -o log-file="/ghostscript-printer-app.log" ${PORT:+-o server-port="$PORT"} server diff --git a/scripts/update-fsdk-sources.py b/scripts/update-fsdk-sources.py index 41b0153..0741700 100755 --- a/scripts/update-fsdk-sources.py +++ b/scripts/update-fsdk-sources.py @@ -17,6 +17,7 @@ OCI_ELEMENT = ELEMENTS / "oci" / "ghostscript-printer-app.bst" PLUGIN_ELEMENT = ELEMENTS / "plugins" / "buildstream-plugins-community.bst" VERSION_FILE = ROOT / "VERSION" +README_FILE = ROOT / "README.md" SOURCE_KIND = re.compile(r"^\s*-\s+kind:\s+(git_repo|cpan|tar)$", re.MULTILINE) FSDK_REF = re.compile(r"^\s*ref: freedesktop-sdk-(.+?)-0-g([0-9a-f]{40})$", re.MULTILINE) GHOSTSCRIPT_REF = re.compile(r"^\s*ref: (ghostpdl-(.+?)-\d+-g[0-9a-f]{40})$", re.MULTILINE) @@ -94,9 +95,11 @@ def sync_fsdk_metadata() -> None: match = re.fullmatch(r".+-([0-9]+)", current_version) if match is None: raise RuntimeError("VERSION must end in a numeric packaging revision") - VERSION_FILE.write_text(f"{ghostscript_version}-{match.group(1)}\n") + application_version = f"{ghostscript_version}-{match.group(1)}" + VERSION_FILE.write_text(f"{application_version}\n") replace_one(IJS_ELEMENT, r"^\s*track: ghostpdl-.*$", f" track: ghostpdl-{ghostscript_version}") replace_one(IJS_ELEMENT, r"^\s*ref: (?:ghostpdl-)?[^\s]+$", f" ref: {ghostscript_ref}") + replace_one(README_FILE, r"^version=[^\s]+$", f"version={application_version}") replace_one( OCI_ELEMENT, r"^(\s*'io\.projectbluefin\.fsdk\.version': )'[^']+'$", @@ -145,7 +148,7 @@ def main() -> None: parser.add_argument("--update", action="store_true", help="track sources and synchronize metadata") args = parser.parse_args() if args.update: - paths = [VERSION_FILE, *ELEMENTS.rglob("*.bst")] + paths = [VERSION_FILE, README_FILE, *ELEMENTS.rglob("*.bst")] original = {path: path.read_bytes() for path in paths} try: refresh_plugin_tarball() From 3ca2897813c8bed7413cc4855b6319b8c45f7140 Mon Sep 17 00:00:00 2001 From: castrojo Date: Wed, 16 Sep 2026 13:54:35 -0400 Subject: [PATCH 2/9] fix: harden FSDK runtime and release gates Assisted-by: GitHub Copilot GPT-5.6 via pi --- .gitignore | 1 + README.md | 2 +- docs/oci-physical-validation.md | 2 +- elements/oci/ghostscript-printer-app.bst | 2 +- elements/printer-app/hpijs.bst | 3 +- files/container-entrypoint.sh | 4 +-- tests/appliance-parity.sh | 15 ++++----- tests/core-appliance.sh | 4 --- tests/core-payload.sh | 4 --- tests/packaged-drivers.sh | 4 --- tests/standalone-raster-drivers.sh | 4 --- tests/stateful-drivers.sh | 40 ++++++++++++++++++++---- 12 files changed, 49 insertions(+), 36 deletions(-) diff --git a/.gitignore b/.gitignore index 06a921f..8929d43 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.snap +*.spdx.json .DS_Store .scratch/ .worktrees/ diff --git a/README.md b/README.md index 6efb516..abff13b 100644 --- a/README.md +++ b/README.md @@ -348,7 +348,7 @@ there is no `latest`, `edge`, or `stable` OCI tag. ### Run the published image -Install Podman, then select an explicit release: +Install Podman with a working rootless user namespace, then select an explicit release: ```sh version=10.07.1-1 diff --git a/docs/oci-physical-validation.md b/docs/oci-physical-validation.md index de5e4d0..b1606c9 100644 --- a/docs/oci-physical-validation.md +++ b/docs/oci-physical-validation.md @@ -10,7 +10,7 @@ Run: just verify ``` -The x86_64 image has a 500 MiB (524,288,000-byte) uncompressed ceiling. The implementation baseline measured 449,525,881 bytes on 2026-09-16. `tests/appliance-parity.sh` measures the local image through Podman and fails above that ceiling. The gate also checks OCI metadata, payload inventory, absence of development content, interpreter policy, and every ELF dependency. +The x86_64 image has a 500 MiB (524,288,000-byte) uncompressed ceiling. The implementation baseline measured 444,975,225 bytes on 2026-09-16. `tests/appliance-parity.sh` measures the local image through Podman and fails above that ceiling. The gate also checks OCI metadata, payload inventory, absence of development content, interpreter policy, and every ELF dependency. The OCI driver contract is the complete list under [Contained Printer Drivers](../README.md#contained-printer-drivers), not a sample. The FSDK image must retain every listed Ghostscript/Foomatic driver and every named external driver family. The parity gate requires each legacy Ghostscript name as either a compiled Ghostscript device or an exact Foomatic PPD entry, then separately checks all external driver, filter, backend, and PPD-provider families. diff --git a/elements/oci/ghostscript-printer-app.bst b/elements/oci/ghostscript-printer-app.bst index 9d99222..b6e97d2 100644 --- a/elements/oci/ghostscript-printer-app.bst +++ b/elements/oci/ghostscript-printer-app.bst @@ -26,7 +26,7 @@ config: 'nonroot:x:65532:' \ >> /layer/etc/group rm -rf /layer/run/dbus /layer/run/avahi-daemon /layer/run/ghostscript-printer-app - rm -rf /layer/usr/lib/debug + rm -rf /layer/usr/lib/debug /layer/usr/share/cups/ipptool rm -f /layer/usr/bin/cupsd /layer/usr/bin/ippeveprinter chmod 0777 /layer/run install -d -m 1777 /layer/tmp diff --git a/elements/printer-app/hpijs.bst b/elements/printer-app/hpijs.bst index b93cf70..8c14455 100644 --- a/elements/printer-app/hpijs.bst +++ b/elements/printer-app/hpijs.bst @@ -50,7 +50,7 @@ config: - make -j2 hpijs - | sed -i \ - -e 's|^home=.*|home=/usr/share/hplip|' \ + -e 's|^home=.*|home=/var/lib/ghostscript-printer-app/hplip|' \ -e 's|^run=.*|run=/var/lib/ghostscript-printer-app/hplip/run|' \ -e 's|^ppd=.*|ppd=/usr/share/ppd|' \ -e 's|^ppdbase=.*|ppdbase=/usr/share/ppd|' \ @@ -59,6 +59,5 @@ config: hplip.conf install-commands: - install -D -m 0755 hpijs "%{install-root}/usr/bin/hpijs" - - install -d "%{install-root}/usr/share/hplip" - install -D -m 0644 hplip.conf "%{install-root}/usr/share/ghostscript-printer-app/defaults/hplip/hplip.conf" - mkdir -p "%{install-root}/etc/hp" && ln -s /var/lib/ghostscript-printer-app/hplip/hplip.conf "%{install-root}/etc/hp/hplip.conf" diff --git a/files/container-entrypoint.sh b/files/container-entrypoint.sh index c30addc..14bc34d 100755 --- a/files/container-entrypoint.sh +++ b/files/container-entrypoint.sh @@ -17,8 +17,8 @@ fi if [[ ! -e "$state_dir/hplip/hplip.conf" ]]; then cp /usr/share/ghostscript-printer-app/defaults/hplip/hplip.conf "$state_dir/hplip/hplip.conf" fi -cp -a --no-clobber /usr/share/ghostscript-printer-app/defaults/foo2zjs/. "$state_dir/foo2zjs/" -cp -a --no-clobber /usr/share/ghostscript-printer-app/defaults/m2300w/. "$state_dir/m2300w/" +cp -a --update=none /usr/share/ghostscript-printer-app/defaults/foo2zjs/. "$state_dir/foo2zjs/" +cp -a --update=none /usr/share/ghostscript-printer-app/defaults/m2300w/. "$state_dir/m2300w/" export BACKEND_DIR=/usr/lib/ghostscript-printer-app/backend export CUPS_SERVERBIN=/usr/lib/ghostscript-printer-app diff --git a/tests/appliance-parity.sh b/tests/appliance-parity.sh index de81d80..24f7d0b 100755 --- a/tests/appliance-parity.sh +++ b/tests/appliance-parity.sh @@ -1,10 +1,6 @@ #!/usr/bin/env bash set -euo pipefail -podman_binary="$(command -v podman)" -if ! "$podman_binary" info >/dev/null 2>&1; then - podman() { sudo "$podman_binary" "$@"; } -fi image="ghcr.io/projectbluefin/ghostscript-printer-app:build" size_limit_bytes="${IMAGE_SIZE_LIMIT_BYTES:-524288000}" @@ -134,13 +130,18 @@ podman run --rm --user 0:0 --entrypoint /usr/bin/bash \ provider_contains /usr/share/ppd/splix-ppds Samsung provider_contains /usr/share/cups/drv/sample.drv Intellitech provider_contains /usr/share/cups/drv/sample.drv Zebra + provider_contains /usr/share/ppd/foomatic-ppds Epson + provider_contains /usr/share/ppd/foomatic-ppds "HP DesignJet" devices=" $(gs -h 2>&1 | tr "\n" " ") " foomatic_entries="$(/usr/share/ppd/foomatic-ppds list)" read -r -a ghostscript_drivers <<< "$ADVERTISED_GHOSTSCRIPT_DRIVERS" - ((${#ghostscript_drivers[@]} > 0)) + ((${#ghostscript_drivers[@]} >= 90)) || { + printf "FAIL: README exposed only %s Ghostscript drivers; expected at least 90\n" "${#ghostscript_drivers[@]}" >&2 + exit 1 + } for driver in "${ghostscript_drivers[@]}"; do - if [[ "$devices" != *" $driver "* && "$foomatic_entries" != *"-$driver.ppd\""* ]]; then + if [[ "$devices" != *" $driver "* && "$foomatic_entries" != *"Foomatic/$driver "* && "$foomatic_entries" != *"Foomatic/$driver\""* ]]; then printf "FAIL: advertised Ghostscript driver %s has no device or PPD entry\n" "$driver" >&2 exit 1 fi @@ -177,7 +178,7 @@ for root, dirs, files in os.walk("/"): forbidden.append(os.path.join(root, directory)) for name in files: path = os.path.join(root, name) - if name.endswith((".a", ".la")): + if name.endswith((".a", ".la", ".test")): forbidden.append(path) if os.path.islink(path): continue diff --git a/tests/core-appliance.sh b/tests/core-appliance.sh index 4b63fda..2b2e01c 100755 --- a/tests/core-appliance.sh +++ b/tests/core-appliance.sh @@ -1,10 +1,6 @@ #!/usr/bin/env bash set -euo pipefail -podman_binary="$(command -v podman)" -if ! "$podman_binary" info >/dev/null 2>&1; then - podman() { sudo "$podman_binary" "$@"; } -fi image="ghcr.io/projectbluefin/ghostscript-printer-app:build" name="ghostscript-printer-app-smoke" diff --git a/tests/core-payload.sh b/tests/core-payload.sh index 961a5a5..04b7355 100755 --- a/tests/core-payload.sh +++ b/tests/core-payload.sh @@ -1,10 +1,6 @@ #!/usr/bin/env bash set -euo pipefail -podman_binary="$(command -v podman)" -if ! "$podman_binary" info >/dev/null 2>&1; then - podman() { sudo "$podman_binary" "$@"; } -fi image="ghcr.io/projectbluefin/ghostscript-printer-app:build" name="ghostscript-printer-app-payload" diff --git a/tests/packaged-drivers.sh b/tests/packaged-drivers.sh index 17cd87f..3999268 100755 --- a/tests/packaged-drivers.sh +++ b/tests/packaged-drivers.sh @@ -1,10 +1,6 @@ #!/usr/bin/env bash set -euo pipefail -podman_binary="$(command -v podman)" -if ! "$podman_binary" info >/dev/null 2>&1; then - podman() { sudo "$podman_binary" "$@"; } -fi image="ghcr.io/projectbluefin/ghostscript-printer-app:build" name="ghostscript-printer-app-packaged-drivers" diff --git a/tests/standalone-raster-drivers.sh b/tests/standalone-raster-drivers.sh index 11afa01..43cb374 100755 --- a/tests/standalone-raster-drivers.sh +++ b/tests/standalone-raster-drivers.sh @@ -1,10 +1,6 @@ #!/usr/bin/env bash set -euo pipefail -podman_binary="$(command -v podman)" -if ! "$podman_binary" info >/dev/null 2>&1; then - podman() { sudo "$podman_binary" "$@"; } -fi image="ghcr.io/projectbluefin/ghostscript-printer-app:build" name="ghostscript-printer-app-raster-drivers" diff --git a/tests/stateful-drivers.sh b/tests/stateful-drivers.sh index 6e355ac..86d8fe5 100755 --- a/tests/stateful-drivers.sh +++ b/tests/stateful-drivers.sh @@ -1,10 +1,6 @@ #!/usr/bin/env bash set -euo pipefail -podman_binary="$(command -v podman)" -if ! "$podman_binary" info >/dev/null 2>&1; then - podman() { sudo "$podman_binary" "$@"; } -fi image="ghcr.io/projectbluefin/ghostscript-printer-app:build" name="ghostscript-printer-app-stateful-drivers" @@ -12,8 +8,21 @@ port="${PORT:-18040}" state_dir="$(mktemp -d)" cleanup() { + local status=$? + trap - EXIT + if ((status != 0)) && podman container exists "$name"; then + podman exec "$name" /usr/bin/bash -c ' + for log in /tmp/stateful-drivers/*.log /tmp/m2300w.log; do + [[ -f "$log" ]] || continue + printf "==> %s\n" "$log" >&2 + cat "$log" >&2 + done + ' || true + podman logs "$name" >&2 || true + fi podman rm -f "$name" >/dev/null 2>&1 || true podman unshare rm -rf "$state_dir" + exit "$status" } trap cleanup EXIT @@ -65,7 +74,6 @@ wait_for_http podman exec "$name" /usr/bin/bash -c ' set -euo pipefail export PATH=/usr/lib/cups/filter:/usr/bin:/bin - export TMPDIR=/tmp state=/var/lib/ghostscript-printer-app work=/tmp/stateful-drivers mkdir -p "$work" @@ -150,6 +158,17 @@ podman exec "$name" /usr/bin/bash -c ' (("$(stat -c %s "$work/foo2zjs-first.prn")" > 500)) printf "OK: foo2zjs profile-backed conversion\n" + for suffix in first second; do + foo2oak-wrapper "$work/page.ps" > "$work/foo2oak-$suffix.prn" 2> "$work/foo2oak-$suffix.log" + foo2hiperc-wrapper "$work/page.ps" > "$work/foo2hiperc-$suffix.prn" 2> "$work/foo2hiperc-$suffix.log" + done + assert_repeatable "$work/foo2oak-first.prn" "$work/foo2oak-second.prn" + [[ "$(od -An -tx1 -N 4 "$work/foo2oak-first.prn")" == " 4f 41 4b 54" ]] + (("$(stat -c %s "$work/foo2oak-first.prn")" > 1000)) + assert_repeatable "$work/foo2hiperc-first.prn" "$work/foo2hiperc-second.prn" + [[ "$(od -An -tx1 -N 8 "$work/foo2hiperc-first.prn")" == " 1b 25 2d 31 32 33 34 35" ]] + (("$(stat -c %s "$work/foo2hiperc-first.prn")" > 1000)) + for suffix in first second; do m2300w-wrapper "$work/page.ps" \ > "$work/m2300w-$suffix.prn" 2> "$work/m2300w-$suffix.log" @@ -157,8 +176,17 @@ podman exec "$name" /usr/bin/bash -c ' assert_repeatable "$work/m2300w-first.prn" "$work/m2300w-second.prn" [[ "$(od -An -tx1 -N 4 "$work/m2300w-first.prn")" == " 1b 40 00 02" ]] (("$(stat -c %s "$work/m2300w-first.prn")" > 1000)) + psnup -d2 -2 -m.2in -q < "$work/page.ps" > "$work/psnup.ps" 2> "$work/psnup.log" + [[ "$(od -An -tc -N 4 "$work/psnup.ps")" == " % ! P S" ]] + (("$(stat -c %s "$work/psnup.ps")" > 1000)) m2300w-wrapper -2 "$work/page.ps" > "$work/m2300w-nup.prn" 2> "$work/m2300w-nup.log" - test -s "$work/m2300w-nup.prn" + [[ "$(od -An -tx1 -N 4 "$work/m2300w-nup.prn")" == " 1b 40 00 02" ]] + (("$(stat -c %s "$work/m2300w-nup.prn")" > 1000)) + test -s /tmp/m2300w.log + if grep -Eqi "command not found|fatal|error" /tmp/m2300w.log; then + cat /tmp/m2300w.log >&2 + exit 1 + fi printf "OK: m2300w profile-backed and psnup conversions\n" printf "# persistence-probe\n" >> "$state/hplip/hplip.conf" From 802902995f62236e967966d6551dc31764946ac6 Mon Sep 17 00:00:00 2001 From: castrojo Date: Wed, 16 Sep 2026 14:09:13 -0400 Subject: [PATCH 3/9] fix: harden CI source and SBOM contracts Assisted-by: GitHub Copilot GPT-5.6 via pi --- .github/workflows/update-fsdk-sources.yml | 20 +++++------ .../2026-09-16-fsdk-dependency-updates.md | 8 ++--- elements/printer-app/psutils.bst | 2 +- tests/appliance-parity.sh | 36 +++++++++++-------- 4 files changed, 35 insertions(+), 31 deletions(-) diff --git a/.github/workflows/update-fsdk-sources.yml b/.github/workflows/update-fsdk-sources.yml index d713808..36c0217 100644 --- a/.github/workflows/update-fsdk-sources.yml +++ b/.github/workflows/update-fsdk-sources.yml @@ -10,12 +10,14 @@ concurrency: cancel-in-progress: true permissions: - contents: read + actions: write + contents: write + pull-requests: write jobs: update: runs-on: ubuntu-24.04 - timeout-minutes: 180 + timeout-minutes: 360 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -41,23 +43,16 @@ jobs: - name: Verify updated appliance if: steps.changes.outputs.changed == 'true' run: just verify - - name: Mint Mergeraptor token - if: steps.changes.outputs.changed == 'true' - id: app-token - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 - with: - app-id: ${{ secrets.MERGERAPTOR_APP_ID }} - private-key: ${{ secrets.MERGERAPTOR_PRIVATE_KEY }} - name: Commit and propose atomic update if: steps.changes.outputs.changed == 'true' env: - GH_TOKEN: ${{ steps.app-token.outputs.token }} + GH_TOKEN: ${{ github.token }} REPOSITORY: ${{ github.repository }} run: | set -euo pipefail branch=auto/update-fsdk-sources - git config user.name 'mergeraptor[bot]' - git config user.email '${{ secrets.MERGERAPTOR_APP_ID }}+mergeraptor[bot]@users.noreply.github.com' + git config user.name 'github-actions[bot]' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' git switch --create "$branch" git add VERSION README.md elements git commit -m 'chore(deps): update FSDK appliance sources' @@ -74,3 +69,4 @@ jobs: --title 'chore(deps): update FSDK appliance sources' \ --body 'Automated atomic update of the freedesktop-sdk junction and repository-owned BuildStream sources. The workflow completed the CUPS patch-chain gate and full appliance verification before opening this PR. Auto-merge is intentionally disabled.' fi + gh workflow run ci.yml --ref "$branch" diff --git a/docs/superpowers/plans/2026-09-16-fsdk-dependency-updates.md b/docs/superpowers/plans/2026-09-16-fsdk-dependency-updates.md index a6ed6fb..3d5542a 100644 --- a/docs/superpowers/plans/2026-09-16-fsdk-dependency-updates.md +++ b/docs/superpowers/plans/2026-09-16-fsdk-dependency-updates.md @@ -2,7 +2,7 @@ **Goal:** Propose atomic, fully verified updates for the FSDK junction and every repository-owned external BuildStream source while preserving the Snap updater as an independent lane. -**Architecture:** Give every Git source a deliberate moving selector and immutable resolved ref, keep CPAN name/suffix/checksum contracts, and keep the plugin tarball's version/checksum explicit. A standard-library Python coordinator runs BuildStream tracking for the complete root graph, refreshes the PyPI plugin tarball, derives the application version from the newly selected FSDK Ghostscript source, synchronizes the IJS source and OCI FSDK labels, and validates the source inventory. A scheduled workflow runs the CUPS patch-chain gate and complete appliance gate before minting a short-lived Mergeraptor token and opening one non-auto-merged PR containing every related version/ref change. The existing updater becomes Snap-only. +**Architecture:** Give every Git source a deliberate moving selector and immutable resolved ref, keep CPAN name/suffix/checksum contracts, and keep the plugin tarball's version/checksum explicit. A standard-library Python coordinator runs BuildStream tracking for the complete root graph, refreshes the PyPI plugin tarball, derives the application version from the newly selected FSDK Ghostscript source, synchronizes the IJS source and OCI FSDK labels, and validates the source inventory. A scheduled workflow runs the CUPS patch-chain gate and complete appliance gate before exposing its write-scoped `GITHUB_TOKEN`, then opens one non-auto-merged PR containing every related version/ref change and explicitly dispatches native CI. The existing updater becomes Snap-only. ## Task 1: Make every source trackable @@ -20,9 +20,9 @@ ## Task 3: Automate verified proposals -- [x] Add a scheduled/manual FSDK-source workflow with read-only permissions during tracking and verification. -- [x] Run `just verify-cups-patch-chain` and `just verify` before minting write credentials. -- [x] Mint a short-lived Mergeraptor token only after verification, then commit all changes atomically and create or update one dependency PR. +- [x] Add a scheduled/manual FSDK-source workflow that does not expose a write credential to tracking or verification shell steps. +- [x] Run `just verify-cups-patch-chain` and `just verify` before exposing the write token. +- [x] Expose the write-scoped `GITHUB_TOKEN` only after verification, then commit all changes atomically, create or update one dependency PR, and explicitly dispatch native CI. - [x] Never enable auto-merge in the updater; native PR CI remains the merge gate. - [x] Reduce the existing updater to the independent Snap dependency lane. diff --git a/elements/printer-app/psutils.bst b/elements/printer-app/psutils.bst index 528a68a..066716c 100644 --- a/elements/printer-app/psutils.bst +++ b/elements/printer-app/psutils.bst @@ -4,7 +4,7 @@ description: Build the legacy psnup helper required by stateful driver wrappers. sources: - kind: git_repo url: salsa:debian/psutils.git - track: debian/* + track: debian/1.* ref: debian/1.17.dfsg-5-0-gafa3fccb4b77165a22b783f21feac35a082d8137 build-depends: diff --git a/tests/appliance-parity.sh b/tests/appliance-parity.sh index 24f7d0b..3aa225a 100755 --- a/tests/appliance-parity.sh +++ b/tests/appliance-parity.sh @@ -3,6 +3,14 @@ set -euo pipefail image="ghcr.io/projectbluefin/ghostscript-printer-app:build" + +expect_equal() { + local label="$1" actual="$2" expected="$3" + if [[ "$actual" != "$expected" ]]; then + printf 'FAIL: %s: got %q, expected %q\n' "$label" "$actual" "$expected" >&2 + exit 1 + fi +} size_limit_bytes="${IMAGE_SIZE_LIMIT_BYTES:-524288000}" just build @@ -47,17 +55,17 @@ case "$(uname -m)" in *) printf 'FAIL: unsupported verification architecture %s\n' "$(uname -m)" >&2; exit 1 ;; esac -test "$(podman image inspect "$image" --format '{{.Architecture}}')" = "$expected_arch" -test "$(podman image inspect "$image" --format '{{.Config.User}}')" = 65532:65532 -test "$(podman image inspect "$image" --format '{{json .Config.Entrypoint}}')" = '["/usr/bin/catatonit","--","/usr/bin/bash","/usr/libexec/ghostscript-printer-app/container-entrypoint"]' -test "$(podman image inspect "$image" --format '{{index .Config.Labels "org.opencontainers.image.title"}}')" = ghostscript-printer-app -test "$(podman image inspect "$image" --format '{{index .Config.Labels "org.opencontainers.image.source"}}')" = https://github.com/projectbluefin/ghostscript-printer-app -test "$(podman image inspect "$image" --format '{{index .Config.Labels "org.opencontainers.image.licenses"}}')" = Apache-2.0 +expect_equal architecture "$(podman image inspect "$image" --format '{{.Architecture}}')" "$expected_arch" +expect_equal user "$(podman image inspect "$image" --format '{{.Config.User}}')" 65532:65532 +expect_equal entrypoint "$(podman image inspect "$image" --format '{{json .Config.Entrypoint}}')" '["/usr/bin/catatonit","--","/usr/bin/bash","/usr/libexec/ghostscript-printer-app/container-entrypoint"]' +expect_equal title "$(podman image inspect "$image" --format '{{index .Config.Labels "org.opencontainers.image.title"}}')" ghostscript-printer-app +expect_equal source "$(podman image inspect "$image" --format '{{index .Config.Labels "org.opencontainers.image.source"}}')" https://github.com/projectbluefin/ghostscript-printer-app +expect_equal license "$(podman image inspect "$image" --format '{{index .Config.Labels "org.opencontainers.image.licenses"}}')" Apache-2.0 application_version="$(podman run --rm --entrypoint /usr/bin/ghostscript-printer-app "$image" --version)" -test "$application_version" = "$(< VERSION)" -test "$(podman image inspect "$image" --format '{{index .Config.Labels "org.opencontainers.image.version"}}')" = "$application_version" -test "$(podman image inspect "$image" --format '{{index .Config.Labels "io.projectbluefin.fsdk.version"}}')" = "$fsdk_version" -test "$(podman image inspect "$image" --format '{{index .Config.Labels "io.projectbluefin.fsdk.ref"}}')" = "$fsdk_ref" +expect_equal binary-version "$application_version" "$(< VERSION)" +expect_equal image-version "$(podman image inspect "$image" --format '{{index .Config.Labels "org.opencontainers.image.version"}}')" "$application_version" +expect_equal fsdk-version "$(podman image inspect "$image" --format '{{index .Config.Labels "io.projectbluefin.fsdk.version"}}')" "$fsdk_version" +expect_equal fsdk-ref "$(podman image inspect "$image" --format '{{index .Config.Labels "io.projectbluefin.fsdk.ref"}}')" "$fsdk_ref" podman run --rm --user 0:0 --entrypoint /usr/bin/bash \ -e ADVERTISED_GHOSTSCRIPT_DRIVERS="$advertised_ghostscript_drivers" \ @@ -66,7 +74,7 @@ podman run --rm --user 0:0 --entrypoint /usr/bin/bash \ backends=(dnssd ipp ipps lpd snmp socket usb) for backend in "${backends[@]}"; do - test -x "/usr/lib/cups/backend/$backend" + test -x "/usr/lib/cups/backend/$backend" || { printf "FAIL: missing CUPS backend %s\n" "$backend" >&2; exit 1; } done filters=( @@ -78,7 +86,7 @@ podman run --rm --user 0:0 --entrypoint /usr/bin/bash \ rastertoptch rastertoqpdl rastertosag-gdi ) for filter in "${filters[@]}"; do - test -x "/usr/lib/cups/filter/$filter" + test -x "/usr/lib/cups/filter/$filter" || { printf "FAIL: missing CUPS filter %s\n" "$filter" >&2; exit 1; } done commands=( @@ -86,7 +94,7 @@ podman run --rm --user 0:0 --entrypoint /usr/bin/bash \ min12xxw pnm2ppa psnup ijs_pxljr ) for command in "${commands[@]}"; do - command -v "$command" >/dev/null + command -v "$command" >/dev/null || { printf "FAIL: missing driver command %s\n" "$command" >&2; exit 1; } done ppd_providers=( @@ -96,7 +104,7 @@ podman run --rm --user 0:0 --entrypoint /usr/bin/bash \ ptouch-ppds pxljr-ppds rastertosag-gdi-ppds splix-ppds ) for provider in "${ppd_providers[@]}"; do - test -e "/usr/share/ppd/$provider" + test -e "/usr/share/ppd/$provider" || { printf "FAIL: missing PPD provider %s\n" "$provider" >&2; exit 1; } done provider_contains() { From 8d5634b7208abcec741c27fffc1f89a13da50195 Mon Sep 17 00:00:00 2001 From: castrojo Date: Wed, 16 Sep 2026 14:32:45 -0400 Subject: [PATCH 4/9] fix: make release validation resilient Assisted-by: GitHub Copilot GPT-5.6 via pi --- .github/workflows/update-fsdk-sources.yml | 3 +++ snap/snapcraft.yaml | 1 + 2 files changed, 4 insertions(+) diff --git a/.github/workflows/update-fsdk-sources.yml b/.github/workflows/update-fsdk-sources.yml index 36c0217..9b28156 100644 --- a/.github/workflows/update-fsdk-sources.yml +++ b/.github/workflows/update-fsdk-sources.yml @@ -40,6 +40,9 @@ jobs: - name: Verify CUPS patch compatibility if: steps.changes.outputs.changed == 'true' run: just verify-cups-patch-chain + - name: Fetch updated sources with retries + if: steps.changes.outputs.changed == 'true' + run: just fetch - name: Verify updated appliance if: steps.changes.outputs.changed == 'true' run: just verify diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 1c558a0..1b957b9 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -363,6 +363,7 @@ parts: - --prefix=/usr - --disable-avahi - --disable-mutool + - --without-jpegxl build-packages: - gettext - autoconf From 2130d9701e20556eab91dd67ffa30e81f4c682af Mon Sep 17 00:00:00 2001 From: castrojo Date: Wed, 16 Sep 2026 15:45:33 -0400 Subject: [PATCH 5/9] fix: preserve HPLIP installation data root --- elements/printer-app/hpijs.bst | 3 ++- tests/stateful-drivers.sh | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/elements/printer-app/hpijs.bst b/elements/printer-app/hpijs.bst index 8c14455..b93cf70 100644 --- a/elements/printer-app/hpijs.bst +++ b/elements/printer-app/hpijs.bst @@ -50,7 +50,7 @@ config: - make -j2 hpijs - | sed -i \ - -e 's|^home=.*|home=/var/lib/ghostscript-printer-app/hplip|' \ + -e 's|^home=.*|home=/usr/share/hplip|' \ -e 's|^run=.*|run=/var/lib/ghostscript-printer-app/hplip/run|' \ -e 's|^ppd=.*|ppd=/usr/share/ppd|' \ -e 's|^ppdbase=.*|ppdbase=/usr/share/ppd|' \ @@ -59,5 +59,6 @@ config: hplip.conf install-commands: - install -D -m 0755 hpijs "%{install-root}/usr/bin/hpijs" + - install -d "%{install-root}/usr/share/hplip" - install -D -m 0644 hplip.conf "%{install-root}/usr/share/ghostscript-printer-app/defaults/hplip/hplip.conf" - mkdir -p "%{install-root}/etc/hp" && ln -s /var/lib/ghostscript-printer-app/hplip/hplip.conf "%{install-root}/etc/hp/hplip.conf" diff --git a/tests/stateful-drivers.sh b/tests/stateful-drivers.sh index 86d8fe5..b2c6ca4 100755 --- a/tests/stateful-drivers.sh +++ b/tests/stateful-drivers.sh @@ -81,6 +81,8 @@ podman exec "$name" /usr/bin/bash -c ' test -L /etc/hp/hplip.conf [[ "$(readlink /etc/hp/hplip.conf)" == "$state/hplip/hplip.conf" ]] test -f "$state/hplip/hplip.conf" + test -d /usr/share/hplip + grep -Fxq "home=/usr/share/hplip" "$state/hplip/hplip.conf" test -f "$state/foo2zjs/foo2zjs/gamma.ps" test -f "$state/foo2zjs/foo2zjs/crd/screen1200.ps" test -f "$state/m2300w/0.51/psfiles/prolog.ps" From fc6652f623f0a3b2accb5494d113b07f65da78b1 Mon Sep 17 00:00:00 2001 From: castrojo Date: Wed, 16 Sep 2026 15:46:46 -0400 Subject: [PATCH 6/9] revert: keep Snap packaging unchanged --- snap/snapcraft.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 1b957b9..1c558a0 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -363,7 +363,6 @@ parts: - --prefix=/usr - --disable-avahi - --disable-mutool - - --without-jpegxl build-packages: - gettext - autoconf From 958b5eb1b51f8f7f4246939a8478437475844996 Mon Sep 17 00:00:00 2001 From: castrojo Date: Wed, 16 Sep 2026 15:59:24 -0400 Subject: [PATCH 7/9] fix: preserve read-only update verification --- .github/workflows/ci.yml | 2 +- .github/workflows/update-fsdk-sources.yml | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb446dd..dfd4262 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: concurrency: group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}" - cancel-in-progress: true + cancel-in-progress: ${{ github.event_name == 'pull_request' }} permissions: {} diff --git a/.github/workflows/update-fsdk-sources.yml b/.github/workflows/update-fsdk-sources.yml index 9b28156..964c6de 100644 --- a/.github/workflows/update-fsdk-sources.yml +++ b/.github/workflows/update-fsdk-sources.yml @@ -10,9 +10,7 @@ concurrency: cancel-in-progress: true permissions: - actions: write - contents: write - pull-requests: write + contents: read jobs: update: @@ -46,16 +44,23 @@ jobs: - name: Verify updated appliance if: steps.changes.outputs.changed == 'true' run: just verify + - name: Mint Mergeraptor token + if: steps.changes.outputs.changed == 'true' + id: app-token + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 + with: + app-id: ${{ secrets.MERGERAPTOR_APP_ID }} + private-key: ${{ secrets.MERGERAPTOR_PRIVATE_KEY }} - name: Commit and propose atomic update if: steps.changes.outputs.changed == 'true' env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ steps.app-token.outputs.token }} REPOSITORY: ${{ github.repository }} run: | set -euo pipefail branch=auto/update-fsdk-sources - git config user.name 'github-actions[bot]' - git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + git config user.name 'mergeraptor[bot]' + git config user.email '${{ secrets.MERGERAPTOR_APP_ID }}+mergeraptor[bot]@users.noreply.github.com' git switch --create "$branch" git add VERSION README.md elements git commit -m 'chore(deps): update FSDK appliance sources' @@ -72,4 +77,3 @@ jobs: --title 'chore(deps): update FSDK appliance sources' \ --body 'Automated atomic update of the freedesktop-sdk junction and repository-owned BuildStream sources. The workflow completed the CUPS patch-chain gate and full appliance verification before opening this PR. Auto-merge is intentionally disabled.' fi - gh workflow run ci.yml --ref "$branch" From c4c9864d3233a3a4d2adb93be7a5ec66e9ea681e Mon Sep 17 00:00:00 2001 From: castrojo Date: Wed, 16 Sep 2026 16:02:36 -0400 Subject: [PATCH 8/9] fix: attribute automated updates to Mergeraptor --- .github/workflows/update-fsdk-sources.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-fsdk-sources.yml b/.github/workflows/update-fsdk-sources.yml index 964c6de..7494b85 100644 --- a/.github/workflows/update-fsdk-sources.yml +++ b/.github/workflows/update-fsdk-sources.yml @@ -60,7 +60,7 @@ jobs: set -euo pipefail branch=auto/update-fsdk-sources git config user.name 'mergeraptor[bot]' - git config user.email '${{ secrets.MERGERAPTOR_APP_ID }}+mergeraptor[bot]@users.noreply.github.com' + git config user.email '267480593+mergeraptor[bot]@users.noreply.github.com' git switch --create "$branch" git add VERSION README.md elements git commit -m 'chore(deps): update FSDK appliance sources' From e4f30cd4b276ed451bc717beb5c051f123e66b75 Mon Sep 17 00:00:00 2001 From: castrojo Date: Wed, 16 Sep 2026 16:04:09 -0400 Subject: [PATCH 9/9] docs: record GitHub App attribution rule --- docs/skills/ci-tooling.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/skills/ci-tooling.md b/docs/skills/ci-tooling.md index 1f3849e..e17e7c5 100644 --- a/docs/skills/ci-tooling.md +++ b/docs/skills/ci-tooling.md @@ -31,6 +31,7 @@ metadata: 8. Keep the Snap update/build lanes independent from FSDK OCI publication. 9. Give every external BuildStream source a project alias. Prefer an authoritative, checksummed release archive over a personal Git mirror when upstream Git is unreliable. 10. Give pull-request CI a PR-scoped concurrency group with `cancel-in-progress: true`; stacked force-pushes must not leave duplicate multi-hour architecture jobs consuming the runner pool. +11. Attribute App-authored commits with the bot account's numeric GitHub user ID in its noreply address. The GitHub App ID is a different identifier and does not link commits to the bot account. ## Common Rationalizations @@ -53,6 +54,7 @@ metadata: - An SBOM generated for only the runner's architecture. - An unaliased external source URL or a source pinned only to a personal fork. - Pull-request CI without cancellation of superseded runs. +- A bot noreply email built from the GitHub App ID instead of the bot account user ID. ## Verification @@ -61,6 +63,7 @@ metadata: - [ ] Pull-request CI completes on native amd64 and arm64 runners without registry credentials. - [ ] BuildStream resolves and fetches every repository-owned source without `[unaliased-url]` warnings. - [ ] Pushing a replacement commit cancels the superseded run for the same pull request. +- [ ] App-authored commits use the verified bot account ID in `+[bot]@users.noreply.github.com`. - [ ] A mismatched tag fails in the metadata job before any write-capable job. - [ ] The published index contains exactly amd64 and arm64 and has the required annotations. - [ ] `cosign verify` succeeds for the index and SBOM artifact.