David Timms wrote: > Hi, I'm packaging a python based app [1], that I want to make a > wrapper script [2] {or similar} for, so the app can start from a > normal user terminal, with just the script name. > > I have had a couple of goes, but I'm not getting it. It's supposed > to detect the appropriate lib/lib64 directory, append the > site-lib/appfolder path, and call the python app. Any pythonites > know a solution ? I haven't read the bugzilla entry nor had my tea yet today, but here's what I've done for some python apps: #!/bin/sh sitelib=`python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"` exec python $sitelib/appdir/appname.py "$@" Replace appdir and appname appropriately, put it in /usr/bin/appname, and make it executable. If the software you are packaging installs arch dependent files, you will probably need to replace the sitelib call to: sitelib=`python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)"` Notice the 1 in get_python_lib() there. That tells python to return the arch specific lib dir. -- Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ There are three ways to get something done: do it yourself, hire someone, or forbid your kids to do it. -- Monta Crane
Attachment:
pgplBgra0p8HC.pgp
Description: PGP signature
-- fedora-list mailing list fedora-list@xxxxxxxxxx To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list