From 5f522a91d890afdbc8edc805e0d3f4e44d8c6adb Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Wed, 14 Jun 2023 11:53:30 +0200 Subject: [PATCH] Add Fedora packaging Signed-off-by: Cristian Le --- .distro/.gitignore | 5 +++ .distro/fdict.rpmlintrc | 0 .distro/fdict.spec | 42 +++++++++++++++++ .distro/packit.toml | 3 ++ .distro/plans/main.fmf.dist-git | 3 ++ .distro/plans/rpmlint.fmf | 22 +++++++++ .distro/plans/smoke.fmf | 7 +++ .distro/tests/rpmlint.fmf | 13 ++++++ .distro/tests/smoke.fmf | 9 ++++ .packit.yaml | 80 +++++++++++++++++++++++++++++++++ 10 files changed, 184 insertions(+) create mode 100644 .distro/.gitignore create mode 100644 .distro/fdict.rpmlintrc create mode 100644 .distro/fdict.spec create mode 100644 .distro/packit.toml create mode 100644 .distro/plans/main.fmf.dist-git create mode 100644 .distro/plans/rpmlint.fmf create mode 100644 .distro/plans/smoke.fmf create mode 100644 .distro/tests/rpmlint.fmf create mode 100644 .distro/tests/smoke.fmf create mode 100644 .packit.yaml diff --git a/.distro/.gitignore b/.distro/.gitignore new file mode 100644 index 0000000..f025007 --- /dev/null +++ b/.distro/.gitignore @@ -0,0 +1,5 @@ +/main.fmf +/plans/main.fmf +/tests/main.fmf +!*.spec +*.tar.gz diff --git a/.distro/fdict.rpmlintrc b/.distro/fdict.rpmlintrc new file mode 100644 index 0000000..e69de29 diff --git a/.distro/fdict.spec b/.distro/fdict.spec new file mode 100644 index 0000000..8ddb5d6 --- /dev/null +++ b/.distro/fdict.spec @@ -0,0 +1,42 @@ +Name: fdict +Version: 0.0.0 +Release: %{autorelease} +Summary: Fortran type-free variable and type-free dictionary + +License: GPL-2.0 +URL: http://zerothi.github.io/fdict +Source: https://github.com/zerothi/fdict/archive/refs/tags/v%{version}.tar.gz + +BuildRequires: cmake +BuildRequires: gcc-gfortran + +%description +A variable and dictionary in pure fortran for retaining any data-type and a +fast hash-table dictionary. + + +%prep +%autosetup -p1 -n fdict-%{version} + + +%build +%cmake +%cmake_build + + +%install +%cmake_install + + +%check +%ctest + + +%files +%license LICENSE +%doc README.md +%{_datadir}/cmake/fdict + + +%changelog +%autochangelog diff --git a/.distro/packit.toml b/.distro/packit.toml new file mode 100644 index 0000000..40af9bf --- /dev/null +++ b/.distro/packit.toml @@ -0,0 +1,3 @@ +Filters = [ + "unknown-key", +] diff --git a/.distro/plans/main.fmf.dist-git b/.distro/plans/main.fmf.dist-git new file mode 100644 index 0000000..5221be5 --- /dev/null +++ b/.distro/plans/main.fmf.dist-git @@ -0,0 +1,3 @@ +discover: + how: fmf + dist-git-source: true diff --git a/.distro/plans/rpmlint.fmf b/.distro/plans/rpmlint.fmf new file mode 100644 index 0000000..befc761 --- /dev/null +++ b/.distro/plans/rpmlint.fmf @@ -0,0 +1,22 @@ +summary: + Perform rpmlint and rpminspect tests +prepare: + - name: Install rpmlint packages + how: install + package: + - rpmlint + - rpminspect + - rpminspect-data-fedora + ## TODO: Disabled because upstream failure + ## https://github.com/packit/packit/issues/1978 + #- name: Download the source rpm + # how: shell + # script: cd /tmp && curl -O ${PACKIT_SRPM_URL} + - name: Download rpm packages + how: shell + script: cd /tmp && dnf download ${PACKIT_COPR_RPMS} +discover+: + how: fmf + filter: "tag: rpmlint" +execute: + how: tmt diff --git a/.distro/plans/smoke.fmf b/.distro/plans/smoke.fmf new file mode 100644 index 0000000..0f486b6 --- /dev/null +++ b/.distro/plans/smoke.fmf @@ -0,0 +1,7 @@ +summary: + Basic smoke tests +discover+: + how: fmf + filter: "tag: smoke" +execute: + how: tmt diff --git a/.distro/tests/rpmlint.fmf b/.distro/tests/rpmlint.fmf new file mode 100644 index 0000000..5db6cd7 --- /dev/null +++ b/.distro/tests/rpmlint.fmf @@ -0,0 +1,13 @@ +# Common test variables +tag: + - rpmlint +tier: 0 +path: / + +# Define tests +/rpmlint: + summary: Rpmlint spec and rpmfiles + test: rpmlint -c packit.toml -r fidct.rpmlintrc ./*.spec /tmp/*.rpm +/rpminspect-rpms: + summary: Rpminspect the rpms + test: ls /tmp/*.rpm | xargs -L1 rpminspect-fedora -E metadata,disttag diff --git a/.distro/tests/smoke.fmf b/.distro/tests/smoke.fmf new file mode 100644 index 0000000..442e719 --- /dev/null +++ b/.distro/tests/smoke.fmf @@ -0,0 +1,9 @@ +# Common test variables +tag: + - smoke +tier: 0 +path: / + +# Define tests +/version: + test: echo "To be implemented" diff --git a/.packit.yaml b/.packit.yaml new file mode 100644 index 0000000..9e53e19 --- /dev/null +++ b/.packit.yaml @@ -0,0 +1,80 @@ +specfile_path: .distro/fdict.spec +files_to_sync: + - src: .distro/fdict.spec + dest: fdict.spec + - .packit.yaml + - src: .distro/fdict.rpmlintrc + dest: fdict.rpmlintrc + # tmt setup + - src: .distro/.fmf/ + dest: .fmf/ + - src: .distro/plans/ + dest: plans/ + filters: + - "- .distro/plans/main.fmf.dist-git" + - "- .distro/plans/rpmlint.fmf" + - src: .distro/plans/main.fmf.dist-git + dest: plans/main.fmf + +upstream_package_name: fdict +downstream_package_name: fdict +update_release: false +upstream_tag_template: v{version} + +jobs: + - job: copr_build + trigger: pull_request + owner: lecris + project: fdict + update_release: true + release_suffix: "{PACKIT_RPMSPEC_RELEASE}" + targets: + # TODO: Change before production + #- fedora-development + - fedora-all + - job: tests + trigger: pull_request + targets: + # TODO: Change before production + #- fedora-development + - fedora-all + fmf_path: .distro + - job: copr_build + trigger: commit + branch: main + owner: lecris + project: nightly + targets: + - fedora-all-x86_64 + - fedora-all-aarch64 + additional_repos: + - copr://@scikit-build/release + - job: tests + trigger: commit + branch: main + targets: + - fedora-all + - job: copr_build + trigger: release + owner: lecris + project: release + targets: + - fedora-all-x86_64 + - fedora-all-aarch64 + additional_repos: + # TODO: Required for now until related issue is resolved + # https://github.com/packit/packit/issues/1917 + - copr://@scikit-build/release +## TODO: Disabled until released on src.fedoraproject.org +# - job: propose_downstream +# trigger: release +# dist_git_branches: +# - fedora-development +# - job: koji_build +# trigger: commit +# dist_git_branches: +# - fedora-all +# - job: bodhi_update +# trigger: commit +# dist_git_branches: +# - fedora-all