Re: python - app packaging - wrapper script ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: pgp645XalC8zC.pgp
Description: PGP signature

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux