* [gentoo-dev] Installing python add-on stuff..
@ 2001-07-08 2:20 Jonas Berlin
0 siblings, 0 replies; only message in thread
From: Jonas Berlin @ 2001-07-08 2:20 UTC (permalink / raw
To: gentoo-dev
I have a package providing a .py and a .so file.
When and how should I install these ?
I was thinking of something like this, copying ideas from elsewhere:
DEPEND="... python? (dev-lang/python) ..."
Should this maybe be sys-devel/spython instead ? Should spython be
unmerged if python is merged ?
Then, in the install part:
src_install() {
..
if [ "use python" ] ; then
insinto /usr/lib/python2.0
doins snack.py
insinto /usr/lib/python2.0/lib-dynload
doins _snackmodule.so
fi
..
}
Now I noticed the .py files already in /usr/lib/python2.0/ also have .pyc
and .pyo files with the same name, so I guess they are some kind of
precompiled files.
I found a command like this in some rpm spec file:
python -c 'from compileall import *; \
compile_dir("'$RPM_BUILD_ROOT'/usr/lib/python2.0",10,"/usr/lib/python2.0")'
I would guess this could create the .pyc and .pyo files. Now I don't know
the behaviour of this command, but it would seem like this command would
install stuff from $RPM_BUILD_ROOT/usr/lib/python2.0 to /usr/lib/python2.0,
so this command might not be directly suitable for my need. And what's the
"10" in the parameter list?
Also, how about the version number? Should I do
pythondir=/usr/lib/python`(python -V 2>&1)|sed 's/[^0-9.]//g'`
to get the correct installation location ?
- xkr47
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-07-08 8:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-08 2:20 [gentoo-dev] Installing python add-on stuff Jonas Berlin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox