%global goipath github.com/browsh-org/browsh/interfacer # Go binary: strip DWARF (-w), no separate debuginfo %global debug_package %{nil} Name: browsh Version: 1.8.3 Release: 2%{?dist} Summary: A fully modern text-based browser, rendered to a terminal # browsh's own code (interfacer + bundled webextension): LGPL-2.1-only # Remaining terms come from the vendored Go dependencies, as detected by # go-vendor-tools/askalono. License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND LGPL-2.1-only AND MIT AND MPL-2.0 URL: https://www.brow.sh VCS: https://github.com/browsh-org/browsh # Upstream source (the Go "interfacer" and the webextension sources) Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz # Official Mozilla-signed WebExtension release artifact, embedded into the # binary via //go:embed. Building it from source would require an unsigned # extension plus an insecure Firefox configuration, which upstream avoids; # their own rpm/deb packages ship this signed .xpi as well. Source1: %{url}/releases/download/v%{version}/%{name}-%{version}.xpi # Vendored Go modules, produced with `go_vendor_archive create` Source2: %{name}-%{version}-vendor.tar.bz2 # go-vendor-tools configuration (detector + license overrides) Source3: go-vendor-tools.toml BuildRequires: golang >= 1.21 BuildRequires: go-vendor-tools # License detector used by go-vendor-tools (see go-vendor-tools.toml) BuildRequires: askalono-cli # Browsh is only a controller: it drives a real headless Firefox over the # Marionette protocol and injects the bundled WebExtension to do the actual # rendering. Without Firefox the binary cannot function, so this is a hard # runtime dependency. Requires: firefox # At startup Browsh shells out to `which firefox` to locate the browser and to # `ps aux` to detect/manage the headless Firefox process (see # interfacer/src/browsh/firefox.go). On a minimal Amazon Linux 2023 image # neither tool is present, and Browsh exits immediately (logging only to # ./debug.log), so both are hard runtime dependencies. Requires: which Requires: procps-ng # Defensive: headless Firefox's libmozgtk.so needs libjpeg.so.62. This is # really Firefox's transitive dependency, but the AL2023 firefox package does # not currently pull it in, which makes Firefox fail with "Couldn't load # XPCOM". Require it here so Browsh is functional out of the box; it can be # dropped once the firefox package declares it. Requires: libjpeg-turbo %description Browsh (formerly texttop) is a fully interactive, real-time, modern text-based browser. Unlike traditional text browsers, it is backed by a real headless Firefox instance, giving it full JavaScript, HTML5 and modern web-app support. Browsh renders pages into coloured UTF-8 text cells and paints them in your terminal, making it ideal for browsing over low-bandwidth connections such as SSH or Mosh. Browsh launches Firefox in headless mode, connects to it over the Marionette protocol and installs its bundled, Mozilla-signed WebExtension, which streams a text representation of each page back to this binary. %prep %autosetup -n %{name}-%{version} # Unpack vendored Go modules into the interfacer module directory # (archive root contains go.mod, go.sum and vendor/). tar -xjf %{SOURCE2} -C interfacer # Place the official signed WebExtension where //go:embed expects it. cp -p %{SOURCE1} interfacer/src/browsh/browsh.xpi # Make browsh's own license visible to go-vendor-tools' license scan, which # operates on the interfacer/ Go module (the LICENSE lives at the repo root). cp -p LICENSE interfacer/LICENSE %build cd interfacer export CGO_ENABLED=0 export GOFLAGS="-mod=vendor" export GOPROXY=off go build \ -mod=vendor \ -buildmode=pie \ -ldflags="-s -w -X %{goipath}/src/browsh.browshVersion=%{version}" \ -o browsh \ ./cmd/browsh %install install -Dpm0755 interfacer/browsh %{buildroot}%{_bindir}/browsh # Install all detected dependency + project licenses and build the filelist. cd interfacer %go_vendor_license_install -c %{SOURCE3} %check cd interfacer # Verify the spec's License tag matches what go-vendor-tools detects. %go_vendor_license_check -c %{SOURCE3} %{LICENSE} # Smoke test: the binary must at least report its version. ./browsh --version %files -f interfacer/%{go_vendor_license_filelist} %doc README.md %{_bindir}/browsh %changelog * Thu Jul 23 2026 Yonghang Wang - 1.8.3-2 - Add runtime dependencies required for Browsh to start on a minimal AL2023: which and procps-ng (Browsh execs `which firefox` and `ps aux` at startup) - Add libjpeg-turbo defensively so headless Firefox can load XPCOM (libmozgtk.so needs libjpeg.so.62) * Thu Jul 23 2026 Yonghang Wang - 1.8.3-1 - Initial package for Amazon Linux 2023 (browsh, formerly texttop) - Embeds the official Mozilla-signed WebExtension; requires firefox at runtime - Go dependencies vendored and license-audited with go-vendor-tools