Debify Keel so that it's suitable for an apt install
User story: I am an LDH operator. I want to install Keel from a deb file, so I can manage it like other packaged software.
Suggested solution: Use FPM to create a self-contained deb.
Success:
user@librem13:~$ git clone https://source.puri.sm/liberty/ldh_middleware.git
user@librem13:~$ cd ldh_middleware
user@librem13:~/ldh_middleware$ pipenv install --dev
user@librem13:~/ldh_middleware$ pipenv shell
user@librem13:~/ldh_middleware$ python setup.py sdist bdist_wheel
user@librem13:~/ldh_middleware$ twine upload dist/*
Documentation in README.md ("Build wheel package (and optionally upload)")
- I can use pip to install Keel as a dependency:
user@librem13:~$ mkdir test
user@librem13:~$ cd test
user@librem13:~/test$ pipenv install ldh_middleware
# this creates a virtualenv and installs the package,
# any pip + virtualenv toolchain will do, pipenv is just an example
user@librem13:~/test$ pip --freeze
# lists ldh_middleware and all Python dependencies
No documentation required.
- I can use FPM to build a deb from PyPI:
make debsource # invokes fpm
Reference: https://fpm.readthedocs.io/en/latest/source/python.html
Documentation in README.md ("Build .deb package")
- I can install the deb locally:
gdebi ldh_middleware.deb
No documentation required.
-
Instructions for build steps can be found in https://source.puri.sm/liberty/ldh_middleware/blob/master/README.md
-
Instructions for installing the deb on a virtual machine https://source.puri.sm/liberty/ldh_developer/wikis/ldh_middleware/install -- any scripts are stored in https://source.puri.sm/liberty/ldh_developer (or in https://source.puri.sm/liberty/ldh_middleware as appropriate).
Notes:
-
This is unrelated to getting Keel into Debian main / PureOS, which is a longer-term goal.
-
Installing non-Python dependencies is not required at this stage. We can handle this server-side.
-
Actually running Keel from the virtualenv / deb is not required for this ticket. Just the packaging recipe.
-
Suggested steps to install FPM:
sudo apt install rbenv
rbenv install 2.4.1
rbenv local 2.4.1 # enter the environment
gem install fpm
fpm --version
rbenv local --unset # leave the environment
Additional steps:
- Follow-on ticket to identify and expose invocations from Python package and deb file (e.g. so that site can run from Nginx and/or Supervisor) -- this was for a follow-on ticket but has been implemented.