%bcond check 1 Name: josh Version: 26.06.11 Release: 1%{?dist} Summary: Just One Single History - git history filter and proxy # Cumulative SPDX over josh and every statically-linked crate # (cargo2rpm license-summary over the built feature set). License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSL-1.0 AND CDLA-Permissive-2.0 AND ISC AND MIT AND MPL-2.0 AND Unicode-3.0 AND Zlib AND ((MIT OR Apache-2.0) AND Unicode-3.0) AND (0BSD OR Apache-2.0 OR MIT) AND (Apache-2.0 OR Apache-2.0 WITH LLVM-exception OR MIT) AND (Apache-2.0 OR BSD-2-Clause OR MIT) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR CC0-1.0 OR MIT-0) AND (Apache-2.0 OR ISC OR MIT) AND (Apache-2.0 OR LGPL-2.1-or-later OR MIT) AND (Apache-2.0 OR MIT) AND (Apache-2.0 OR MIT OR Zlib) AND (ISC AND (Apache-2.0 OR ISC)) AND (ISC AND (Apache-2.0 OR ISC) AND Apache-2.0 AND MIT AND BSD-3-Clause AND (Apache-2.0 OR ISC OR MIT) AND (Apache-2.0 OR ISC OR MIT-0)) AND (MIT AND BSD-3-Clause) AND (MIT OR Unlicense) URL: https://github.com/josh-project/josh # Release tags are date-based and carry an `r` prefix (r26.06.11); the archive's # top-level directory keeps it, hence the -r in %%autosetup below. Source0: %{url}/archive/refs/tags/r%{version}/%{name}-%{version}.tar.gz Source1: %{name}-%{version}-vendor.tar.xz Source2: %{name}-proxy.service Source3: %{name}-proxy-sysusers.conf Source4: %{name}-proxy.conf ExclusiveArch: %{rust_arches} BuildRequires: cargo-rpm-macros >= 24 BuildRequires: systemd-rpm-macros # Vendoring turns off %%cargo_generate_buildrequires; the tree links libgit2-sys, # libz-sys and aws-lc-sys (rustls), whose bundled C builds need a C compiler, # cmake and perl in the offline chroot. BuildRequires: gcc BuildRequires: cmake BuildRequires: perl-interpreter # josh drives the git CLI for remote operations. Requires: git-core %description Josh (Just One Single History) exposes a subtree of a git monorepo as a standalone repository, transforming history on the fly. This package provides the local tools: josh-filter, which rewrites git history through a filter spec, and josh, the CLI for workspaces, stacked changes, and forge sync. %package proxy Summary: Git proxy server that transforms history on the fly Requires: git-core %description proxy josh-proxy is an HTTP and SSH git proxy that serves filtered projections of upstream repositories on the fly. Ships josh-ssh-shell, the restricted login shell for the SSH transport, a systemd unit, and a system user. %prep %autosetup -n %{name}-r%{version} -p1 tar -xJf %{SOURCE1} %cargo_prep -v vendor %build # josh embeds its version via git_version!() with a JOSH_VERSION fallback used # when building outside a git checkout - the release tarball carries no .git. export JOSH_VERSION=%{version} %cargo_build -- -p josh-cli -p josh-proxy -p josh-ssh-shell %{cargo_vendor_manifest} # Not end-user docs: a cram test fixture and a draw.io diagram source that # %%doc docs/src would otherwise ship. rm -f docs/src/guide/*.t docs/src/img/*.xml %install install -Dpm0755 target/rpm/josh %{buildroot}%{_bindir}/josh install -Dpm0755 target/rpm/josh-filter %{buildroot}%{_bindir}/josh-filter install -Dpm0755 target/rpm/josh-proxy %{buildroot}%{_bindir}/josh-proxy install -Dpm0755 target/rpm/josh-ssh-shell %{buildroot}%{_bindir}/josh-ssh-shell install -Dpm0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}-proxy.service install -Dpm0644 %{SOURCE3} %{buildroot}%{_sysusersdir}/%{name}.conf install -Dpm0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/%{name}/proxy.conf %check %if %{with check} export JOSH_VERSION=%{version} %{buildroot}%{_bindir}/josh --version %{buildroot}%{_bindir}/josh-filter --version %{buildroot}%{_bindir}/josh-proxy --version %endif %post proxy %systemd_post %{name}-proxy.service %preun proxy %systemd_preun %{name}-proxy.service %postun proxy %systemd_postun_with_restart %{name}-proxy.service %files %license LICENSE %license cargo-vendor.txt %doc README.md docs/src %{_bindir}/josh %{_bindir}/josh-filter %files proxy %license LICENSE %license cargo-vendor.txt %doc docs/src/reference/proxy.md %{_bindir}/josh-proxy %{_bindir}/josh-ssh-shell %{_unitdir}/%{name}-proxy.service %{_sysusersdir}/%{name}.conf %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/proxy.conf # /var/lib/josh is created, owned, and mode-set (0750) by StateDirectory=josh # in the unit, so it is not packaged here. %changelog * Mon Jul 06 2026 Bahtiar `kalkin-` Gadimov - 26.06.11-1 - Initial package