summaryrefslogtreecommitdiff
path: root/development/install_as_non_root.mdwn
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2015-02-08 14:44:34 +0100
committerGuido Günther <agx@sigxcpu.org>2015-02-08 14:44:34 +0100
commit430e2306395f883d4c5dd9c2ebf7fae222f2ecaf (patch)
tree510ccc1bc918a1ad8e078d37407ed669c29ea28c /development/install_as_non_root.mdwn
parent495d0ad337c0ada26dc01ccc8f2a55a7d04a2a12 (diff)
Link from index
Diffstat (limited to 'development/install_as_non_root.mdwn')
-rw-r--r--development/install_as_non_root.mdwn81
1 files changed, 81 insertions, 0 deletions
diff --git a/development/install_as_non_root.mdwn b/development/install_as_non_root.mdwn
new file mode 100644
index 0000000..eb33096
--- /dev/null
+++ b/development/install_as_non_root.mdwn
@@ -0,0 +1,81 @@
+# Developing as non root
+
+Many examples tell you to do things like
+
+ sudo python setup.py install
+
+or
+
+ sudo gem install foo
+
+or
+
+ ./configure --prefix=/
+ make install
+
+While this is o.k. if you know what you're doing and you give a crap
+about package management risking to break other scripts and tools by
+introducint new library versions it is often much better to not install
+the libraries into a location where other tools can setp on it
+(e.g. /usr/lib, /usr/bin or /usr/local/\*).
+
+## Ruby
+
+Use bundler to pull Gems from [rubygems.org](http://rubygems.org). The *Gemfile*
+describes what you want to pull in:
+
+ group :development, :test do
+ gem 'puppetlabs_spec_helper', :require => false
+ gem 'puppet-lint', :require => false
+ gem 'puppet', puppetversion, :require => false
+ gem 'rake', '~> 10.1.0', :require => false
+ gem 'rspec-puppet', :require => false
+ gem 'simplecov', :require => false
+ end
+
+With that in place you can run
+
+ sudo apt-get install bundler
+ bundle install --path=vendor
+
+and it will fetch the gems and put them into vendor/. No cluttering of
+any directories outside your project. You can run commands from that via
+
+ bundle exec <cmd>
+
+e.g.
+
+ bundle exec rake spec
+
+## NodeJS
+
+npm
+
+## GNOME
+
+jhbuild
+
+## Generic C/C++ project
+
+For a limited set of libs you can do:
+
+ PREFIX=$PWD/../installed
+ ./configure --prefix=$PREFIX
+ make install
+ export LD_LIBRARY_PATH=$PREFIX
+
+see e.g. libplanfahr's ./run
+
+## Python
+
+For Python there's virtualenv
+
+ virtualenv newtestenv
+ source newtestenv/bin/activate
+
+From there on you can use the new environment already, e.g. install a module into it:
+
+ cd mymodule
+ python setup.py install
+
+This would install the module (along with it's dependenies) into you new *testenv*.