Error building python packages

Gents,
I’m building a python package on the OBS, and it gives a strange error. Following the log, it builds some targets:

...
   64s] creating /home/abuild/rpmbuild/BUILDROOT/tryton-2.6.2-5.1.x86_64/usr/share/locale/ja_JP 
   64s] creating /home/abuild/rpmbuild/BUILDROOT/tryton-2.6.2-5.1.x86_64/usr/share/locale/ja_JP/LC_MESSAGES 
   64s] copying share/locale/ja_JP/LC_MESSAGES/tryton.mo -> /home/abuild/rpmbuild/BUILDROOT/tryton-2.6.2-5.1.x86_64/usr/share/locale/ja_JP/LC_MESSAGES 
   64s] creating /home/abuild/rpmbuild/BUILDROOT/tryton-2.6.2-5.1.x86_64/usr/share/locale/lt_LT 
   64s] creating /home/abuild/rpmbuild/BUILDROOT/tryton-2.6.2-5.1.x86_64/usr/share/locale/lt_LT/LC_MESSAGES 
   64s] copying share/locale/lt_LT/LC_MESSAGES/tryton.mo -> /home/abuild/rpmbuild/BUILDROOT/tryton-2.6.2-5.1.x86_64/usr/share/locale/lt_LT/LC_MESSAGES 
   64s] creating /home/abuild/rpmbuild/BUILDROOT/tryton-2.6.2-5.1.x86_64/usr/share/locale/nl_NL 
   64s] creating /home/abuild/rpmbuild/BUILDROOT/tryton-2.6.2-5.1.x86_64/usr/share/locale/nl_NL/LC_MESSAGES 
   64s] copying share/locale/nl_NL/LC_MESSAGES/tryton.mo -> /home/abuild/rpmbuild/BUILDROOT/tryton-2.6.2-5.1.x86_64/usr/share/locale/nl_NL/LC_MESSAGES 
   64s] creating /home/abuild/rpmbuild/BUILDROOT/tryton-2.6.2-5.1.x86_64/usr/share/locale/ru_RU 
   64s] creating /home/abuild/rpmbuild/BUILDROOT/tryton-2.6.2-5.1.x86_64/usr/share/locale/ru_RU/LC_MESSAGES 
   64s] copying share/locale/ru_RU/LC_MESSAGES/tryton.mo -> /home/abuild/rpmbuild/BUILDROOT/tryton-2.6.2-5.1.x86_64/usr/share/locale/ru_RU/LC_MESSAGES 
   64s] creating /home/abuild/rpmbuild/BUILDROOT/tryton-2.6.2-5.1.x86_64/usr/share/locale/sl_SI 
   64s] creating /home/abuild/rpmbuild/BUILDROOT/tryton-2.6.2-5.1.x86_64/usr/share/locale/sl_SI/LC_MESSAGES

It then creates a list of installed files:

...
   64s] copying build/scripts-2.7/tryton -> /home/abuild/rpmbuild/BUILDROOT/tryton-2.6.2-5.1.x86_64/usr/bin 
   64s] changing mode of /home/abuild/rpmbuild/BUILDROOT/tryton-2.6.2-5.1.x86_64/usr/bin/tryton to 755 
   64s] writing list of installed files to 'filelist' 
   64s] + /usr/lib/rpm/brp-compress

…and then uses this file list to check the package:


   77s] ... checking filelist 
   78s] tryton-2.6.2-5.1.x86_64.rpm: directories not owned by a package: 
   78s]  - /usr/share/locale/bg_BG 
   78s]  - /usr/share/locale/bg_BG/LC_MESSAGES 
   78s]  - /usr/share/locale/ca_ES 
   78s]  - /usr/share/locale/ca_ES/LC_MESSAGES 
   78s]  - /usr/share/locale/ja_JP 
   78s]  - /usr/share/locale/ja_JP/LC_MESSAGES 
   78s]  - /usr/share/locale/lt_LT 
   78s]  - /usr/share/locale/lt_LT/LC_MESSAGES 
   78s]  - /usr/share/locale/nl_NL 
   78s]  - /usr/share/locale/nl_NL/LC_MESSAGES 
   79s] /.build/build: line 317:   221 Killed                  background_monitor_process

The check fails just for some of the files, which is strange IMHO.
What can be the reason, and how to get around it?

Hi
Don’t use the file list and create a language package?

Are you using the standard python build?
https://en.opensuse.org/openSUSE:Packaging_Python

That would mean I have to change the standard delivery of tryton. Will be a nice talk with the developers :slight_smile:

Are you using the standard python build?
openSUSE:Packaging Python - openSUSE Wiki

Thats where it started, yes.
The filelist is created with

%install

python setup.py install --prefix=%_prefix --root=%buildroot --record-rpm=filelist

and then used in:


%files -f filelist
%defattr(-,root,root)

Hi, see https://build.opensuse.org/package/rdiff?opackage=tryton&oproject=home%3ADocB%3Apython_packages&package=tryton&project=home%3Afabio_s&rev=5
I had to meddle with autogenerated filelist in order to avoid duplicated file/dir in %file, wrong ownership of some dirs and, first of all, to use appropriate macros for translation files installing (I created a lang rpm file, but of course you can install everything inside tryton main package, if you wish, but %lang macros are important for correctly handling .mo file, and for a particular reason I’m not sure a not-separted rpm lang version could work in this case, IMHO).
Moreover pyc files under /usr/lib/… are just python byte-code, not ELF files → changed rpm arch to noarch.

Next things to do (optional) I think should be: patching setup.py instead of meddling with filelist, if feasible (should be cleaner), and, second, retrieve po files (where?) and fix those mo files that appear to be broken.

Bye

Thanks for your help!
I’ll take a look at it and discuss with the tryton developers.