hopefully working SPEC file

This commit is contained in:
2025-01-12 01:02:07 +01:00
parent 6e01c964cf
commit d12a845caa
3 changed files with 33 additions and 19 deletions

5
plan9port.changes Normal file
View File

@@ -0,0 +1,5 @@
-------------------------------------------------------------------
Sat Jan 11 22:40:35 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Initial packaging effort (the inspiration was ArchLinux package
https://aur.archlinux.org/packages/plan9port-git).

5
plan9port.rpmlintrc Normal file
View File

@@ -0,0 +1,5 @@
addFilter("script-without-shebang /usr/lib.*/plan9/")
addFilter("non-executable-script /usr/lib.*/plan9/")
addFilter("devel-file-in-non-devel-package.*/usr/lib.*/plan9/.*\.[cha]")
addFilter("binary-or-shlib-calls-gethostbyname /usr/lib.*/plan9/")
addFilter("potential-bashisms /usr/lib.*/plan9/src/cmd/upas/send/tryit")

View File

@@ -19,24 +19,24 @@
Name: plan9port
Version: 0+git.1729599097.61e362ad
Release: 0
Summary: A port of many Plan 9 libraries and programs to Unix.
License: Custom
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
Source1: plan9.sh
Source2: acme.sh
Source3: acme.png
Source4: acme.desktop
Source99: %{name}.rpmlintrc
BuildRequires: fdupes
BuildRequires: fuse
BuildRequires: git
BuildRequires: libXext-devel
BuildRequires: libXt-devel
# for the codereview script
BuildRequires: python3
BuildRequires: update-desktop-files
BuildRequires: xorg-x11-server
Conflicts: 9base
%endif
%description
This is a port of many Plan 9 libraries and programs to Unix.
@@ -44,21 +44,16 @@ This is a port of many Plan 9 libraries and programs to Unix.
%prep
%setup -q -n plan9port -c -T
cp -a %{_sourcedir}/plan9port/* .
cp -ra %{_sourcedir}/plan9port ..
cp -p %{SOURCE1} .
cp -p %{SOURCE2} .
cp -p %{SOURCE3} .
cp -p %{SOURCE4} .
sed -e '/^PATH/s!^.*$!PATH=$PLAN9/bin:/bin:%{_prefix}/bin:$PATH export PATH!' %{name}/INSTALL
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 -Dm755 %{SOURCE1} %{buildroot}%{_sysconfdir}/profile.d/plan9.sh
%install
@@ -74,28 +69,37 @@ for i in $(find %{buildroot}%{_libdir}/plan9/man -type f -name \*.gz); do
done
grep --null -l -r "%{buildroot}%{_libdir}/plan9" | xargs --null sed -i "s@%{buildroot}%{_libdir}/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
grep --null -l -r "/build/plan9port/pkg/%{name}%{_libdir}/plan9" | xargs --null \
sed -i "s!/build/plan9port/pkg/%{name}%{_libdir}/plan9!%{_libdir}/plan9!g" || true
install -Dm755 %{SOURCE1} %{buildroot}%{_sysconfdir}/profile.d/plan9.sh
install -Dm755 %{SOURCE2} %{buildroot}%{_bindir}/acme
install -Dm644 %{SOURCE3} %{buildroot}%{_datadir}/pixmaps/acme.png
install -Dm644 %{SOURCE4} %{buildroot}%{_datadir}/applications/acme.desktop
# FIXME [ 251s] plan9port.x86_64: W: potential-bashisms /usr/lib64/plan9/src/cmd/upas/send/tryit
# FIXME [ 251s] checkbashisms reported potential bashisms in a /bin/sh shell script, you might
# FIXME [ 251s] want to manually check this script for bashisms.
# Clean up
cd "%{buildroot}%{_libdir}/plan9"
rm -rf .git .gitignore config install.log install.sum configure Makefile INSTALL LICENSE
find . -name '.cvsignore' -print0 | xargs -0 rm -f
find . -name '.cvsignore' -exec rm -f '{}' \;
find . -empty -exec rm -f '{}' \;
find . -name \*.c -exec chmod -x '{}' \;
# https://en.opensuse.org/openSUSE:Packaging_guidelines#Desktop_files
# https://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros#.25suse_update_desktop_file
%suse_update_desktop_file acme
%fdupes %{buildroot}%{_libdir}/plan9
%check
:
%files
%license LICENSE
%doc CHANGES CONTRIBUTORS README.md TODO
%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