Skip to content

feat(linux): install.sh, release archives and an AUR package for the Linux CLI - #16

Closed
Nejcc wants to merge 15 commits into
flock-php:developfrom
Nejcc:feat/linux-install
Closed

Nejcc wants to merge 15 commits into
flock-php:developfrom
Nejcc:feat/linux-install

Conversation

@Nejcc

@Nejcc Nejcc commented Oct 19, 2026 •

Copy link
Copy Markdown

Refs #12.

Summary

This makes Flock installable on Linux. Every release now ships prebuilt Linux CLI archives. A one-line install.sh downloads, verifies and installs the newest one, and an AUR package, flock-php-bin, does the same on Arch.

curl -fsSL https://raw.githubusercontent.com/flock-php/flock/main/install.sh | sh

Merge order: this is stacked on #12. Until #12 is merged, the diff includes its commits. The commits to review are:

  • 31d1957 feat(linux): release archives of the Linux CLI, and install.sh that installs the newest one
  • 957985f feat(linux): AUR package flock-php-bin
  • 89d0784 fix(linux): ship the CLI as flock-php, as feat: Linux support for the CLI and daemon #12 now names it

What's included

Release archives

  • Build: make linux builds flock-<version>-linux-x64.tar.gz and flock-<version>-linux-arm64.tar.gz, each with a .sha256 file. They're static binaries (CGO_ENABLED=0), so they run on any distribution.
  • Contents: the flock-php binary, LICENSE, NOTICE and THIRD_PARTY_NOTICES.
  • CI: build.yml has a Linux job that keeps the archives as run artifacts. beta.yml and release.yml require them next to the .dmg and the .exe, and attach them with the other release assets.

install.sh

  • Version: installs the newest stable release, or the newest beta while every release is still a pre-release (GitHub's releases/latest returns 404 then). FLOCK_VERSION=1.0.0 pins a release.
  • Architecture: picks the archive for x86_64 or aarch64, and checks for curl, tar and sha256sum first.
  • Verification: checks the archive against its .sha256 before anything runs. A mismatch stops the script.
  • Install: runs flock-php install from a temporary folder, which copies the CLI to ~/.config/Flock/bin. Running the script again updates Flock.
  • Arguments: anything after sh -s -- goes to flock-php install.
  • Piping: when the script is piped, stdin is the script itself, so flock-php install gets /dev/tty. That way sudo can still ask for the password.

AUR package: flock-php-bin

  • Name: the package installs /usr/bin/flock-php. The binary isn't named flock, because util-linux already owns flock.
  • Hooks: pacman's install hooks remind the user to:
    • run flock-php install after installing, and again after upgrades, to refresh ~/.config/Flock/bin/flock-php
    • run flock-php uninstall before removing the package
  • Version: the PKGBUILD targets 1.0.0-beta.10 with SKIP checksums, because no release has Linux archives yet.

Testing

What How Result
make linux Builds both archives, then runs sha256sum -c and the binary's version check ✅
install.sh lint shellcheck and shfmt ✅ Clean
install.sh flows Against the local archives through a fake curl, with install --help so nothing is installed: run directly, piped (sh -s --) under sh and bash, and with FLOCK_VERSION=v… ✅
Tampered checksum A modified .sha256 ✅ Stops before anything runs
Release lookup The real GitHub API ✅ Returns 1.0.0-beta.9
makepkg On Arch: file layout and install script ✅
End to end on systemd Rootless Podman containers booting systemd on Arch, Ubuntu 24.04 and Fedora: install, all checks, uninstall --purge, and upgrades between #12's heads ✅ Results in #12; the harness is #22

Not yet run: install.sh against a real release, because none has Linux archives yet.

After the first release with Linux archives

  1. Update the AUR checksums: cd packaging/aur/flock-php-bin && updpkgsums && makepkg --printsrcinfo > .SRCINFO.
  2. Push the package directory to the AUR.

Nejcc added 3 commits October 19, 2026 11:20
…nstalls the newest one

make linux builds flock-<version>-linux-{x64,arm64}.tar.gz with their .sha256; build.yml keeps
them as artifacts and betas and releases require them. install.sh picks the newest release (the
newest beta until there is a stable one), checks the archive and runs flock install.
util-linux owns /usr/bin/flock, so the package installs /usr/lib/flock-php/flock with a
/usr/bin/flock-php link; flock-php install sets Flock up for the user.
The archives hold flock-php, install.sh runs it, and the AUR package installs /usr/bin/flock-php
directly. The comments name the right folder, ~/.config/Flock/bin.
@Nejcc
Nejcc force-pushed the feat/linux-install branch from 9e6578c to 89d0784 Compare October 19, 2026 09:42
@Nejcc Nejcc changed the title feat(linux): install.sh and an AUR package (stacked on #12) feat(linux): install.sh, release archives and an AUR package for the Linux CLI Oct 19, 2026
@onairmarc

Copy link
Copy Markdown
Member

@lukas-frey Let me know if this fits into your Linux plans or if you'd prefer another solution.

@lukas-frey

Copy link
Copy Markdown
Member

Hi @Nejcc, thanks for this :) Linux in #61 ships as .deb/.rpm packages with a signed apt/dnf repository instead of tarballs, so closing this one. An AUR package might still make sense later on top of that, a PR is very welcome once #61 is merged. Just please create an issue beforehand and let's discuss it, I don't want people to waste their time on PRs that might not get merged. We have implemented some automations to prevent that in the future, sorry for that.

@lukas-frey lukas-frey closed this Oct 26, 2026
@Nejcc

Nejcc commented Oct 26, 2026

Copy link
Copy Markdown
Author

Thanks for the explanation, makes sense with #61. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants