Skip to main content

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:

  1. /d/config.yml
  2. (optional) /d/build
  3. /d/install
  4. (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

  1. Install Python 3
  2. Install Docker
  3. Install the pip package:
$ 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

Metadata

Release files for lzdeb 0.1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lzdeb 0.1.3.1
File Size Uploaded Provenance Actions
lzdeb-0.1.3.1.tar.gz 9.4 kB Without provenance Details for lzdeb-0.1.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lzdeb 0.1.3.1
File Interpreter ABI Platform Actions
lzdeb-0.1.3.1-py3-none-any.whl Python 3 none any Details for lzdeb-0.1.3.1-py3-none-any.whl

Total release size: 19.0 kB

Release files / lzdeb-0.1.3.1.tar.gz

Download URL lzdeb-0.1.3.1.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d251fc1baefd21d64f2311533dc6b434130b3c20f7568eea0f55705bc2f6e81d
BLAKE2b-256 checksum
How to use checksums
35e8924c03aeb604a3617069994a2f9b36cf583ce7b7812543fe6cbe796a37f5
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / lzdeb-0.1.3.1-py3-none-any.whl

Download URL lzdeb-0.1.3.1-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7eacce7e5bc79fb78e935137227a988c5ae544bf9d260df2937d815e2824716f
BLAKE2b-256 checksum
How to use checksums
84ecff514c4aef36a914efb023776bef6efba54f9567bc8e0e71f3816f88239e
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for lzdeb 0.1.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page