From 405d233ceaaf3c4b11539bce13c12f2839d279c0 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Thu, 7 Sep 2023 20:54:24 +0000 Subject: [PATCH] Initial package. Closes rhbz#2237933. --- .gitignore | 1 + forge-srpm-macros.spec | 64 ++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 66 insertions(+) create mode 100644 .gitignore create mode 100644 forge-srpm-macros.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8ed18fa --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/forge-srpm-macros-0.1.0.tar.gz diff --git a/forge-srpm-macros.spec b/forge-srpm-macros.spec new file mode 100644 index 0000000..0260261 --- /dev/null +++ b/forge-srpm-macros.spec @@ -0,0 +1,64 @@ +# SPDX-License-Identifier: MIT +# Copyright (C) 2023 Maxwell G + +%bcond tests 1 + +Name: forge-srpm-macros +Version: 0.1.0 +Release: 1%{?dist} +Summary: Macros to simplify packaging of forge-hosted projects + +License: GPL-1.0-or-later +URL: https://git.sr.ht/~gotmax23/forge-srpm-macros +Source0: %{url}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz + +BuildRequires: make +%if %{with tests} +BuildRequires: python3-pytest +BuildRequires: python3-pyyaml +# For %%pytest definition +BuildRequires: python3-rpm-macros +%endif +# We require macros and lua defined in redhat-rpm-config +# We constrain this to the version released after the code was split out that +# doesn't contain the same files. + +%if (0%{?fedora} >= 40 || 0%{?rhel} >= 10) +Requires: redhat-rpm-config >= 266-1 +%else +# For testing purposes on older releases, +# we can depend on any version of redhat-rpm-config. +Requires: redhat-rpm-config +%endif + + +%description +%{summary}. + + +%prep +%autosetup -n %{name}-v%{version} + + +%install +%make_install RPMMACRODIR=%{_rpmmacrodir} RPMLUADIR=%{_rpmluadir} + + +%check +%if %{with tests} +export MACRO_DIR=%{buildroot}%{_rpmmacrodir} +export MACRO_LUA_DIR="%{buildroot}%{_rpmluadir}" +%pytest +%endif + + +%files +%license LICENSES/GPL-1.0-or-later.txt +%doc README.md NEWS.md +%{_rpmmacrodir}/macros.forge +%{_rpmluadir}/fedora/srpm/forge.lua + + +%changelog +* Mon Sep 4 2023 Maxwell G - 0.1.0-1 +- Initial package. Closes rhbz#2237933. diff --git a/sources b/sources new file mode 100644 index 0000000..00e88aa --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (forge-srpm-macros-0.1.0.tar.gz) = 4b8a2e4913470ab886ec59f5e589e8075e4771a1fba64bcfb91818b9b9bd49ceb091f4b14229c3fee6ecd966dcceec5fd3f164360fae336ca42e468330c3971f