Commit c250141b authored by Birin Sanchez's avatar Birin Sanchez

Update build instructions. Change Python version in Pipfile.

Signed-off-by: Birin Sanchez's avatarBirin Sanchez <birin.sanchez@puri.sm>
parent 36f0ceb0
# Building a deb package #
This file details the steps that need to be taken to build a Debian
package. We used Debian Stretch to build the package but using any
other Debian based distribution should generate a valid package for
that distribution.
Install Ruby packages and configure the user environment for Ruby 2.4.0:
```
$ sudo apt-get install rbenv ruby-build
$ rbenv install 2.4.0
$ rbenv global 2.4.0
```
Install FPM gem:
```
$ rbenv exec gem install fpm
```
Install the tools needed to create a virtual environment and install
LDH from PyPI:
```
$ sudo apt-get install python3-pip virtualenv libsasl2-dev libldap2-dev libssl-dev
$ sudo pip3 install virtualenv-tools3
$ pip3 install --user setuptools
```
Now we can build a Debian package from the LDH version available in PyPI by running:
```
$ make debpypi
```
or we can build a Debian package with the sources available in our directory by running:
```
$ make debsource
```
After a successful execution you will get a `ldh-middleware_<VERSION>_amd64.deb` file.
......@@ -49,4 +49,4 @@ WooCommerce = "==1.2.1"
twine = "==1.12.1"
[requires]
python_version = "3.6"
python_version = "3.5"
......@@ -38,14 +38,13 @@ Model diagram generated with:
./manage.py graph_models --all-applications --group-models \
--verbose-name --output models.png
Build
-----
Build wheel package (and optionally upload)
-------------------------------------------
Follow these instructions to build LDH as a Python package:
```
$ apt-get install git
$ apt-get install libsasl2-dev libldap2-dev libssl-dev python3-dev supervisor uwsgi uwsgi-emperor uwsgi-plugin-python3 virtualenv gcc pipenv
$ apt-get install git libsasl2-dev libldap2-dev libssl-dev python3-dev virtualenv gcc python3-pip
$ git clone https://source.puri.sm/liberty/ldh_middleware.git
$ cd ldh_middleware
$ pipenv install --dev
......@@ -54,12 +53,64 @@ Follow these instructions to build LDH as a Python package:
```
If everything works as expected you should end up with the files:
* `ldh_middleware-<version>-py3-none-any.whl`
* `ldh_middleware-<version>.tar.gz`
under dist/ directory.
You can now optionally upload the created Python package to PyPI using twine:
```
$ twine upload dist/*
```
Build Debian package
----------------------
This section details the steps that need to be taken to build a Debian
package. We used Debian Stretch to build the package but using any
other Debian based distribution should generate a valid package for
that distribution.
Install Ruby packages and configure the user environment for Ruby 2.4.0:
```
$ sudo apt-get install rbenv ruby-build
$ rbenv install 2.4.0
$ rbenv global 2.4.0
```
Install FPM gem:
```
$ rbenv exec gem install fpm
```
Install the tools needed to create a virtual environment and install
LDH from PyPI:
```
$ sudo apt-get install python3-pip virtualenv libsasl2-dev libldap2-dev libssl-dev
$ sudo pip3 install virtualenv-tools3
$ pip3 install --user setuptools
```
Now we can build a Debian package from the LDH version available in PyPI by running:
```
$ make debpypi
```
or we can build a Debian package with the sources available in our directory by running:
```
$ make debsource
```
After a successful execution you will get a `ldh-middleware_<VERSION>_amd64.deb` file.
You can use `make clean` to remove the virtual environment and the .deb file created.
Sharing and contributions
-------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment