diff --git a/.gitignore b/.gitignore index 1a000a8..5d31c3c 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,10 @@ msbuild.wrn # Visual Studio 2015 .vs/ + +# Zed +.zed + +RPMS/ +SRPMS/ +BUILD/ diff --git a/README.md b/README.md index efafdfe..ac4d05e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ # demus-packaging-rpm -RPM packaging of demus-packaging +RPM packaging of demus-packaging containing scripts and rpm macros to assist in rpm packaging workflows + +* spec-update-artifacts: Regenerate tool-generated sources referred to in a spec file +* verify_source_checksum rpm macro: Validate that the checksums in a sources file included in a spec matches the unpacked files. diff --git a/demus-packaging.spec b/demus-packaging.spec new file mode 100644 index 0000000..18bb711 --- /dev/null +++ b/demus-packaging.spec @@ -0,0 +1,110 @@ +%global major 1 +%global minor 1 +%global release 1 + +%global forgeurl https://git.demus.dk/demus/demus-packaging +%global forgename gitea.com + +Version: %{major}.%{minor}.%{release} +%forgemeta + +Name: demus-packaging +Release: 1 +Summary: Macros and scripts to assist in rpm packaging workflows +License: GPL-3.0-or-later + +URL: %{forgeurl} + +Source: %{forgesource} +Source: sources + +Requires: bash go-vendor-tools+all rpmdevtools askalono-cli +BuildRequires: forge-srpm-macros bats-assert + +Obsoletes: demus-packaging-utils < 1.0.0 +Provides: demus-packaging-utils = %{version} + +BuildArch: noarch + +%description +* regenerate-from-spec: Regenerate tool-generated sources + referred to in a spec file +* go-vendor-update: An script that replicates the parameters + used by go2rpm to generate the vendor archive, license + expression and configuration. It is used in the above + regenerate script. +* verify_source_checksum rpm macro: Validate that the + checksums in a sources file included in a spec matches the + unpacked files. +* stripped_basename macro: Adds the extension stripping + positional parameter to %stripped_basename +* binshellname macro: Produce the stripped name of a .sh script + +%prep +%forgesetup +%if %{exists:%{_builddir}/%{name}/macros.demus-packaging} + %{load:%{_builddir}/%{name}/macros.demus-packaging} +%endif +%{?verify_source_checksum:%verify_source_checksum -s %{S:1}} + +%build + +%check +cd %{_builddir}/%{name} +bats test + +%install +%{__install} -m 0755 -d %{buildroot}%{_bindir} +%{__install} -m 0755 -d %{buildroot}%{_rpmmacrodir} + +%{__install} -p -m 644 macros.demus-packaging %{buildroot}%{_rpmmacrodir}/macros.demus-packaging +%{__install} -p -m 755 spec-update-artifacts.sh %{buildroot}%{_bindir}/spec-update-artifacts + +%files +%doc README.md +%license LICENSE +%{_bindir}/spec-update-artifacts +%{_rpmmacrodir}/macros.demus-packaging + +%changelog +* Thu Jun 11 2026 Daniel Demus - 1.1.1-1 +- Consolidate scripts +- Add tests + +* Thu Jun 11 2026 Daniel Demus - 1.1.0-1 +- Split repos into source and rpm build + +* Wed Jun 10 2026 Daniel Demus - 1.0.5-1 +- Make ignoring unlicensed mods optional + +* Mon Jun 08 2026 Daniel Demus - 1.0.4-1 +- Ignore unlicensed mods as there is no way to avoid a failure +- There doesn't seem to be a way to override a missing license, so the license check always fails + +* Mon Jun 08 2026 Daniel Demus - 1.0.3-1 +- Simplify file listing for sources generation + +* Sun Jun 07 2026 Daniel Demus - 1.0.2-1 +- Fix rpmlint complaints + +* Sun Jun 07 2026 Daniel Demus - 1.0.1-1 +- Remove x bit on macros file + +* Sun Jun 07 2026 Daniel Demus - 1.0.0-1 +- Rename project +- Build on COPR +- Release 1.0.0 + +* Sun Jun 07 2026 Daniel Demus - 0.1.4-1 +- Update License expression in spec file +- in the same way go2rpm generates it originally + +* Fri Jun 05 2026 Daniel Demus - 0.1.3-1 +- Download remote sources before updating anything + +* Fri Jun 05 2026 Daniel Demus - 0.1.2-1 +- Switch vendor archive update from alias to command and rename + +* Fri Jun 05 2026 Daniel Demus - 0.1.1-1 +- Exclude the spec file from the sources list +- They can change during build if rpmautospec or something similiar is used diff --git a/sources b/sources new file mode 100644 index 0000000..f31302f --- /dev/null +++ b/sources @@ -0,0 +1,3 @@ +SHA512 (1.1.1.tar.gz) = ddb32fbbd4973a9e3f429e5b8c42296bfcbe149220a83a03d46433b6b29af90e710da3d800dbb4f467743163d129ad0a024199c08a0efb57f7791b4213c289ed +SHA512 (LICENSE) = ccb0f3b838dff6254510f19c2bd6f5c48e38b8c40a5bf93d38482f4fb31015823741d3f160b6836ec99bd8f4e6c5fa9a5c9196ecdd7775b793f3ada50467aabd +SHA512 (README.md) = 20dea8a671a180addc73731ebd08b699039c082b113f891e2f635cc59168e321f2abe7b7a564c995b0e4beefa7863b4faf0d6545e365a863db2a653b2d8f7c50