Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 232596 - dev-python/empy - ebuild enhancements
Summary: dev-python/empy - ebuild enhancements
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 232575
  Show dependency tree
 
Reported: 2008-07-21 20:54 UTC by René 'Necoro' Neumann
Modified: 2008-07-30 22:49 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
empy-3.3.ebuild.diff #1 (empy-3_bin.diff,1007 bytes, patch)
2008-07-21 20:57 UTC, René 'Necoro' Neumann
Details | Diff
empy-3.3.ebuild.diff #2 (empy-3_link.diff,855 bytes, patch)
2008-07-21 20:58 UTC, René 'Necoro' Neumann
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description René 'Necoro' Neumann 2008-07-21 20:54:53 UTC
The ebuilds of dev-python/empy have the issues, that they
- don't call python_mod_{optimize,cleanup}
- use /usr/lib/ instead of /usr/$(get_libdir)/

As I don't know the best way to fix it, I used two different ones. The package maintainers can chose the one they prefer :).
The two patches can be applied to both ebuilds, as they only differ slightly

This bug should block bug #232575 .
Comment 1 René 'Necoro' Neumann 2008-07-21 20:57:44 UTC
Created attachment 161038 [details, diff]
empy-3.3.ebuild.diff #1

This is the first variant: It directly installs the em.py into /usr/bin instead of messing around with distutils and linking.
This also removes the necessity of having to deal with the issues in comment #0.

Disadvantage: Can't be imported as a module anymore. Though I don't know if this is wanted at all.
Comment 2 René 'Necoro' Neumann 2008-07-21 20:58:59 UTC
Created attachment 161042 [details, diff]
empy-3.3.ebuild.diff #2

And this is the second approach: It handles everything the same way as the original ebuild, but fixes the issues mentioned in comment #0.
Comment 3 Rob Cakebread (RETIRED) gentoo-dev 2008-07-30 21:59:42 UTC
Thanks for the patches, Rene.

I went with your second way, but by setting PYTHON_MODNAME="em.py" I could remove the python_mod_{optimize,cleanup} bits. The eclass tries to find the module from PN, but if it can't, we can manually set it with PYTHON_MODNAME.

Also, I added a src_test() and a doc USE flag.

Added to CVS.
Comment 4 René 'Necoro' Neumann 2008-07-30 22:21:24 UTC
The PYTHON_MODNAME is not going to work with pkg_postrm ... (it's not like I haven't thought about it before worked on this ebuild ;))...

If you look in distutils.eclass -- it will do:
for pymod in ${PYTHON_MODNAME}; do
    for moddir in "`ls -d --color=none -1 ${ROOT}usr/$(get_libdir)/python*/site-packages/${pymod} 2> /dev/null`"; do
        python_mod_cleanup ${moddir}
    done
done

The ls-command will return the file ($SITEDIR/em.py), which is passed to python_mod_cleanup. python_mod_cleanup will do:

for obj in $(find ${path} -name '*.py[co]'); do cleanup; done

But as $path is a file here - this find-command will return nothing. And thus the files aren't cleaned correctly.

(I don't know if this is a big issue - but it exists ;))
Comment 5 René 'Necoro' Neumann 2008-07-30 22:49:00 UTC
Nevermind ... I used your approach --- and it worked.
So - obviously I missed something (perhaps some bash magic in the eclasses)