diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1145b2a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/specfile-0.6.0.tar.gz diff --git a/.packit.yaml b/.packit.yaml new file mode 100644 index 0000000..b496f21 --- /dev/null +++ b/.packit.yaml @@ -0,0 +1,152 @@ +--- +# We want to use both instances for all upstream jobs including the `propose-downstream` one. +# For downstream, we need to pick just one instance (`stg` in our case) +# and redefine it for the `koji_build` and `bodhi_update` jobs. +packit_instances: ["prod", "stg"] + +specfile_path: fedora/python-specfile.spec + +# add or remove files that should be synced +files_to_sync: + - fedora/python-specfile.spec + - .packit.yaml + - src: plans/ + dest: plans/ + - src: .fmf/ + dest: .fmf/ + +# name in upstream package repository or registry (e.g. in PyPI) +upstream_package_name: specfile +# downstream (Fedora) RPM package name +downstream_package_name: python-specfile + +copy_upstream_release_description: true + +upstream_project_url: https://github.com/packit/specfile +issue_repository: https://github.com/packit/specfile + +actions: + # we need this b/c `git archive` doesn't put all the metadata in the tarball: + # LookupError: setuptools-scm was unable to detect version for '/builddir/build/BUILD/ogr-0.11.1'. + # Make sure you're either building from a fully intact git repository or PyPI tarballs. + create-archive: + - python3 setup.py sdist --dist-dir ./fedora/ + - bash -c "ls -1t ./fedora/*.tar.gz | head -n 1" + get-current-version: python3 setup.py --version + pre-sync: + # FMF has to be installed on system where you are calling this tool. + - python3 plans/git_reference.py + +srpm_build_deps: + - python3-pip # "python3 setup.py --version" needs it + - python3-setuptools_scm + +jobs: + - job: propose_downstream + trigger: release + dist_git_branches: + - fedora-all + - epel-9 + - job: propose_downstream + trigger: release + specfile_path: epel8/python-specfile.spec + files_to_sync: + - epel8/python-specfile.spec + - .packit.yaml + - src: plans/ + dest: plans/ + - src: .fmf/ + dest: .fmf/ + dist_git_branches: + - epel-8 + + - job: copr_build + trigger: pull_request + identifier: fedora-and-epel + targets: + - fedora-all + - epel-9 + - &copr_build_pr_epel8 + job: copr_build + trigger: pull_request + specfile_path: epel8/python-specfile.spec + identifier: epel8 + actions: + create-archive: + - python3 setup.py sdist --dist-dir ./epel8/ + - bash -c "ls -1t ./epel8/*.tar.gz | head -n 1" + get-current-version: python3 setup.py --version + pre-sync: + # FMF has to be installed on system where you are calling this tool. + - python3 plans/git_reference.py + targets: + - epel-8 + + - job: copr_build + trigger: commit + branch: main + targets: + - fedora-all + - epel-9 + project: packit-dev + list_on_homepage: True + preserve_project: True + - <<: *copr_build_pr_epel8 + trigger: commit + branch: main + targets: + - epel-8 + project: packit-dev + list_on_homepage: True + preserve_project: True + + - job: copr_build + trigger: commit + branch: stable + targets: + - fedora-stable + - epel-9 + project: packit-stable + list_on_homepage: True + preserve_project: True + - <<: *copr_build_pr_epel8 + trigger: commit + branch: stable + targets: + - epel-8 + project: packit-stable + list_on_homepage: True + preserve_project: True + + - job: copr_build + trigger: release + targets: + - fedora-all + - epel-9 + project: packit-releases + list_on_homepage: True + preserve_project: True + - <<: *copr_build_pr_epel8 + trigger: release + targets: + - epel-8 + project: packit-releases + list_on_homepage: True + preserve_project: True + + # downstream automation: + - job: koji_build + trigger: commit + packit_instances: ["stg"] + allowed_pr_authors: ["packit-stg", "packit"] + dist_git_branches: + - fedora-all + - epel-9 + - epel-8 + - job: bodhi_update + trigger: commit + packit_instances: ["stg"] + dist_git_branches: + - fedora-stable # rawhide and branched updates are created automatically + - epel-9 + - epel-8 diff --git a/README.packit b/README.packit new file mode 100644 index 0000000..e51d16c --- /dev/null +++ b/README.packit @@ -0,0 +1,3 @@ +This repository is maintained by packit. +https://packit.dev/ +The file was generated using packit 0.58.0. diff --git a/plans/full.fmf b/plans/full.fmf new file mode 100644 index 0000000..8138395 --- /dev/null +++ b/plans/full.fmf @@ -0,0 +1,12 @@ +summary: + Unit & integration tests +discover+: + filter: tier:1 +prepare: + # flexmock is not in EPEL 9, install it from PyPI + - name: pip + how: install + package: python3-pip + - name: flexmock + how: shell + script: pip3 install flexmock diff --git a/plans/git_reference.py b/plans/git_reference.py new file mode 100644 index 0000000..29b8721 --- /dev/null +++ b/plans/git_reference.py @@ -0,0 +1,14 @@ +#!/usr/bin/python + +import subprocess +from pathlib import Path + +import fmf + +tree_root = Path.cwd().absolute() +node = fmf.Tree(tree_root).find("/plans") +with node as data: + data["discover"]["url"] = "https://github.com/packit/specfile.git" + data["discover"]["ref"] = ( + subprocess.check_output(["git", "rev-parse", "HEAD"]).decode().strip() + ) diff --git a/plans/main.fmf b/plans/main.fmf new file mode 100644 index 0000000..39217f6 --- /dev/null +++ b/plans/main.fmf @@ -0,0 +1,6 @@ +discover: + how: fmf + url: https://github.com/packit/specfile.git + ref: 42dc29249c577e6adfadca0d0a7953c3ffcd4a67 +execute: + how: tmt diff --git a/plans/smoke.fmf b/plans/smoke.fmf new file mode 100644 index 0000000..578e8ba --- /dev/null +++ b/plans/smoke.fmf @@ -0,0 +1,4 @@ +summary: + Basic smoke test +discover+: + filter: tier:0 diff --git a/python-specfile.spec b/python-specfile.spec new file mode 100644 index 0000000..5349c96 --- /dev/null +++ b/python-specfile.spec @@ -0,0 +1,94 @@ +%if 0%{?rhel} == 9 +# RHEL 9 is missing python-flexmock +%bcond_with tests +%else +%bcond_without tests +%endif + + +%global desc %{expand: +Python library for parsing and manipulating RPM spec files. +Main focus is on modifying existing spec files, any change should result +in a minimal diff.} + + +Name: python-specfile +Version: 0.6.0 +Release: 1%{?dist} + +Summary: A library for parsing and manipulating RPM spec files +License: MIT +URL: https://github.com/packit/specfile + +Source0: %{pypi_source specfile} + +BuildArch: noarch + +BuildRequires: python%{python3_pkgversion}-devel + + +%description +%{desc} + + +%package -n python%{python3_pkgversion}-specfile +Summary: %{summary} + + +%description -n python%{python3_pkgversion}-specfile +%{desc} + + +%prep +%autosetup -p1 -n specfile-%{version} +# Use packaged RPM python bindings downstream +sed -i 's/rpm-py-installer/rpm/' setup.cfg + + +%generate_buildrequires +%pyproject_buildrequires %{?with_tests: -x testing} + + +%build +%pyproject_wheel + + +%install +%pyproject_install +%pyproject_save_files specfile + + +%if 0%{?with_tests} +%check +%pytest +%endif + + +%files -n python%{python3_pkgversion}-specfile -f %{pyproject_files} +%doc README.md + + +%changelog +* Thu Aug 25 2022 Nikola Forró - 0.6.0-1 +- New upstream release 0.6.0 + +* Tue Aug 09 2022 Nikola Forró - 0.5.1-1 +- New upstream release 0.5.1 + +* Thu Jul 21 2022 Nikola Forró - 0.5.0-1 +- New upstream release 0.5.0 + +* Thu Jun 16 2022 Nikola Forró - 0.4.0-1 +- New upstream release 0.4.0 + +* Tue May 10 2022 Nikola Forró - 0.3.0-1 +- New upstream release 0.3.0 + +* Wed Mar 30 2022 Nikola Forró - 0.2.0-1 +- New upstream release 0.2.0 + +* Mon Feb 21 2022 Nikola Forró - 0.1.1-1 +- New upstream release 0.1.1 + +* Tue Feb 08 2022 Nikola Forró - 0.1.0-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..4bbf891 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (specfile-0.6.0.tar.gz) = 8115bce63d8a2ab695f6a3db213f3e3d448581ed92c95f7f37dc671caf4760c03aa7b81e0031b8db8fc9b21984b4e2712c85d63951908bb112b4f6ec121d48bc