From 16f9022e6aee49f45f0cd78feebd4960ed967ff3 Mon Sep 17 00:00:00 2001 From: Jason Shepherd Date: Wed, 22 May 2024 15:54:26 +1000 Subject: [PATCH] build srpm --- osidb_bindings.spec | 58 ++++++++++++++++++++++++++++++++++++++++++ scripts/build_srpms.sh | 13 ++++++++++ scripts/push-rpms.sh | 4 +++ setup.py | 2 +- 4 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 osidb_bindings.spec create mode 100755 scripts/build_srpms.sh create mode 100755 scripts/push-rpms.sh diff --git a/osidb_bindings.spec b/osidb_bindings.spec new file mode 100644 index 0000000..a4e0a8d --- /dev/null +++ b/osidb_bindings.spec @@ -0,0 +1,58 @@ +%define name osidb_bindings +%define version 3.6.0 +%define release 0%{?dist} + +Name: %{name} +Version: %{version} +Release: %{release} +Summary: OSIDB Python Bindings + +URL: https://github.com/RedHatProductSecurity/osdib-bindings +Source0: %{name}-%{version}.tar.gz +License: MIT +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot + +BuildArch: noarch +AutoReqProv: no +BuildRequires: python3-devel +BuildRequires: python3-wheel +BuildRequires: tox +BuildRequires: python3-tox-current-env +Requires: python3-aiohttp +Requires: python3-attrs +Requires: python3-dateutil +Requires: python3-requests +Requires: python3-requests-gssapi + + +%description +Python Client bindings for OSIDB + +%prep +%autosetup -n %{name}-%{version} -p1 + +%generate_buildrequires + +%pyproject_buildrequires + + +%build +%pyproject_wheel + +%install +%pyproject_install + +%pyproject_save_files %{name} + +%check +%tox + +%files -n %{name} -f %{pyproject_files} +%ghost %{python3_sitelib}/tests/* + +%changelog +* Wed May 22 2024 Jason - 3.6.0 +- RPM packing for osidb_bindings added + + + diff --git a/scripts/build_srpms.sh b/scripts/build_srpms.sh new file mode 100755 index 0000000..7e62cf9 --- /dev/null +++ b/scripts/build_srpms.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + + +#cleanup build dirs +rm -r dist/ ~/rpmbuild/SOURCES/* ~/rpmbuild/SRPMS/* || true + +mkdir dist +python3 setup.py clean sdist +cp dist/* ~/rpmbuild/SOURCES/ +rpmbuild --undefine dist -bs "osidb_bindings.spec" --clean + diff --git a/scripts/push-rpms.sh b/scripts/push-rpms.sh new file mode 100755 index 0000000..0a855b2 --- /dev/null +++ b/scripts/push-rpms.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +#submit SRPMs to copr +copr-cli build --nowait jazinner/osidb-bindings ~/rpmbuild/SRPMS/* diff --git a/setup.py b/setup.py index 63f7740..7b9d34b 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ long_description = fh.read() setup( - name="osidb-bindings", + name="osidb_bindings", version="3.7.0", author="Jakub Frejlach, Red Hat Product Security", author_email="jfrejlac@redhat.com",