compiling package with pyproject

This commit is contained in:
wang--ge 2023-04-24 17:08:42 +08:00
parent 4546a6f74a
commit 415cb78287
2 changed files with 9 additions and 53 deletions

View File

@ -1,25 +0,0 @@
--- c/setup.py 1970-01-01 08:00:00.000000000 +0800
+++ a/setup.py 2022-11-25 17:53:10.910857335 +0800
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+
+from setuptools import setup
+
+packages = \
+['pyrpm']
+
+package_data = \
+{'': ['*']}
+
+if __name__ == "__main__":
+ setup(
+ name = "python-rpm-spec",
+ version = "0.14.1",
+ description='python-rpm-spec is a Python library for parsing RPM spec files.',
+ author='Benjamin Kircher',
+ author_email='bkircher@0xadd.de',
+ url='https://github.com/bkircher/python-rpm-spec',
+ packages=packages,
+ package_data=package_data,
+ python_requires='>=3.3',
+ )

View File

@ -3,12 +3,11 @@
Name: python-pyrpm Name: python-pyrpm
Version: 0.14.1 Version: 0.14.1
Release: 1 Release: 2
Summary: python-pyrpm is a Python library for parsing RPM spec files Summary: python-pyrpm is a Python library for parsing RPM spec files
License: MIT License: MIT
URL: https://github.com/bkircher/%{repo_name} URL: https://github.com/bkircher/%{repo_name}
Source0: https://files.pythonhosted.org/packages/a8/35/b00d2a67f5116f6690db70c915f0c58d190174d585b7171f007110d28b1e/python-rpm-spec-0.14.1.tar.gz Source0: https://files.pythonhosted.org/packages/a8/35/b00d2a67f5116f6690db70c915f0c58d190174d585b7171f007110d28b1e/python-rpm-spec-0.14.1.tar.gz
Patch0: 0001-add-setup.py.patch
BuildArch: noarch BuildArch: noarch
%description %description
@ -20,7 +19,7 @@ information that is contained in the spec file.
Summary: python3-pyrpm is a Python 3 library for parsing RPM spec files Summary: python3-pyrpm is a Python 3 library for parsing RPM spec files
Provides: python-rpm-spec = %{version}-%{release} Provides: python-rpm-spec = %{version}-%{release}
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-setuptools BuildRequires: python3-pip python3-wheel python3-flit
%if %{with tests} %if %{with tests}
BuildRequires: python3-pytest BuildRequires: python3-pytest
%endif %endif
@ -37,47 +36,29 @@ It is a Python 3 library for python-pyrpm.
%autosetup -n python-rpm-spec-%{version} %autosetup -n python-rpm-spec-%{version}
%build %build
%py3_build %pyproject_build
%install %install
%py3_install %pyproject_install python-rpm-spec==%{version}
install -d -m755 %{buildroot}/%{_pkgdocdir} install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
#if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%check %check
%if %{with tests} %if %{with tests}
py.test-%{python3_version} -vv tests || : py.test-%{python3_version} -vv tests || :
%endif %endif
%files -n python3-pyrpm -f filelist.lst %files -n python3-pyrpm
%dir %{python3_sitelib}/* %{python3_sitelib}/*
%license LICENSE %license LICENSE
%doc README.md AUTHORS examples %doc README.md AUTHORS examples
%changelog %changelog
* Mon Apr 24 2023 Ge Wang <wang__ge@126.com> - 0.14.1-2
- Use pyproject to compile package
* Tue Apr 11 2023 Ge Wang <wang--ge@126.com> - 0.14.1-1 * Tue Apr 11 2023 Ge Wang <wang--ge@126.com> - 0.14.1-1
- Update package to version 0.14.1 - Update package to version 0.14.1