[SOLVED] Packaging python : problem with macros : File must begin with "/": %{python3_sitelib}

Hello,
I try to package python3-imdbpy in my repo.
I can build the package on my system sucessfully, but when i try to rebuild the SRPM in my copr repo, i have a build failed.

Example of a line in the %files section :
%{python3_sitelib}/IMDbPY-%{version}-py%{python3_version}.egg-info/PKG-INFO
Error by buildsystem is :
File must begin with "/": %{python3_sitelib}/IMDbPY-2021.4.18-py%{python3_version}.egg-info/PKG-INFO

What is wrong ?
I don’t understand.

If i replace the line by
/usr/lib/python3.12/site-packages/IMDbPY-%{version}-py3.12.egg-info/PKG-INFO
On copr, the packages build successfully but it’s not clean if the python version is different (i can’t build with all version of fedora one shot)

All info are here : Index of /results/adriend/fedora-apps/fedora-rawhide-x86_64/06742040-python3-imdbpy/

That error means that the %{python3_sitelib} macro is not defined. It isn’t expanded, so the path starts with ‘%’. Add ‘BuildRequires: python3-devel’ to your spec file to get a definition for the macro.

1 Like

Hi, thanks !
it’s th first time i post here because i spend lots of hours to find the solution and i didn’t !
It’s a stupid missing in the SPEC …
Thanks a lot !