how to include lots of media assets into a python rpm?

Konstantin Zemlyak zart at zartsoft.ru
Tue Jan 25 03:28:27 UTC 2011


Erik Blankinship wrote:
> Unfortunately, none of the gfx are transfered over.   However, if I
> modify my setup.py as follows:
> 
>     from setuptools import find_packages
> 
>         pkgs = find_packages( )
> 
>         setup(   name='SunnyApp',
>                  ...
>                  data_files=[ ('SunnyApp/gfx', ['gfx/sun_1.png', 'gfx/sun_2.png'] ),
>                               ('SunnyApp/gfx/core', ['gfx/core/core_1.png', 'gfx/core/core_2.png'] ) ],
>                  ...
>                  packages=pkgs,
>                  ....
>                  )
> 
> Only those files that I list make it into the rpm (in this case
> sun_1.png, sun_2.png, core_1.png, core_2.png)  Unfortunately, there does
> not appear to be a way to include *.png for all subdirectories in gfx.
> 
> Is there a way to include lots of files with a pattern when calling
> rpmbuild?  I am not sure how to use package_data to list wildcards
> because of how I am using packages=find_packages( )
> 
> Any suggestions?  Thanks much.

Since it's setuptools-based project use include_package_data=True.
This is documented at
<http://peak.telecommunity.com/DevCenter/setuptools#including-data-files>

-- 
Zart


More information about the python-devel mailing list