Mailinglist Archive: opensuse-packaging (31 mails)

< Previous Next >
[opensuse-packaging] Separating python modules into packages
  • From: Axel Braun <axel.braun@xxxxxx>
  • Date: Fri, 27 Sep 2019 08:15:49 +0200
  • Message-id: <3556250.vYBkLhDxD1@southpole>
Morning all,

I need to separate one module from a build of a python package into a separate
package.
This is usually not a big act, e.g. in C-programs. Python packaging seems to
be different from that

What normally happens is that you have a file section with:

%files
[some more definitions]
%{python_sitelib}/*

Where the last command puts everything under /usr/lib/python3.x/....
Done.

After having defined a new package in the spec file I wanted to separate the
files:
%files -n %{name}-orthanc
%{python_sitelib}/health-orthanc*

-> This results in a 'file not found error':
[ 34s] /home/abuild/rpmbuild/BUILDROOT/gnuhealth-3.5-0.x86_64/health-
orthanc*

No surprise, as this is not the location for the module.
So, I've defined a variable to keep the path:
%define t_path $(ls -d /usr/lib/python3.* )/site-packages/trytond/modules

that expands nicely e.g. in the Installation section:
echo %{t_path}
[ 29s] ++ ls -d /usr/lib/python3.6
[ 29s] + echo /usr/lib/python3.6/site-packages/trytond/modules
[ 29s] /usr/lib/python3.6/site-packages/trytond/modules
but in the files section:

%files -n %{name}-orthanc
%{t_path}/health-orthanc*

[ 38s] Processing files: gnuhealth-orthanc-3.5-0.noarch
[ 38s] error: File must begin with "/": $(ls
[ 38s] error: File must begin with "/": -d
[ 38s] error: File must begin with "/": )/site-packages/trytond/modules/
health-orthanc*

At the moment I'm a bit stuck.
Anyone with a better idea or an example?

Thanks
Axel


--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-packaging+owner@xxxxxxxxxxxx

< Previous Next >
List Navigation
Follow Ups