From d12a845caa7687a0aafcfc9031dc677f5ac621c7af66bfc5e8c3794db09b60d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= Date: Sun, 12 Jan 2025 01:02:07 +0100 Subject: [PATCH] hopefully working SPEC file --- plan9port.changes | 5 +++++ plan9port.rpmlintrc | 5 +++++ plan9port.spec | 42 +++++++++++++++++++++++------------------- 3 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 plan9port.changes create mode 100644 plan9port.rpmlintrc diff --git a/plan9port.changes b/plan9port.changes new file mode 100644 index 0000000..afeb38b --- /dev/null +++ b/plan9port.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Sat Jan 11 22:40:35 UTC 2025 - Matej Cepl + +- Initial packaging effort (the inspiration was ArchLinux package + https://aur.archlinux.org/packages/plan9port-git). diff --git a/plan9port.rpmlintrc b/plan9port.rpmlintrc new file mode 100644 index 0000000..6ed0f8d --- /dev/null +++ b/plan9port.rpmlintrc @@ -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") diff --git a/plan9port.spec b/plan9port.spec index 3faad6c..6c692b8 100644 --- a/plan9port.spec +++ b/plan9port.spec @@ -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