Files
plan9port/plan9port.spec

104 lines
3.3 KiB
RPMSpec

#
# spec file for package plan9port
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: plan9port
Version: 0+git.1729599097.61e362ad
Release: 0
Summary: A port of many Plan 9 libraries and programs to Unix
License: MIT AND LPL-1.02 AND BSD-3-Clause
URL: https://swtch.com/plan9port
#!RemoteAssetUrl: git+https://git.sr.ht/~mcepl/plan9port#devel
Source99: %{name}.rpmlintrc
BuildRequires: fdupes
BuildRequires: fuse
BuildRequires: git
BuildRequires: libXext-devel
BuildRequires: libXt-devel
# for the codereview script
BuildRequires: python3
BuildRequires: xorg-x11-server
Conflicts: 9base
%description
This is a port of many Plan 9 libraries and programs to Unix.
%prep
%setup -q -n plan9port -c -T
cp -ra %{_sourcedir}/plan9port ..
sed -i -e '/^PATH/s!^.*$!PATH=$PLAN9/bin:/bin:%{_prefix}/bin:$PATH export PATH!' INSTALL
%build
pwd -P
PLAN9=%{_libdir}/plan9
grep --null -l -r '%{_prefix}/local/plan9' | xargs --null sed -i "s!%{_prefix}/local/plan9!%{_libdir}/plan9!g"
./INSTALL -b
%install
mkdir -p %{buildroot}%{_prefix}/{%{_lib},share/doc/%{name}}
cp -p -r . "%{buildroot}%{_libdir}/plan9"
cd "%{buildroot}%{_libdir}/plan9"
./INSTALL -c -r "%{buildroot}%{_libdir}/plan9"
# Decompress the plan9 man pages
for i in $(find %{buildroot}%{_libdir}/plan9/man -type f -name \*.gz); do
gunzip "$i"
done
grep --null -l -r "%{buildroot}/usr/lib/plan9" | xargs --null sed -i "s@%{buildroot}/usr/lib/plan9@%{_libdir}/plan9@g" || true
grep --null -l -r "/build/plan9port/pkg/%{name}/usr/lib/plan9" | xargs --null \
sed -i "s!/build/plan9port/pkg/%{name}/usr/lib/plan9!%{_libdir}/plan9!g" || true
install -Dm644 dist/plan9.sh %{buildroot}%{_sysconfdir}/profile.d/plan9.sh
install -Dm755 dist/acme.sh %{buildroot}%{_bindir}/acme
install -Dm644 dist/spaceglenda100.png %{buildroot}%{_datadir}/pixmaps/acme.png
install -Dm644 dist/acme.desktop %{buildroot}%{_datadir}/applications/acme.desktop
# fix shebangs and variables
sed -i -e '/^# *\/usr\/bin\/env/s!/usr/bin/env perl!%{_bindir}/perl!' \
%{buildroot}%{_libdir}/plan9/dist/{addsrclinks,fixurls}
sed -i -e '/^export PLAN9/s!/usr/lib!%{_libdir}!' %{buildroot}%{_sysconfdir}/profile.d/plan9.sh
# Clean up
cd "%{buildroot}%{_libdir}/plan9"
rm -rf .git .github .gitignore \
config install.log install.sum configure Makefile INSTALL LICENSE
find . -name '.cvsignore' -exec rm -f '{}' \;
find . -empty -exec rm -f '{}' \;
find . -name \*.c -exec chmod -x '{}' \;
%fdupes %{buildroot}%{_libdir}/plan9
%check
:
%files
%license LICENSE
%doc CHANGES CONTRIBUTORS README.md CONTRIBUTING.md
%{_bindir}/acme
%{_libdir}/plan9
%config %{_sysconfdir}/profile.d/plan9.sh
%{_datadir}/applications/acme.desktop
%{_datadir}/pixmaps/acme.png
%changelog