From ad5c3ff1b239d634e44286e2c58f8fd713c3dea9 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 11 Jun 2015 19:13:31 +0000 Subject: [PATCH 1/9] Support M2Crypto with swig 3.0.5+ Fixes issues recognized in https://github.com/letsencrypt/lets-encrypt-preview/issues/413#issuecomment-106245456 and https://github.com/letsencrypt/lets-encrypt-preview/issues/493. --- requirements.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/requirements.txt b/requirements.txt index 0f0223dab..fa3dba412 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,9 @@ # https://github.com/bw2/ConfigArgParse/issues/17 -e git+https://github.com/kuba/ConfigArgParse.git@python2.6#egg=ConfigArgParse + +# Support swig 3.0.5 +# https://github.com/M2Crypto/M2Crypto/issues/24 +# https://github.com/M2Crypto/M2Crypto/pull/30 +git+https://github.com/M2Crypto/M2Crypto/commit/d13a3a46c8934c5f50b31d5f95b23e6e06f845c3#egg=M2Crypto + -e . From c4b495aa37085601dd7e5bcb94a66cd7d69acbcb Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 11 Jun 2015 19:24:07 +0000 Subject: [PATCH 2/9] Bootstrap Fedora 22 (fixes: #493) --- bootstrap/fedora.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 bootstrap/fedora.sh diff --git a/bootstrap/fedora.sh b/bootstrap/fedora.sh new file mode 100755 index 000000000..0b919b4ce --- /dev/null +++ b/bootstrap/fedora.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# Tested with: +# - Fedora 22 (x64) + +yum install -y \ + git-core \ + python \ + python-devel \ + python-virtualenv \ + python-devel \ + gcc \ + swig \ + dialog \ + augeas \ + openssl-devel \ + libffi-devel \ + ca-certificates \ From 30545e1c545fe1798ab6cc961a764798510957e4 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 11 Jun 2015 21:11:25 +0000 Subject: [PATCH 3/9] requirements.txt: fix M2Crypto URL --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index fa3dba412..6c2535a9d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,6 @@ # Support swig 3.0.5 # https://github.com/M2Crypto/M2Crypto/issues/24 # https://github.com/M2Crypto/M2Crypto/pull/30 -git+https://github.com/M2Crypto/M2Crypto/commit/d13a3a46c8934c5f50b31d5f95b23e6e06f845c3#egg=M2Crypto +git+https://github.com/M2Crypto/M2Crypto.git@d13a3a46c8934c5f50b31d5f95b23e6e06f845c3#egg=M2Crypto -e . From 6b9d5c1daab2c696b2f7ff0e43a9c82a50ace212 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Fri, 12 Jun 2015 12:55:33 +0000 Subject: [PATCH 4/9] Separate requirements.txt for SWIG 3.0.5+ --- docs/using.rst | 6 ++++ requirements-swig-3.0.5.txt | 67 +++++++++++++++++++++++++++++++++++++ requirements.txt | 6 ---- 3 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 requirements-swig-3.0.5.txt diff --git a/docs/using.rst b/docs/using.rst index 89cbc48f6..909c6eadc 100644 --- a/docs/using.rst +++ b/docs/using.rst @@ -31,6 +31,12 @@ In general: * ``sudo`` is required as a suggested way of running privileged process * `swig`_ is required for compiling `m2crypto`_ + + .. note:: If your operating system uses SWIG 3.0.5+, you will need + to run ``pip install -r requirements-swig-3.0.5.txt -r + requirements.txt`` instead of the standard ``pip + install -r requirements.txt``. + * `augeas`_ is required for the ``python-augeas`` bindings diff --git a/requirements-swig-3.0.5.txt b/requirements-swig-3.0.5.txt new file mode 100644 index 000000000..9ef45d950 --- /dev/null +++ b/requirements-swig-3.0.5.txt @@ -0,0 +1,67 @@ +# Support swig 3.0.5+ +# https://github.com/M2Crypto/M2Crypto/issues/24 +# https://github.com/M2Crypto/M2Crypto/pull/30 +git+https://github.com/M2Crypto/M2Crypto.git@d13a3a46c8934c5f50b31d5f95b23e6e06f845c3#egg=M2Crypto + +# This requirements file will fail on Travis CI 12.04 LTS Ubuntu build +# machine under TOX_ENV=py26 with very confusing error (full tracback +# at https://api.travis-ci.org/jobs/66529698/log.txt?deansi=true): + +#Traceback (most recent call last): +# File "setup.py", line 133, in +# include_package_data=True, +# File "/opt/python/2.6.9/lib/python2.6/distutils/core.py", line 152, in setup +# dist.run_commands() +# File "/opt/python/2.6.9/lib/python2.6/distutils/dist.py", line 975, in run_commands +# self.run_command(cmd) +# File "/opt/python/2.6.9/lib/python2.6/distutils/dist.py", line 995, in run_command +# cmd_obj.run() +# File "/home/travis/build/letsencrypt/lets-encrypt-preview/.tox/py26/lib/python2.6/site-packages/setuptools/command/test.py", line 142, in run +# self.with_project_on_sys_path(self.run_tests) +# File "/home/travis/build/letsencrypt/lets-encrypt-preview/.tox/py26/lib/python2.6/site-packages/setuptools/command/test.py", line 122, in with_project_on_sys_path +# func() +# File "/home/travis/build/letsencrypt/lets-encrypt-preview/.tox/py26/lib/python2.6/site-packages/setuptools/command/test.py", line 163, in run_tests +# testRunner=self._resolve_as_ep(self.test_runner), +# File "/opt/python/2.6.9/lib/python2.6/unittest.py", line 816, in __init__ +# self.parseArgs(argv) +# File "/opt/python/2.6.9/lib/python2.6/unittest.py", line 843, in parseArgs +# self.createTests() +# File "/opt/python/2.6.9/lib/python2.6/unittest.py", line 849, in createTests +# self.module) +# File "/opt/python/2.6.9/lib/python2.6/unittest.py", line 613, in loadTestsFromNames +# suites = [self.loadTestsFromName(name, module) for name in names] +# File "/opt/python/2.6.9/lib/python2.6/unittest.py", line 587, in loadTestsFromName +# return self.loadTestsFromModule(obj) +# File "/home/travis/build/letsencrypt/lets-encrypt-preview/.tox/py26/lib/python2.6/site-packages/setuptools/command/test.py", line 37, in loadTestsFromModule +# tests.append(self.loadTestsFromName(submodule)) +# File "/opt/python/2.6.9/lib/python2.6/unittest.py", line 584, in loadTestsFromName +# parent, obj = obj, getattr(obj, part) +#AttributeError: 'module' object has no attribute 'continuity_auth' + +# the above error happens because letsencrypt.continuity_auth cannot import M2Crypto: + +#>>> import M2Crypto +#Traceback (most recent call last): +# File "", line 1, in +# File "/root/lets-encrypt-preview/venv/lib/python2.6/site-packages/M2Crypto-0.21.1-py2.6-linux-x86_64.egg/M2Crypto/__init__.py", line 22, in +# import m2crypto +# File "/root/lets-encrypt-preview/venv/lib/python2.6/site-packages/M2Crypto-0.21.1-py2.6-linux-x86_64.egg/M2Crypto/m2crypto.py", line 26, in +# _m2crypto = swig_import_helper() +# File "/root/lets-encrypt-preview/venv/lib/python2.6/site-packages/M2Crypto-0.21.1-py2.6-linux-x86_64.egg/M2Crypto/m2crypto.py", line 22, in swig_import_helper +# _mod = imp.load_module('_m2crypto', fp, pathname, description) +#ImportError: /root/lets-encrypt-preview/venv/lib/python2.6/site-packages/M2Crypto-0.21.1-py2.6-linux-x86_64.egg/M2Crypto/_m2crypto.so: undefined symbol: SSLv2_method + +# For more info see: + +# - https://github.com/martinpaljak/M2Crypto/commit/84977c532c2444c5487db57146d81bb68dd5431d +# - http://stackoverflow.com/questions/10547332/install-m2crypto-on-a-virtualenv-without-system-packages +# - http://stackoverflow.com/questions/8206546/undefined-symbol-sslv2-method + +# In short: Python has been built without SSLv2 support, and +# github.com/M2Crypto/M2Crypto version doesn't contain necessary +# patch, but it's the only one that has a patch for newer versions of +# swig... + +# Problem seems not exists on Python 2.7. It's unlikely that the +# target distribution has swig 3.0.5+ and doesn't have Python 2.7, so +# this file should only be used in conjuction with Python 2.6. diff --git a/requirements.txt b/requirements.txt index 6c2535a9d..0f0223dab 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,3 @@ # https://github.com/bw2/ConfigArgParse/issues/17 -e git+https://github.com/kuba/ConfigArgParse.git@python2.6#egg=ConfigArgParse - -# Support swig 3.0.5 -# https://github.com/M2Crypto/M2Crypto/issues/24 -# https://github.com/M2Crypto/M2Crypto/pull/30 -git+https://github.com/M2Crypto/M2Crypto.git@d13a3a46c8934c5f50b31d5f95b23e6e06f845c3#egg=M2Crypto - -e . From 63d5273ed1692cd4c02af9e0e421ff362b2d06b9 Mon Sep 17 00:00:00 2001 From: PatrickHeppler Date: Thu, 18 Jun 2015 14:55:12 +0200 Subject: [PATCH 5/9] Create centos.sh --- bootstrap/centos.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 bootstrap/centos.sh diff --git a/bootstrap/centos.sh b/bootstrap/centos.sh new file mode 100644 index 000000000..318a47a8a --- /dev/null +++ b/bootstrap/centos.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# Tested with: Centos 7 on AWS EC2 t2.micro (x64) + +yum install -y \ + git \ + python \ + python-devel \ + python-virtualenv \ + python-devel \ + gcc \ + swig \ + dialog \ + augeas-libs \ + openssl-devel \ + libffi-devel \ + ca-certificates \ + python-setuptools \ + readline-devel From 8d0334d2de9f355d867210be01f74f25c6c00e2c Mon Sep 17 00:00:00 2001 From: PatrickHeppler Date: Thu, 18 Jun 2015 14:58:55 +0200 Subject: [PATCH 6/9] Update using.rst Additional informations about installing on Centos 7 --- docs/using.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/using.rst b/docs/using.rst index 89cbc48f6..ddfc67738 100644 --- a/docs/using.rst +++ b/docs/using.rst @@ -64,6 +64,11 @@ Mac OSX sudo ./bootstrap/mac.sh +Centos 7 +-------- +.. code-block:: shell + + sudo ./bootstrap/centos.sh Installation ============ @@ -73,6 +78,13 @@ Installation virtualenv --no-site-packages -p python2 venv ./venv/bin/pip install -r requirements.txt +Installation on Centos 7 +============ + +.. code-block:: shell + + virtualenv --no-site-packages -p python2 venv + env SWIG_FEATURES="-cpperraswarn -includeall -D__`uname -m`__ -I/usr/include/openssl" ./venv/bin/python setup.py install Usage ===== From 85d9047f4efb9ef6058ab4a4b55222f55ac7be16 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 18 Jun 2015 13:13:29 +0000 Subject: [PATCH 7/9] Fedora: augeas -> augeas-libs --- bootstrap/fedora.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap/fedora.sh b/bootstrap/fedora.sh index 0b919b4ce..97ea1e637 100755 --- a/bootstrap/fedora.sh +++ b/bootstrap/fedora.sh @@ -12,7 +12,7 @@ yum install -y \ gcc \ swig \ dialog \ - augeas \ + augeas-libs \ openssl-devel \ libffi-devel \ ca-certificates \ From 9b4cff8cd60c0d8e4d046ff1c05ccff2db0d0a44 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 18 Jun 2015 13:55:32 +0000 Subject: [PATCH 8/9] bootstrap: _rpm_common.sh, centos fixes --- bootstrap/_rpm_common.sh | 20 ++++++++++++++++++++ bootstrap/centos.sh | 20 +------------------- bootstrap/fedora.sh | 19 +------------------ docs/using.rst | 18 +++++++++++------- 4 files changed, 33 insertions(+), 44 deletions(-) create mode 100755 bootstrap/_rpm_common.sh mode change 100644 => 120000 bootstrap/centos.sh mode change 100755 => 120000 bootstrap/fedora.sh diff --git a/bootstrap/_rpm_common.sh b/bootstrap/_rpm_common.sh new file mode 100755 index 000000000..1209cd44a --- /dev/null +++ b/bootstrap/_rpm_common.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# Tested with: +# - Fedora 22 (x64) +# - Centos 7 (x64: on AWS EC2 t2.micro, DigitalOcean droplet) + +# "git-core" seems to be an alias for "git" in CentOS 7 (yum search fails) +yum install -y \ + git-core \ + python \ + python-devel \ + python-virtualenv \ + python-devel \ + gcc \ + swig \ + dialog \ + augeas-libs \ + openssl-devel \ + libffi-devel \ + ca-certificates \ diff --git a/bootstrap/centos.sh b/bootstrap/centos.sh deleted file mode 100644 index 318a47a8a..000000000 --- a/bootstrap/centos.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# Tested with: Centos 7 on AWS EC2 t2.micro (x64) - -yum install -y \ - git \ - python \ - python-devel \ - python-virtualenv \ - python-devel \ - gcc \ - swig \ - dialog \ - augeas-libs \ - openssl-devel \ - libffi-devel \ - ca-certificates \ - python-setuptools \ - readline-devel diff --git a/bootstrap/centos.sh b/bootstrap/centos.sh new file mode 120000 index 000000000..a0db46d70 --- /dev/null +++ b/bootstrap/centos.sh @@ -0,0 +1 @@ +_rpm_common.sh \ No newline at end of file diff --git a/bootstrap/fedora.sh b/bootstrap/fedora.sh deleted file mode 100755 index 97ea1e637..000000000 --- a/bootstrap/fedora.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# Tested with: -# - Fedora 22 (x64) - -yum install -y \ - git-core \ - python \ - python-devel \ - python-virtualenv \ - python-devel \ - gcc \ - swig \ - dialog \ - augeas-libs \ - openssl-devel \ - libffi-devel \ - ca-certificates \ diff --git a/bootstrap/fedora.sh b/bootstrap/fedora.sh new file mode 120000 index 000000000..a0db46d70 --- /dev/null +++ b/bootstrap/fedora.sh @@ -0,0 +1 @@ +_rpm_common.sh \ No newline at end of file diff --git a/docs/using.rst b/docs/using.rst index 0e0b493ca..ef64452e1 100644 --- a/docs/using.rst +++ b/docs/using.rst @@ -70,12 +70,23 @@ Mac OSX sudo ./bootstrap/mac.sh + Centos 7 -------- + .. code-block:: shell sudo ./bootstrap/centos.sh +For installation run this modified command (note the trailing +backslash): + +.. code-block:: shell + + SWIG_FEATURES="-includeall -D__`uname -m`__-I/usr/include/openssl" \ + ./venv/bin/pip install -r requirements.txt functools32 + + Installation ============ @@ -84,13 +95,6 @@ Installation virtualenv --no-site-packages -p python2 venv ./venv/bin/pip install -r requirements.txt -Installation on Centos 7 -============ - -.. code-block:: shell - - virtualenv --no-site-packages -p python2 venv - env SWIG_FEATURES="-cpperraswarn -includeall -D__`uname -m`__ -I/usr/include/openssl" ./venv/bin/python setup.py install Usage ===== From db6f9ecf862f0175a02cb8d46108ab2f8ec7cc9a Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Thu, 18 Jun 2015 13:59:59 +0000 Subject: [PATCH 9/9] Fedora installation instructions. --- docs/using.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/using.rst b/docs/using.rst index ef64452e1..227fd69ed 100644 --- a/docs/using.rst +++ b/docs/using.rst @@ -32,6 +32,7 @@ In general: * ``sudo`` is required as a suggested way of running privileged process * `swig`_ is required for compiling `m2crypto`_ + .. _new-swig: .. note:: If your operating system uses SWIG 3.0.5+, you will need to run ``pip install -r requirements-swig-3.0.5.txt -r requirements.txt`` instead of the standard ``pip @@ -71,6 +72,16 @@ Mac OSX sudo ./bootstrap/mac.sh +Fedora +------ + +.. code-block:: shell + + sudo ./bootstrap/fedora.sh + +.. note:: Fedora 22 uses SWIG 3.0.5+, use the :ref:`modified pip + command for installation `. + Centos 7 --------