From ce80e06239181b270942702882d47bef94249c54 Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez-Fernandez Date: Sat, 30 Mar 2024 22:08:26 -0700 Subject: [PATCH 1/2] initial commit --- gating.yaml | 19 +++++++++++++++ libmaa.spec | 59 +++++++++++++++++++++++++++++++++++++++++++++++ plans/main.fmf | 5 ++++ sources | 1 + tests/data/main.c | 14 +++++++++++ tests/main.fmf | 4 ++++ tests/test.sh | 22 ++++++++++++++++++ 7 files changed, 124 insertions(+) create mode 100644 gating.yaml create mode 100644 libmaa.spec create mode 100644 plans/main.fmf create mode 100644 sources create mode 100644 tests/data/main.c create mode 100644 tests/main.fmf create mode 100755 tests/test.sh diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..fefdc9f --- /dev/null +++ b/gating.yaml @@ -0,0 +1,19 @@ +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_testing +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.rpminspect.static-analysis} + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.installability.functional} + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} +--- !Policy +product_versions: + - fedora-* +decision_context: bodhi_update_push_stable +subject_type: koji_build +rules: + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.rpmdeplint.functional} + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.rpminspect.static-analysis} + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.installability.functional} + - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} diff --git a/libmaa.spec b/libmaa.spec new file mode 100644 index 0000000..cb5bc88 --- /dev/null +++ b/libmaa.spec @@ -0,0 +1,59 @@ +Name: libmaa +Version: 1.4.7 +Release: 1%{?dist} +Summary: Library that implements some basic data structures and algorithms +URL: https://github.com/cheusov/libmaa +License: MIT + +Source0: https://github.com/cheusov/libmaa/archive/%{version}/%{name}-%{version}.tar.gz + +BuildRequires: mk-configure +BuildRequires: gcc +BuildRequires: pkgconfig(zlib) + +%description +This library implements some basic data structures and algorithms such +as command line arguments handling, base26 and base64 routines, bits +manipulation, debugging and error reporting routines, hash tables, +sets, lists, stacks, skip lists, string pool routines, memory +management routines, parsing routines, process management routines, +source code management routines and timer support. + +%package devel +Summary: Development files for libmaa +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +Development files (Headers, etc) for libmaa. + +%global env \ + export MKSTATICLIB=no \ + export NOSUBDIR=doc + +%prep +%autosetup -p1 + +%build +%{env} +%mkcmake + +%install +%{env} +%mkcmake install DESTDIR=%{buildroot} +chmod +x %{buildroot}/%{_libdir}/*.so.* + +%check +%mkcmake test + +%files +%license doc/LICENSE +%doc README doc/NEWS +%{_libdir}/libmaa.so.4{,.*} + +%files devel +%{_includedir}/maa* +%{_libdir}/libmaa.so + +%changelog +* Sun Jan 7 2024 Carlos Rodriguez-Fernandez - 1.4.7-1 +- First release diff --git a/plans/main.fmf b/plans/main.fmf new file mode 100644 index 0000000..87f1f13 --- /dev/null +++ b/plans/main.fmf @@ -0,0 +1,5 @@ +summary: smoke tests +discover: + how: fmf +execute: + how: tmt diff --git a/sources b/sources new file mode 100644 index 0000000..f62ac99 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (libmaa-1.4.7.tar.gz) = c85687e320ec0ec4f5acccaa56b75e42566465c35b58fb21310ee193e63475e3765dbfb43ef961c31032070d821d5aab17e856c89bc86a927053cf075afb3d99 diff --git a/tests/data/main.c b/tests/data/main.c new file mode 100644 index 0000000..a1287aa --- /dev/null +++ b/tests/data/main.c @@ -0,0 +1,14 @@ +#include +#include +#include +#include + +int main(int argc, char** argv) +{ + maa_init(argv[0]); + + printf("major version: %d\n", maa_version_major()); + + maa_shutdown(); + return 0; +} diff --git a/tests/main.fmf b/tests/main.fmf new file mode 100644 index 0000000..a11c387 --- /dev/null +++ b/tests/main.fmf @@ -0,0 +1,4 @@ +summary: smoke tests +test: ./test.sh +framework: beakerlib +require: [gcc,libmaa-devel] diff --git a/tests/test.sh b/tests/test.sh new file mode 100755 index 0000000..73ae646 --- /dev/null +++ b/tests/test.sh @@ -0,0 +1,22 @@ +#!/bin/bash +. /usr/share/beakerlib/beakerlib.sh || exit 1 + + +rlJournalStart + rlPhaseStartSetup + rlRun "pushd data/" + rlPhaseEnd + + rlPhaseStartTest + rlRun "gcc -lmaa -Wall -g3 -o main main.c" + rlPhaseEnd + + rlPhaseStartTest + rlRun "./main" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "rm main" + rlRun "popd" + rlPhaseEnd +rlJournalEnd From ec2c651ed064daaebf545a6068683e426a347874 Mon Sep 17 00:00:00 2001 From: Carlos Rodriguez-Fernandez Date: Mon, 1 Apr 2024 10:08:13 -0700 Subject: [PATCH 2/2] fix missing .fmf file --- .fmf/version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .fmf/version diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1