Building Cryptully

Get the source

You can get the source from GitHub at https://github.com/shanet/Cryptully.

Dependencies

So you want to build Crpytully from source? Sweet! There’s a few dependencies you’ll need to install first though. The core dependencies are:

  • Python 2.7
  • PyQt4
  • M2Crypto
  • PyInstaller 2 (only if you want to build a binary, otherwise it is not needed)

Depending what platform you’re building on, you’ll need a few more things, but those are documented in the relevant sections below.

Sanity Check

You can do a basic sanity check by doing the following:

$ python
>>> import PyQt4.QtGui
>>> import M2Crypto
>>> import curses

If you got any errors, something isn’t right.

Running Directly

Cryptully is, after all, a Python script so you can run it without packaging it into anything fancy. Once the sanity check passes, just do:

$ python cryptully/cryptully.py

You can also check out all the command line options with:

$ python cryptully/cryptully.py --help

Linux

These instructions are for Debian/Ubuntu. They should work on other distros, but the package names will most likely be different.

  1. $ apt-get install python-dev python-qt4-dev python-m2crypto python-stdeb
  2. Download and extract PyInstaller from http://www.pyinstaller.org.
  3. $ cd /path/to/cryptully/
  4. $ python make.py dist /path/to/pyinstaller/

If everything went as intended, the packaged application should be in dist/.

Windows

  1. Download and install Python 2.7 from http://www.python.org/download/releases/2.7.5. You’ll probably want to add it to your PATH as well.
  2. Download and install of PyWin32 from http://sourceforge.net/projects/pywin32/files/pywin32 (these instructions were tested with build 218)
  3. Download and install M2Crypto http://chandlerproject.org/Projects/MeTooCrypto#Downloads
  4. Download and install PyQt4 from http://www.riverbankcomputing.com/software/pyqt/download
  5. Download and install the Visual C++ 2010 Redistributable Package from https://www.microsoft.com/en-us/download/details.aspx?id=14632
  6. Download and install Curses from http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses
  7. Download and extract PyInstaller from http://www.pyinstaller.org

It’s probably a good idea to do the sanity check as described in the sanity check above at this point.

  1. > cd \path\to\cryptully\
  2. > python make.py dist \path\to\pyinstaller\

If everything went as intended, the packaged application should be in dist\.

OS X

  1. Install Homebrew from http://mxcl.github.io/homebrew (it’s the easiest way to get the dependencies)
  2. Run $ brew doctor to make sure everything is okay. You’ll probably need to install the OS X Command Line Tools.
  3. $ brew install python (OS X comes with a version of Python, but it’s best to use the homebrew version)
  4. If not done already, set your Python path with: export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
  5. $ brew install pyqt
  6. Download the relevant M2Crpyto .egg for your version of OS X from http://chandlerproject.org/Projects/MeTooCrypto#Downloads
  7. Copy the M2Crypto .egg to /usr/local/lib/python2.7/site-packages
  8. Download and extract PyInstaller from http://www.pyinstaller.org At the time of this writing the development version of PyInstaller must be used! Stable version 2.0 will not work. Future stable versions may or may not.

It’s probably a good idea to do the sanity check as described in the sanity check above at this point.

  1. $ cd /path/to/cryptully/
  2. $ python make.py dist /path/to/pyinstaller/

If everything went as intended, the packaged application should be in dist\.

Unit Tests

Install the Python Mock package first.

Units tests are located in the src/tests directory. Running them is as simple as python make.py test.

Documentation

The documentation you are reading right now was generated by Sphinx and its source is located in the docs folder. To build it into a pretty HTML page just run the following from the docs folder

Linux/OS X:

make html

Windows:

.\make.bat html