Creating a binary only python distribution of a C extension moduleand including some additional pyth

Discussion in 'Python' started by akhilesh singhania, Jan 1, 2012.

  1. Hi,

    I have a extension module in C which I want to distribute in binary
    format, ideally an rpm. Additionally, I want to include some python
    files (examples on how to use the extension module) and source for a
    library the module dynamically links to (c,h, and make files).

    How do I specify the example python file in setup.py so that it will
    be included in the rpm?

    If I specify it as scripts, I get the following error:

    $ python setup.py bdist --format=rpm

    running build_scripts
    creating build/scripts-2.6
    error: file 'foo.py' does not exist
    error: Bad exit status from /var/tmp/rpm-tmp.yjws9x (%build)
    If I specify it as data_files, I get the following error:

    $ python setup.py bdist --format=rpm

    error: Installed (but unpackaged) file(s) found:
    /usr/foo.pyc
    /usr/foo.pyo
    If I specify it as py_modules, I do not get errors but it is not
    included in the resulting rpm.

    Specifying it as a script works if I use

    $ python setup.py bdist --format=gztar
    Additionally, can I control the hierarchy of how the files are laid
    out in the rpm?

    Currently, I am specifying the c,h,make files as data_files and they
    get placed in /usr, which is not desirable.

    Regards,
    akhi
     
    akhilesh singhania, Jan 1, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SnaiL
    Replies:
    5
    Views:
    442
    Matthias Kaeppler
    Apr 19, 2005
  2. shailesh
    Replies:
    4
    Views:
    979
    shailesh
    Oct 13, 2007
  3. llothar
    Replies:
    17
    Views:
    1,279
    Steve Holden
    Apr 7, 2008
  4. andrew cooke
    Replies:
    2
    Views:
    485
    Tom Zych
    Feb 27, 2011
  5. akhilesh singhania
    Replies:
    0
    Views:
    210
    akhilesh singhania
    Dec 30, 2011
Loading...

Share This Page