Skip to content

Commit

Permalink
build srpm
Browse files Browse the repository at this point in the history
  • Loading branch information
jasinner committed May 28, 2024
1 parent 06f6e48 commit 1d339ff
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .copr/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
srpm:
@echo ">Building SRPM"
scripts/build_srpm.sh
58 changes: 58 additions & 0 deletions osidb_bindings.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
%define name osidb_bindings
%define version 3.7.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 <[email protected]> - 3.6.0
- RPM packing for osidb_bindings added



13 changes: 13 additions & 0 deletions scripts/build_srpms.sh
Original file line number Diff line number Diff line change
@@ -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

3 changes: 3 additions & 0 deletions scripts/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ update_version() {
echo "Updating the CHANGELOG.md to ${version}"
sed -i 's/^## Unreleased.*/## Unreleased\n\n## ['"${version}"'] - '$(date '+%Y-%m-%d')'/' CHANGELOG.md

echo "Updating the osidb_bindings.spec to ${version}"
sed -i 's/^%define version [0-9]*\.[0-9]*\.[0-9]*/%define version '${version}'/g' osidb_bindings.spec

echo
}

Expand Down
5 changes: 5 additions & 0 deletions scripts/push_rpms.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

# Manually submit SRPMs to copr
# Builds are triggered on Github tag events, so this script is not used in the automated build flow.
copr-cli build --nowait jazinner/osidb-bindings ~/rpmbuild/SRPMS/*
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected]",
Expand Down

0 comments on commit 1d339ff

Please sign in to comment.