# ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # File: vdb-rpm-macros.spec # Copyright 🄯 2021 Van de Bugger. # SPDX-License-Identifier: FSFAP # ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― %{lua: package.path = rpm.expand( '%{_sourcedir}' ) .. '/?.lua;' .. package.path -- Look into source directory for Lua modules. local vdb = require "vdb" } Name: vdb-rpm-macros Version: 0.0.2 Release: 0.vdb.1%{?dist} URL: https://example.org/ Summary: Lua functions used in VdB RPMs License: GPL-3.0-or-later BuildArch: noarch Source0: vdb.lua Source1: macros.vdb Source2: harness.lua Source3: tests.lua BuildRequires: rpm >= 4.14.0 %{rem: `rpm.undefine` appears in rpm 4.14.0.} Requires: rpm >= 4.14.0 %{rem: Also, rpm 4.11.3 fails few tests.} %description TODO %{lua: local harness = require "harness" local tests = require "tests" } %prep # Do nothing. %build # Do nothing. %install %{_install_D} -m u=rw,go=r %{S:0} %{buildroot}%{_rpmluadir}/vdb.lua %{_install_D} -m u=rw,go=r %{S:1} %{buildroot}%{_rpmmacrodir}/macros.vdb %check # Actually, the tests are run early, this code just shows the result. : ------------------------------ : $tests_total tests run : $tests_passed tests passes : $tests_failed tests failed : ------------------------------ if (( $tests_failed > 0 )); then cat %{_topdir}/tests.log fi (( $tests_total > 0 )) (( $tests_passed + $tests_failed == $tests_total )) (( $tests_failed == 0 )) %files %{_rpmluadir}/vdb.lua %{_rpmmacrodir}/macros.vdb %changelog * Tue Mar 18 2025 Van de Bugger - 0.0.2-0.vdb.1 - Test-only spec converted to real package. - Many changes in vdb.lua. * Sun Nov 7 2021 Van de Bugger - 0.0.1-0.vdb.1 - Initial release.