From 5dc8aba0cdf7dea89bf43eeb2fe72371b04aaea4 Mon Sep 17 00:00:00 2001 From: Thomas Schneider Date: Thu, 4 Apr 2024 00:10:44 +0200 Subject: Initial packaging --- .copr/Makefile | 18 ++++++++++++++++++ .gitignore | 3 +++ catch.patch | 22 +++++++++++++++++++++ chr.spec | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 5 files changed, 104 insertions(+) create mode 100644 .copr/Makefile create mode 100644 .gitignore create mode 100644 catch.patch create mode 100644 chr.spec create mode 100644 sources diff --git a/.copr/Makefile b/.copr/Makefile new file mode 100644 index 0000000..94d6fda --- /dev/null +++ b/.copr/Makefile @@ -0,0 +1,18 @@ +spec ?= $(wildcard *.spec) +ifneq ($(words spec),1) +$(error More than one spec file: $(spec)) +endif +outdir ?= $(CURDIR) +sourcedir = $(shell rpmbuild -E '%_sourcedir') + +srpm: $(spec) /usr/bin/spectool + spectool -R -g $(spec) + env -C $(sourcedir) \ + sha512sum -c $(CURDIR)/sources || \ + (find $(sourcedir) -type f -delete; exit 1) + rpmbuild -D "_srcrpmdir $(outdir)" -bs $(spec) + +.PHONY: srpm + +%: + dnf -y install $@ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e56468b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.rpm +/results_chr +/editor-0.1.77.tar.gz diff --git a/catch.patch b/catch.patch new file mode 100644 index 0000000..d7b74f4 --- /dev/null +++ b/catch.patch @@ -0,0 +1,22 @@ +diff --git a/src/catchwrapper.h b/src/catchwrapper.h +index b2108b2..9d57f82 100644 +--- a/src/catchwrapper.h ++++ b/src/catchwrapper.h +@@ -10,7 +10,12 @@ + #include + #include + +-#include <../third-party/catch.hpp> ++#ifdef CATCH3 ++#include ++using Catch::Approx; ++#else ++#include ++#endif + + #include "filecategorize.h" + +diff --git a/third-party/catch.hpp b/third-party/catch2/catch.hpp +similarity index 100% +rename from third-party/catch.hpp +rename to third-party/catch2/catch.hpp diff --git a/chr.spec b/chr.spec new file mode 100644 index 0000000..1efbcf4 --- /dev/null +++ b/chr.spec @@ -0,0 +1,60 @@ +Name: chr +Version: 0.1.77 +Release: %autorelease +Summary: Terminal editor is inspired by the Turbo Pascal editor + +%global forgeurl https://github.com/istoph/editor +%forgemeta + +License: Boost +URL: %{forgeurl} +Source0: %{forgeurl}/releases/download/%{version}/editor-%{version}.tar.gz + +Patch0: catch.patch + +BuildRequires: meson +BuildRequires: gcc-c++ +BuildRequires: qt5-qtbase-devel +BuildRequires: pkgconfig(TuiWidgets) +BuildRequires: pkgconfig(PosixSignalManager) +BuildRequires: cmake(KF5SyntaxHighlighting) +BuildRequires: pkgconfig(catch2) + + +%description +The chr terminal editor is inspired by the turbo pascal editor using Turbo +Vision from the year 1997. For the keyboard shortcut he should be similar +gedit, to facilitate the transition from desktop to console editor. + + +%prep +%forgeautosetup -p1 +rm -rf third-party/catch.hpp + + +%build +%meson -Dsystem-catch2=enabled -Dsyntax_highlighting=true +%meson_build + + +%install +%meson_install +install -D -m0644 manpages/%{name}.1 -t %{buildroot}%{_mandir}/man1/ +install -D -m0644 manpages/%{name}.de.1 -t %{buildroot}%{_mandir}/de/man1/ + + +# TODO +#check +#meson_test + + +%files +%doc README.md +%license COPYING AUTHORS +%{_bindir}/%{name} +%{_mandir}/man1/%{name}.* +%{_mandir}/de/man1/%{name}.* + + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..cab9c8a --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (editor-0.1.77.tar.gz) = e5cc9fb337774f936363bdacffc0c85c4d4cd885b7829df1df89a8fed787e7d89515efead1e7ae65dd1a86b27a2dec86cf993470396117bcb289f82a2f76ab75 -- cgit v1.2.3