From 6772b0ed8b9f1d9c4294720a0c955be6c7b14bfc Mon Sep 17 00:00:00 2001 From: Jan Macku Date: Tue, 13 Aug 2024 15:16:31 +0200 Subject: [PATCH] rpm: package storypointer to Fedora --- .npmignore | 2 + .packit.yaml | 26 +++++++++++++ rpm/nodejs-storypointer.spec | 53 +++++++++++++++++++++++++++ rpm/storypointer-bundled-licenses.txt | 6 +++ 4 files changed, 87 insertions(+) create mode 100644 .packit.yaml create mode 100644 rpm/nodejs-storypointer.spec create mode 100644 rpm/storypointer-bundled-licenses.txt diff --git a/.npmignore b/.npmignore index ac01c49..0a9b105 100644 --- a/.npmignore +++ b/.npmignore @@ -5,5 +5,7 @@ /tsconfig.* /test +nodejs-storypointer.spec + *.tsbuildinfo .* diff --git a/.packit.yaml b/.packit.yaml new file mode 100644 index 0000000..03722aa --- /dev/null +++ b/.packit.yaml @@ -0,0 +1,26 @@ +# Inspired by https://github.com/csutils/csmock/blob/main/.packit.yaml +# See the documentation for more information: +# https://packit.dev/docs/configuration/ + +specfile_path: rpm/nodejs-storypointer.spec + +# add or remove files that should be synced +files_to_sync: + - rpm/nodejs-storypointer.spec + - .packit.yaml + +upstream_package_name: storypointer +downstream_package_name: nodejs-storypointer + +jobs: + - &copr + job: copr_build + trigger: pull_request + targets: + - fedora-all-x86_64 + + - <<: *copr + trigger: release + owner: "jamacku" + project: "nodejs-storypointer" + branch: main diff --git a/rpm/nodejs-storypointer.spec b/rpm/nodejs-storypointer.spec new file mode 100644 index 0000000..3cf1fc9 --- /dev/null +++ b/rpm/nodejs-storypointer.spec @@ -0,0 +1,53 @@ +# https://src.fedoraproject.org/rpms/nodejs-packaging +%global npm_name storypointer + +Name: nodejs-%{npm_name} +Version: 1.1.0 +Release: %autorelease +Summary: Simple CLI tool to set JIRA Story Points and Priority + +License: GPL-3.0-or-later +URL: https://github.com/redhat-plumbers-in-action/storypointer +Source: https://registry.npmjs.org/%{npm_name}/-/%{npm_name}-%{version}.tgz + +BuildRequires: nodejs-devel +BuildRequires: yarnpkg + +%global _description %{expand: +Simple CLI tool that provides an interactive interface to quickly set priority and story points for your JIRA issues.} + +%description %{_description} + +%package -n %{npm_name} +Summary: %{summary} +License: 0BSD AND BSD-2-Clause AND GPL-3.0-or-later AND ISC AND MIT AND (MIT OR CC0-1.0) + +%description -n %{npm_name} %{_description} + +%files +%doc README.md +%license LICENSE %{npm_name}-bundled-licenses.txt +%{nodejs_sitelib}/%{npm_name} +%{_bindir}/%{npm_name} + +%prep +%setup -q -n package +mv rpm/%{npm_name}-bundled-licenses.txt . + +%build +yarn install +yarn build + +%install +mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name}/bin +install -p -D -m0755 dist/main.js %{buildroot}%{nodejs_sitelib}/%{npm_name}/bin/%{npm_name} +mkdir -p %{buildroot}%{_bindir} +ln -sf %{nodejs_sitelib}/%{npm_name}/bin/%{npm_name} %{buildroot}%{_bindir}/%{npm_name} + +%if %{with check} +%check +yarn test +%endif + +%changelog +%autochangelog diff --git a/rpm/storypointer-bundled-licenses.txt b/rpm/storypointer-bundled-licenses.txt new file mode 100644 index 0000000..29dc10c --- /dev/null +++ b/rpm/storypointer-bundled-licenses.txt @@ -0,0 +1,6 @@ +"0BSD" +"BSD-2-Clause" +"GPL-3.0+" +"ISC" +"MIT" +"(MIT OR CC0-1.0)"