Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework of build system to use more modern standards #153

Merged
merged 16 commits into from
Sep 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "Fix builds on EPELs due to outdated components"
This reverts commit a4b4aa9.
  • Loading branch information
SlouchyButton committed Sep 25, 2024
commit 92abd9043bd07bed15f271815d9f25158c1a8e98
182 changes: 0 additions & 182 deletions rpm/BUILT-Fix-builds-on-EPEL8-due-to-outdated-components.patch

This file was deleted.

100 changes: 0 additions & 100 deletions rpm/BUILT-Fix-builds-on-EPEL9-due-to-outdated-components.patch

This file was deleted.

68 changes: 9 additions & 59 deletions rpm/distgen.spec.dg
Original file line number Diff line number Diff line change
@@ -10,93 +10,43 @@ URL: https://github.com/devexp-db/distgen
BuildArch: noarch

BuildRequires: python3-devel
BuildRequires: python3-pytest

%if 0%{?rhel} != 8
BuildRequires: pyproject-rpm-macros
%endif

%if 0%{?rhel} >= 8
BuildRequires: python3-setuptools
BuildRequires: python3-tomli
BuildRequires: python3-jinja2
BuildRequires: python3-PyYAML
BuildRequires: python3-distro
%endif

%if 0%{?rhel} == 8
BuildRequires: python3-importlib-metadata
%endif
BuildRequires: python3-pytest

Source0: https://pypi.org/packages/source/d/%name/%name-%version.tar.gz

Patch0: BUILT-Fix-builds-on-EPEL8-due-to-outdated-components.patch
Patch1: BUILT-Fix-builds-on-EPEL9-due-to-outdated-components.patch

%description
Based on given template specification (configuration for template), template
file and preexisting distribution metadata generate output file.

%prep
%autosetup -N

%if 0%{?rhel} == 8
%patch -p1 -P 0
%endif

%if 0%{?rhel} == 9
%patch -p1 -P 1
%endif

%prep
%autosetup -p1

%if 0%{?rhel} != 8
%generate_buildrequires
%pyproject_buildrequires -x pytest,pytest-catchlog,pytest-cov,coverage,flake8,pyyaml
%endif
%pyproject_buildrequires -x pytest,pytest-catchlog,pytest-cov,coverage,flake8
SlouchyButton marked this conversation as resolved.
Show resolved Hide resolved


%build
%if 0%{?rhel} == 8
ls -la
%__python3 setup.py build
%else
%pyproject_wheel
%endif


%install
%if 0%{?rhel} == 8
%__python3 setup.py install --root=%{buildroot}
mkdir -p %{buildroot}%{_datadir}/distgen
mv %{buildroot}%{python3_sitelib}/distgen/{distconf,templates} %{buildroot}%{_datadir}/distgen
%else
%pyproject_install
%pyproject_save_files distgen
%endif


%check
%if 0%{?rhel} == 8
%__python3 -m pytest tests/unittests/
%else
%pytest tests/unittests/
%endif

%if 0%{?rhel} == 8
%files
%license LICENSE
%doc NEWS
%doc docs/
%{_bindir}/dg
%{python3_sitelib}/distgen
%{python3_sitelib}/%{name}-*.egg-info
%{_datadir}/%{name}
%{_mandir}/man1/*
%else

%files -f %{pyproject_files}
%license LICENSE
%doc NEWS
%doc docs/
%{_bindir}/dg
%{_mandir}/man1/*
%endif


%changelog
* Wed Mar 21 2018 Pavel Raiskup <praiskup@redhat.com> - {{ m.VERSION }}-{{ m.RELEASE }}