Skip to content
This repository
Browse code

Merge pull request #255 from zllak/feature/python/install_data

python: customize the --install-data option for setup.py
  • Loading branch information...
commit 0ea8c73b1840c1f4ce46ce128c897f19a06d5851 2 parents 649b47c + ad7f395
Jordan Sissel authored September 06, 2012

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. 7  lib/fpm/package/python.rb
7  lib/fpm/package/python.rb
@@ -47,6 +47,8 @@ class FPM::Package::Python < FPM::Package
47 47
     "Want to what your target platform is using? Run this: " \
48 48
     "python -c 'from distutils.sysconfig import get_python_lib; " \
49 49
     "print get_python_lib()'"
  50
+  option "--install-data", "DATA_PATH", "The path to where data should be " \
  51
+    "installed to."
50 52
 
51 53
   private
52 54
 
@@ -188,13 +190,16 @@ def install_to_staging(setup_py)
188 190
       @logger.info("Setting default :python_install_lib attribute",
189 191
                    :value => attributes[:python_install_lib])
190 192
     end
  193
+    if attributes[:python_install_data].nil?
  194
+      attributes[:python_install_data] = attributes[:python_install_lib]
  195
+    end
191 196
     # Some setup.py's assume $PWD == current directory of setup.py, so let's
192 197
     # chdir first.
193 198
     ::Dir.chdir(project_dir) do
194 199
       safesystem(attributes[:python_bin], "setup.py", "install",
195 200
                  "--root", staging_path, 
196 201
                  "--install-lib", File.join(prefix, attributes[:python_install_lib]),
197  
-                 "--install-data", File.join(prefix, attributes[:python_install_lib]),
  202
+                 "--install-data", File.join(prefix, attributes[:python_install_data]),
198 203
                  "--install-scripts", File.join(prefix, attributes[:python_install_bin]))
199 204
     end
200 205
   end # def install_to_staging

0 notes on commit 0ea8c73

Please sign in to comment.
Something went wrong with that request. Please try again.