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.
$ apt-get install python-dev python-qt4-dev python-m2crypto python-stdeb
- Download and extract PyInstaller from http://www.pyinstaller.org.
$ cd /path/to/cryptully/
$ python make.py dist /path/to/pyinstaller/
If everything went as intended, the packaged application should be in dist/
.
Windows¶
- 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.
- Download and install of PyWin32 from http://sourceforge.net/projects/pywin32/files/pywin32 (these instructions were tested with build 218)
- Download and install M2Crypto http://chandlerproject.org/Projects/MeTooCrypto#Downloads
- Download and install PyQt4 from http://www.riverbankcomputing.com/software/pyqt/download
- Download and install the Visual C++ 2010 Redistributable Package from https://www.microsoft.com/en-us/download/details.aspx?id=14632
- Download and install Curses from http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses
- 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.
> cd \path\to\cryptully\
> python make.py dist \path\to\pyinstaller\
If everything went as intended, the packaged application should be in dist\
.
OS X¶
- Install Homebrew from http://mxcl.github.io/homebrew (it’s the easiest way to get the dependencies)
- Run
$ brew doctor
to make sure everything is okay. You’ll probably need to install the OS X Command Line Tools. $ brew install python
(OS X comes with a version of Python, but it’s best to use the homebrew version)- If not done already, set your Python path with:
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
$ brew install pyqt
- Download the relevant M2Crpyto .egg for your version of OS X from http://chandlerproject.org/Projects/MeTooCrypto#Downloads
- Copy the M2Crypto .egg to
/usr/local/lib/python2.7/site-packages
- 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.
$ cd /path/to/cryptully/
$ 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