Skip to content

Commit

Permalink
moved gotr to afflux/gotr repository
Browse files Browse the repository at this point in the history
  • Loading branch information
afflux committed Oct 2, 2013
1 parent bb3a838 commit 265b414
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 2,135 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.0.0 (future)
- gotr: moved to separate reppository / source distribution

1.0.0beta7 (2013-09-22)
- potr: work towards supporting OTRv3. no instance tag support yet.
- potr: fixed some MPI paddings
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
include LICENSE CHANGELOG
recursive-include src/tools *.py
recursive-include src/gajim-plugin *
19 changes: 0 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,17 @@ Python OTR
==========
This is a pure Python OTR implementation; it does not bind to libotr.

Included in this package is a Gajim Python plugin to enable OTR support
in the Gajim XMPP/Jabber client. This plugin is called gotr.

Install the potr Python module:

sudo python setup.py install

Note that this will install (but not activate) the gajim-otr plugin if a
gajim directory can be found in $PREFIX/share/gajim.

__Dependencies__: pycrypto >= 2.1 (see [dlitz/pycrypto](https://github.com/dlitz/pycrypto))

Usage Notes
===========
This module uses pycrypto's RNG. If you use this package in your application and your application
uses `os.fork()`, make sure to call `Crypto.Random.atfork()` in both the parent and the child process.

Gajim OTR Plugin
================
As mentioned above, a gajim-otr plugin is provided in src/gajim-plugin and
can be installed using distutils.

The gajim search path can be changed manually by specifiying `--gajim-dir` to
the install commmand:

sudo python setup.py install --gajim-dir=~/gajim

After installing, the plugin must be manually enabled in the Gajim plugin
interface.

Reporting bugs
==============
Please read the [FAQ](https://github.com/afflux/pure-python-otr/wiki) before submitting your
Expand Down
118 changes: 14 additions & 104 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,125 +20,37 @@
try:
from setuptools import setup

from setuptools.command.install import install
from setuptools.command.install_lib import install_lib

args['install_requires']=['pycrypto>=2.1']
except ImportError:
print('\n*** setuptools not found! Falling back to distutils\n\n')
from distutils.core import setup

from distutils.command.install import install
from distutils.command.install_lib import install_lib


import os.path

class gajimpath_install(install):
user_options = install.user_options + [
('gajim-dir=', None,
"gajim directory to install plugin to [default: $PREFIX/share/gajim]"),
]

def initialize_options(self):
install.initialize_options(self)
self.gajim_dir = None


class checked_install_lib(install_lib):

def __init__(self, dist):
install_lib.__init__(self, dist)
self.packages = dist.packages

def initialize_options(self):
install_lib.initialize_options(self)
self.data_prefix = None
self.gajim_dir = None

def finalize_options(self):
install_lib.finalize_options(self)
self.set_undefined_options('install',
('install_data', 'data_prefix'),
('gajim_dir', 'gajim_dir'),
)

# prepapre gajim directory paths
if self.gajim_dir is None:
self.gajim_dir = os.path.join(self.data_prefix,
os.path.normpath('share/gajim'))
else:
self.gajim_dir = os.path.expanduser(self.gajim_dir)
self.gajim_plugin_dir = os.path.join(self.gajim_dir,
os.path.normpath('plugins/gotr'))

def run(self):
""" checks for a valid pycrypto version before running the install
process, prints a warning if none was found """
try:
import Crypto
if Crypto.version_info < (2,1):
print('\n**** WARNING: ****\nYou seem to have pyCrypto < 2.1 '
'installed. python-potr will need at least pyCrypto 2.1 to run\n\n')
except:
print('\n**** WARNING: ****\nYou don\'t seem to have pyCrypto '
'installed. python-potr will need at least pyCrypto 2.1 to run\n\n')

install_lib.run(self)

def install(self):
""" overwrites the default install handler, which installs everything
from build.
Instead, we regularly install potr packages and redirect the gotr
package to the gajim plugins directory, if there is a gajim directory in
the current $PREFIX """

outfiles = []

if os.path.isdir(self.build_dir):
for package in self.packages:
packagedir = os.path.join(*list(package.split('.')))
if package == 'gotr':
if os.path.isdir(self.gajim_dir):
outfiles += self.copy_tree(
os.path.join(self.build_dir, 'gotr'),
self.gajim_plugin_dir)
else:
outfiles += self.copy_tree(
os.path.join(self.build_dir, packagedir),
os.path.join(self.install_dir, packagedir))
else:
self.warn("'%s' does not exist -- no Python modules to install" %
self.build_dir)
return
return outfiles


setup(
packages=['potr', 'potr.compatcrypto', 'gotr'],
package_dir={'potr':'src/potr', 'gotr':'src/gajim-plugin/gotr'},
package_data={'gotr':['*.ini', '*.ui']},

packages=['potr', 'potr.compatcrypto'],
package_dir={'potr':'src/potr'},

name='python-potr',
version='1.0.0b7',
version='1.0.0',
description='pure Python Off-The-Record encryption',
long_description='''This is a pure Python OTR implementation; it does not bind to libotr.
long_description='''Python OTR
==========
This is a pure Python OTR implementation; it does not bind to libotr.
Included in this package is a Gajim Python plugin to enable OTR support
in the Gajim XMPP/Jabber client. This plugin is called gotr.
Install the potr Python module:
sudo python setup.py install
**Installing this module will install (but not activate) the gajim-otr plugin if a
gajim directory can be found in $PREFIX/share/gajim.**
**Dependencies**: pycrypto >= 2.1 (see `dlitz/pycrypto <https://github.com/dlitz/pycrypto>`_)
The gajim search path can be changed manually by specifiying ``--gajim-dir`` to
the install commmand::
sudo python setup.py install --gajim-dir=~/gajim
After installing, the plugin must be manually enabled in the Gajim plugin
interface.
Usage Notes
===========
This module uses pycrypto's RNG. If you use this package in your application and your application
uses ``os.fork()``, make sure to call ``Crypto.Random.atfork()`` in both the parent and the child process.
Reporting bugs
==============
Expand All @@ -154,7 +66,7 @@ def install(self):
url='http://python-otr.pentabarf.de',

classifiers=[
'Development Status :: 4 - Beta',
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)',
'Programming Language :: Python :: 2',
Expand All @@ -163,7 +75,5 @@ def install(self):
'Topic :: Security :: Cryptography',
],

cmdclass={'install_lib':checked_install_lib, 'install':gajimpath_install},

**args
)
1 change: 0 additions & 1 deletion src/gajim-plugin/gotr/__init__.py

This file was deleted.

Loading

0 comments on commit 265b414

Please sign in to comment.