Skip to content

Loading…

python: customize the --install-data option for setup.py #255

Merged
merged 1 commit into from

3 participants

@zllak

Give the possibility to specify from command line where to install the
data. Data were installed in the 'lib' directory, which is still the
default setting if not explicitely changed, for backward compatibility.
A more "normal" data directory would be /usr or /usr/share, also
depending on the target OS.

@zllak zllak python: customize the --install-data option for setup.py
Give the possibility to specify from command line where to install the
data. Data were installed in the 'lib' directory, which is still the
default setting if not explicitely changed, for backward compatibility.
A more "normal" data directory would be /usr or /usr/share, also
depending on the target OS.
ad7f395
@travisbot

This pull request fails (merged ad7f395 into f3bf4af).

@jordansissel jordansissel merged commit 0ea8c73 into jordansissel:master
@jordansissel
Owner

Awesome, thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 30, 2012
  1. @zllak

    python: customize the --install-data option for setup.py

    zllak committed
    Give the possibility to specify from command line where to install the
    data. Data were installed in the 'lib' directory, which is still the
    default setting if not explicitely changed, for backward compatibility.
    A more "normal" data directory would be /usr or /usr/share, also
    depending on the target OS.
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/fpm/package/python.rb
View
7 lib/fpm/package/python.rb
@@ -47,6 +47,8 @@ class FPM::Package::Python < FPM::Package
"Want to what your target platform is using? Run this: " \
"python -c 'from distutils.sysconfig import get_python_lib; " \
"print get_python_lib()'"
+ option "--install-data", "DATA_PATH", "The path to where data should be " \
+ "installed to."
private
@@ -188,13 +190,16 @@ def install_to_staging(setup_py)
@logger.info("Setting default :python_install_lib attribute",
:value => attributes[:python_install_lib])
end
+ if attributes[:python_install_data].nil?
+ attributes[:python_install_data] = attributes[:python_install_lib]
+ end
# Some setup.py's assume $PWD == current directory of setup.py, so let's
# chdir first.
::Dir.chdir(project_dir) do
safesystem(attributes[:python_bin], "setup.py", "install",
"--root", staging_path,
"--install-lib", File.join(prefix, attributes[:python_install_lib]),
- "--install-data", File.join(prefix, attributes[:python_install_lib]),
+ "--install-data", File.join(prefix, attributes[:python_install_data]),
"--install-scripts", File.join(prefix, attributes[:python_install_bin]))
end
end # def install_to_staging
Something went wrong with that request. Please try again.