Reputation: 44343
I'm using setuptools to create an egg and I would like to include some supporting binaries with it, preferably to be installed in the egg directory.
I can include these files with data_files
or package_data
however the executable bit is not set when they are deployed.
Alternatively, I can use scripts
but then they will (by default) be deployed to a common directory that is shared by all other packages, which I would like to avoid.
How can I deploy these binaries with my package and ensure their file modes are preserved?
Upvotes: 4
Views: 769
Reputation: 43024
The usual (standard) place to put supporting binaries in Linux is in /usr/libexec
. So you can make a directory under that with the the data_files option. Make the files +x in your source and the permissions should be preserved. Just put something like
data_files=[(os.path.join(sys.prefix, 'libexec', 'myproject'), glob("libexec/*"))],
In your setup function, and a libexec
directory in your project.
Upvotes: 3