Skip to content

Commit 03c0509

Browse files
committed
Review spec file
1 parent be5d077 commit 03c0509

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

python-icat.spec

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
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

1113
Name: python-icat
@@ -17,7 +19,9 @@ License: Apache-2.0
1719
Group: Development/Libraries/Python
1820
Source: https://github.com/icatproject/python-icat/releases/download/%{version}/python-icat-%{version}.tar.gz
1921
BuildRequires: python%{pyversfx}-base >= 3.4
22+
BuildRequires: python%{pyversfx}-pip
2023
BuildRequires: python%{pyversfx}-setuptools
24+
BuildRequires: python%{pyversfx}-wheel
2125
BuildRequires: fdupes
2226
BuildRequires: python-rpm-macros
2327
BuildArch: 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
7579
for f in `ls %{buildroot}%{_bindir}`
7680
do
7781
mv %{buildroot}%{_bindir}/$$f %{buildroot}%{_bindir}/$${f%%.py}
@@ -83,7 +87,7 @@ done
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
@@ -107,7 +111,7 @@ done
107111

108112
%files -n python%{pyversfx}-icat
109113
%defattr(-,root,root)
110-
%{python_sitelib}/*
114+
%{python3_sitelib}/*
111115
%{_bindir}/*
112116

113117

0 commit comments

Comments
 (0)