### [Document] ## [1][Header]: Python v3.10 Rebuild with libffi, bzip2 and lzma ## [URL]: https://www.python.org/ftp/python/3.10.6/Python-3.10.6.tgz ## [Dependencies]: Recent version of libffi (v3.3), bzip2 (v2.1.0.8), lzma v4.32.7 [3-5] ## [Note]: The Python v3.10 Installation is located at '/opt/python3.10' ## The openSSL Installation is located at '/opt/openssl' ## [IMPORTANT]: Sqlite3 Module ## Edit /tmp/Python-3.10.6/setup.py: Add the sqlite library path: sqlite_inc_paths = [ '/usr/lib', ] ## [CODE] wget https://www.python.org/ftp/python/3.10.6/Python-3.10.6.tgz -O /tmp/python3.tgz && tar xzvf /tmp/python3.tgz -C /tmp && cd /tmp/Python-3.10.6 && export LD_LIBRARY_PATH=/opt/openssl/lib:/usr/lib:/usr/lib64/ && export LD_RUN_PATH=/opt/openssl/lib:/usr/lib:/usr/lib64/ && ./configure --prefix=/opt/python3.10 \ --with-ensurepip=yes \ --with-openssl=/opt/openssl \ --with-openssl-rpath=/opt/openssl/lib \ --with-ssl-default-suites=openssl \ --enable-optimizations \ --enable-loadable-sqlite-extensions \ CXX=/usr/bin/g++ \ CFLAGS="-I/opt/openssl/include/openssl -I/usr/include" \ LDFLAGS="-L/lib -L/lib64 -L/usr/lib -L/user/lib64" && make && make install ## [/CODE] ## [2][Header]: Python Virtual Environment Configuration & Certbot Installation ## [CODE] export PATH=/opt/python3.10/bin:${PATH} export PYTHONPATH=/opt/python3.10:/opt/python3.10/lib/python3.10/ cd ~/development && python3 -m venv certbot && cd certbot/ && source bin/activate && pip3 install --upgrade pip && pip3 install wheel requests lz pip3 install certbot ## [/CODE] ## ----- ## ## Python Dependency Packages: libffi, bzip2, lzma ## [3][Header]: libffi v3.3 Dependency Installation ## [URL]: https://gcc.gnu.org/pub/libffi/libffi-3.3.tar.gz ## [Note]: libffi is required to build python's ctypes module ## [CODE] wget --no-check-certificate https://gcc.gnu.org/pub/libffi/libffi-3.3.tar.gz -O /tmp/libffi.tgz && tar xzf /tmp/libffi.tgz -C /tmp/ && cd /tmp/libffi-3.3 && ./configure --prefix=/usr --with-gnu-ld && make make install ## [/CODE] ## ----- ## ## [4][Header]: bzip2 v2.1.0.8 Dependency Installation ## [URL]: https://sourceware.org/pub/bzip2/bzip2-latest.tar.gz ## [Note]: bzip2 is required to build python's optional bzip2 compression module ## [CODE] wget --no-check-certificate https://sourceware.org/pub/bzip2/bzip2-latest.tar.gz -O /tmp/bzip2.tgz && tar xzf /tmp/bzip2.tgz -C /tmp/ && cd bzip2-1.0.8/ && make -f Makefile-libbz2_so make PREFIX=/usr make install PREFIX=/usr mv libbz2.so.1.0* /usr/lib64/ ## [/CODE] ## ----- ## ## [5][Header]: lzma v4.32.7 Dependency Installation ## [URL]: https://tukaani.org/lzma/lzma-4.32.7.tar.gz ## [Note]: lzma is required to build python's optional lzma compression module The module can also be installed with 'pip3 install lz' ## [CODE] wget --no-check-certificate https://tukaani.org/lzma/lzma-4.32.7.tar.gz -O /tmp/lzma.tgz && tar xzf /tmp/lzma.tgz -C /tmp/ && cd /tmp/lzma-4.32.7 && ./configure --prefix=/usr --with-gnu-ld && make && make install ## [/CODE] ## ----- ## ### [/Document]