LzDeb - Build debian packages the lazy way
Project description
LZDeb - build Debian packages the lazy way
Want to install something from a debian / apt package but prebuilt packages don't exist?
Build your own, the easy (and lazy) way!
Usage
Run (/d is a directory):
$ lzdeb build /d
Collect the resulting debian package file in your working directory.
$ lzdeb build /d
...
$ ls *.deb
Directory /d
should contain these files:
/d/config.yml
- (optional)
/d/build
/d/install
- (optional)
/d/validate
Example: examples/silversearcher-ag
Create a debian package for the silver searcher.
lzdeb.yml
builder:
image: ubuntu:16.04
bootstrap_cmds:
- apt update
- apt install -y git
validator:
image: ubuntu:18.04
bootstrap_cmds:
- apt update
source:
type: git
url: https://github.com/ggreer/the_silver_searcher.git
ref: 2.2.0
pull_submodules: yes
deb_info:
pkgname: silversearcher-ag
pkgversion: 2.2.0
pkgrelease: 1
pkglicense: Apache 2.0
pkggroup: main
maintainer: example@lzdeb.invalid
description: "A code-searching tool similar to ack, but faster. http://geoff.greer.fm/ag/"
requires:
- liblzma-dev>=5.1.1
- libpcre3-dev>=2:8.38
- zlib1g-dev>=1:1.2.8
builder
defines the docker container within which the deb package is built.
validator
defines the docker container within which the built deb is validated (install the package, may be some test commands)
source
defines where to get the source code to be built.
deb_info
defines debian package metadata to be used when creating the debian package.
1. build
Install build tools and required libraries. Build (compile) the code.
#!/usr/bin/env bash
set -e
apt-get update
apt-get install -y \
automake \
pkg-config \
libpcre3-dev \
zlib1g-dev \
liblzma-dev
cd the_silver_searcher*/
./build.sh
2. install
Perform a "make install". A debian package is built automatically based on filesystem changes.
#!/usr/bin/env bash
set -e
cd the_silver_searcher*/
make install
3. validate
Try installing the built debian package. Verify program runs.
#!/usr/bin/env bash
set -e
apt install -y ./*.deb
ag -h
Tying it all together
$ lzdeb build example/silversearcher-ag
... spin up build container
...
... build script gets run
...
... install script gets run (deb package file created)
...
... validate script gets run (deb package file gets installed in fresh container)
...
$ ls *.deb
silversearcher-ag_2.2.0-1_amd64.deb
Installation
$ pip3 install lzdeb
Tested on MacOS. Probably works on Linux as well.
Caveats
There are many!
We will populate this section with the most important ones, as users report them.
How To Contribute
- Fork the repo.
- In a virtualenv:
pip3 install -r requirements.txt
pip3 install -r .circleci/test_requirements
- Hack Away!
- Testing:
- New unit tests to go in
test/
- If you have CircleCI access, make sure the
test_all
workflow passes. - Otherwise, you could run tests locally (see
.circleci/config.yml
):- unit tests:
py.test --cov=lzdeb test/
- lint:
pylint -E lzdeb test
- pep8:
pycodestyle lzdeb test
- type hint checking:
mypy lzdeb test
- unit tests:
- New unit tests to go in
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lzdeb-0.1.3.1.tar.gz
.
File metadata
- Download URL: lzdeb-0.1.3.1.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d251fc1baefd21d64f2311533dc6b434130b3c20f7568eea0f55705bc2f6e81d |
|
MD5 | 0291ef4d4d9998ce43a673a7d33ebcd9 |
|
BLAKE2b-256 | 35e8924c03aeb604a3617069994a2f9b36cf583ce7b7812543fe6cbe796a37f5 |
File details
Details for the file lzdeb-0.1.3.1-py3-none-any.whl
.
File metadata
- Download URL: lzdeb-0.1.3.1-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7eacce7e5bc79fb78e935137227a988c5ae544bf9d260df2937d815e2824716f |
|
MD5 | 732f9968894580e2c902766b96147183 |
|
BLAKE2b-256 | 84ecff514c4aef36a914efb023776bef6efba54f9567bc8e0e71f3816f88239e |