how to include a .so file in my python rpm
by Erik Blankinship
In my python application, I need to include a .so binary I built of a custom
gstreamer plugin. My python application works fine with this plugin when
launching from the command line.
Now that I am packaging my python application into a fedora rpm, I need to
compile the plugin as part of the packaging process?
I ask because when I try to include the .so file in %files and part of the
manifest, I get this error from rpmbuild:
"arch dependent binaries in noarch package"
Could someone point me to an example of how to create a spec file which
shows how to include "nested" c code so as to avoid this error and
successfully build my rpm?
Thanks much. Erik
12 years, 4 months
how to include lots of media assets into a python rpm?
by Erik Blankinship
I have a lot of media assets to include in my python rpm. I am confused as
to the best way to include these files in my rpm.
Here is my setup:
setup.py
sun.py
gfx/sun_1.png
gfx/sun_2.png
gfx/sun_3.png
gfx/core/core_1.png
gfx/core/core_2.png
...
gfx/core/core_99.png
I list everything I want to include in my manifest.in file with:
recursive-include gfx *.png
and when I make a source tar.gz ( via python setup.py bdist --format=rpm )
all of the media assets are included in the resultant tar.gz bundle.
Then I move the source tar.gz into ~/rpmbuild/SOURCES/ and then I run rpmbuild
-ba SunnyApp.spec
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.
12 years, 4 months
best practices for python applications targeting f11 gnome on the olpc xo
by Erik Blankinship
What would be the best practice for python applications targeting f11 gnome
on the olpc xo?
I am developing on f13, but my target is f11 (an olpc xo machine) running
python 2.6.
The rpms I am generating have the name:
SunnyApp-1.1-1.fc13.noarch.rpm
Two things here stand out to me (the very new rpm packager) which suggest I
have not done a great job targeting my platform.
1. fc13
2. noarch
I would like to make sure the rpms are as compatible as possible with that
platform.
Also, I have some code in my application which is python 2.6 specific -- is
there a way to designate/enforce that in the file to ensure it runs
smoothly?
Thank you!
12 years, 4 months
packing an rpm without source code?
by Erik Blankinship
Can someone point me at an example of how to package a fedora python rpm
without the source code (only the .pyc or .pyo files)?
Would I make this change in my spec file?
Thank you for your help.
12 years, 4 months
FYI: Python-2.7 distutils incompatibility
by Toshio Kuratomi
I mentioned this to dmalcolm as a possible bug on IRC and as I figured out
what's going on I felt I should share with others that might run into this.
In python-2.7, an incompatibility was introduced in what is allowed to be in
a setup.py file. A setup.py looks something like this::
#!/usr/bin/python -tt
# -*- coding: utf-8 -*-
from distutils.core import setup
setup(name='test',
version='1.0',
description='Test',
author='Toshio Kuratomi',
author_email='toshio(a)fp.o',
license='MIT',
url='http://localhost/',
download_url='http://localhost/',
keywords='test',
classifiers=[
'Development Status :: 3 - Alpha',
],
)
In python-2.7, the values of those entries to the setup function cannot be
unicode strings. They must be byte strings (str type). This is true even
if the value is all ASCII. For instance, this is invalid::
setup(name=u'test', [...]
Although this is a change in behaviour from earlier python versions, it is
now a documented behaviour (see the notes section of this link:
http://docs.python.org/distutils/setupscript.html#additional-meta-data ) so
it's not a bug, it's a feature ;-)
-Toshio
12 years, 4 months