%global forgeurl https://github.com/9fans/plan9port %global commit 552faac4704380c066fffb3ead568e86e3d9b4b3 %global date 20260401 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global plan9dir /usr/lib/plan9 %global stagedir %{_builddir}/plan9port-staging Name: p9p Version: 0^%{date}g%{shortcommit} Release: 1%{?dist} Summary: Plan 9 from User Space: Plan 9 tools ported to Unix License: LPL-1.02 AND MIT AND BSD-2-Clause URL: %{forgeurl} Source0: %{forgeurl}/archive/%{commit}/plan9port-%{shortcommit}.tar.gz BuildRequires: gcc BuildRequires: make BuildRequires: pkgconf-pkg-config BuildRequires: libX11-devel BuildRequires: libXt-devel BuildRequires: libXext-devel BuildRequires: libXft-devel BuildRequires: fontconfig-devel BuildRequires: freetype-devel BuildRequires: openssl-devel %description plan9port (Plan 9 from User Space) is a port of many Plan 9 programs and libraries to Unix-like operating systems. It includes: acme — the Plan 9 text editor and programming environment sam — structural regular-expression-based editor rc — the Plan 9 shell mk — a make(1) replacement driven by a Plan 9 Makefile dialect plumber — inter-application message-routing service 9p — 9P filesystem client …and many other Plan 9 utilities and libraries. The entire tree is installed to %{plan9dir}. The 9(1) wrapper and a curated set of non-conflicting binaries are symlinked into %{_bindir}. Use '9 ' to invoke any plan9port tool that does not have a symlink. To configure your shell environment, source one of: rc users: . %{plan9dir}/plan9.rc sh/bash: . %{plan9dir}/plan9.profile %prep %autosetup -n plan9port-%{commit} %build install -d %{stagedir}%{plan9dir} cp -a . %{stagedir}%{plan9dir}/ pushd %{stagedir}%{plan9dir} ./INSTALL popd for f in plan9.rc plan9.profile; do target="%{stagedir}%{plan9dir}/${f}" [ -f "${target}" ] && sed -i 's|%{stagedir}||g' "${target}" done %install install -d %{buildroot}/usr/lib cp -a %{stagedir}%{plan9dir} %{buildroot}%{plan9dir} install -Dm644 %{buildroot}%{plan9dir}/LICENSE \ %{buildroot}%{_licensedir}/%{name}/LICENSE install -d %{buildroot}%{_bindir} for bin in \ 9 \ 9p \ acme \ mk \ plumber \ rc \ sam \ ; do if [ -x "%{buildroot}%{plan9dir}/bin/${bin}" ]; then ln -sf %{plan9dir}/bin/${bin} \ %{buildroot}%{_bindir}/${bin} fi done %files %license %{_licensedir}/%{name}/LICENSE %{plan9dir} %{_bindir}/9 %{_bindir}/9p %{_bindir}/acme %{_bindir}/mk %{_bindir}/plumber %{_bindir}/rc %{_bindir}/sam