1- %if 0%{?sle_version } >= 150500
1+ %if 0%{?suse_version } >= 1600
2+ %global pyversfx 313
3+ %global pythons python313
4+ %else
5+ %if 0%{?sle_version } >= 150500 && 0%{?is_opensuse }
26%global pyversfx 311
3- %global python %__python311
4- %global python_sitelib %python311_sitelib
7+ %global __python3 %__python311
58%else
69%global pyversfx 3
7- %global python %__python3
8- %global python_sitelib %python3_sitelib
10+ %endif
911%endif
1012
1113Name: python-icat
@@ -17,7 +19,9 @@ License: Apache-2.0
1719Group: Development/Libraries/Python
1820Source: https://github.com/icatproject/python-icat/releases/download/%{version }/python-icat-%{version }.tar.gz
1921BuildRequires: python%{pyversfx }-base >= 3.4
22+ BuildRequires: python%{pyversfx }-pip
2023BuildRequires: python%{pyversfx }-setuptools
24+ BuildRequires: python%{pyversfx }-wheel
2125BuildRequires: fdupes
2226BuildRequires: python-rpm-macros
2327BuildArch: noarch
@@ -63,15 +67,15 @@ $long_description
6367
6468
6569%prep
66- %setup -q -n %{ name }-%{ version }
70+ %setup -q
6771
6872
6973%build
70- %{ python } setup.py build
74+ %pyproject_wheel
7175
7276
7377%install
74- %{ python } setup.py install --optimize=1 --prefix=%{ _prefix } --root=%{ buildroot }
78+ %pyproject_install
7579for f in ` ls %{buildroot}%{_bindir}`
7680do
7781 mv %{buildroot}%{_bindir}/$$ f %{buildroot}%{_bindir}/$$ {f%%.py}
8387%__install -d -m 755 %{buildroot }%{_docdir }/%{name }
8488%__cp -pr README.rst CHANGES.rst doc/* %{buildroot }%{_docdir }/%{name }
8589%__chmod -f a-x %{buildroot }%{_docdir }/%{name }/examples/* .py
86- %fdupes %{buildroot }%{python_sitelib }
90+ %fdupes %{buildroot }%{python3_sitelib }
8791
8892
8993%files
107111
108112%files -n python%{pyversfx }-icat
109113%defattr(-,root,root)
110- %{python_sitelib }/*
114+ %{python3_sitelib }/*
111115%{_bindir }/*
112116
113117
0 commit comments