Script to install and compile Python, Django, Virtualenv, Mercurial, Git, LessCSS, etc... on Dreamhost
Asked Answered
S

2

6

The Story

After cleaning up my Dreamhost shared server's home folder from all the cruft accumulated over time, I decided to start afresh and compile/reinstall Python. All tutorials and snippets I found seemed overly simplistic, assuming (or ignoring) a bunch of dependencies needed by Python to compile all modules correctly. So, starting from http://andrew.io/weblog/2010/02/installing-python-2-6-virtualenv-and-virtualenvwrapper-on-dreamhost/ (so far the best guide I found), I decided to write a set-and-forget Bash script to automate this painful process, including along the way a bunch of other things I am planning to use.

The Script

I am hosting the script on http://bitbucket.org/tmslnz/python-dreamhost-batch/src/

The TODOs

So far it runs fine, and does all it needs to do in about 900 seconds, giving me at the end of the process a fully functional Python / Mercurial / etc... setup without even needing to log out and back in.

I though this might be of use for others too, but there are a few things that I think it's missing and I am not quite sure how to go for it, what's the best way to do it, or if this just doesn't make any sense at all.

  • Check for errors and break
  • Check for minor version bumps of the packages and give warnings
  • Check for known dependencies
  • Use arguments to install only some of the packages instead of commenting out lines
  • Organise the code in a manner that's easy to update
  • Optionally make the installers and compiling silent, with error logging to file
  • failproof .bashrc modification to prevent breaking ssh logins and having to log back via FTP to fix it

EDIT: The implied question is: can anyone, more bashful than me, offer general advice on the worthiness of the above points or highlight any problems they see with this approach? (see my answer to Ry4an's comment below)

The Gist

I am no UNIX or Bash or compiler expert, and this has been built iteratively, by trial and error. It is somehow going towards apt-get (well, 1% of it...), but since Dreamhost and others obviously cannot give root access on shared servers, this looks to me like a potentially very useful workaround; particularly so with some community work involved.

Slit answered 26/5, 2010 at 14:35 Comment(3)
I don't see a single question mark in that. It looks like you're describing a project you've done and posted your TODO list. If you're really looking for answers instead of feedback perhaps splitting each item in your TODO up into questions and posting them separately will get you the answers for which you're looking.Shallop
@Ry4an Yes, it is presented as a TODO list, but what I am asking for is effectively feedback "answers" on where to go next and how to go for it, if anyone else deems it interesting enough to pursue. It is about completing / extending the design of this idea, and this seems like a good place to find helpful answers and comments. Obviously I may ask single questions when and if I start implementing any of the points I outlined. For now I would appreciate a more general advice.Slit
You should post this to the mercurial-devel mailing list. That's a great place to seek general kudos and advice; stackoverflow on the other hand is for actual questions.Shallop
B
2

One way to streamline this would be to make it work with one of: capistrano/fabric, puppet/chef, jhbuild, or buildout+minitage (and a lot of cmmi tasks). There are some opportunities for factoring in common code, especially with something more high-level than bash. You will run into bootstrapping issues, however, so maybe leave good enough alone.

If you want to look into userland package managers, there is autopackage (bootstraps well), nix (quickstart), and stow (simple but helps with isolation).

Bursitis answered 13/6, 2010 at 19:43 Comment(0)
P
1

Honestly, I would just build packages with a name prefix for all of the pieces and have them install under /opt so that they're out of the way. That way it only takes the download time and a bit of install time to do.

Phenetidine answered 26/5, 2010 at 23:29 Comment(1)
That is in fact what the script does. I am not asking how to install here. Rather how to improve a script to be safely used by people who want Python or Mercurial (amongst others) without having to backtrack all the dependencies and obscure variables like export EPREFIX= needed to get this stuff to work just right. Wish it was as simple as you make it sound...Slit

© 2022 - 2024 — McMap. All rights reserved.