Skip to content

Build script

Joachim Metz edited this page Apr 10, 2023 · 23 revisions

Introduction

build.py is a Python script to ease builds of Plaso and dfVFS dependencies.

Getting the script

git clone https://github.com/log2timeline/l2tdevtools.git

Before running build make sure to customize data/projects.ini to fit your needs.

Running the script

Make sure your build environment is set-up correct.

Build target: download

The download build target can be used to download the latest versions and remove older versions.

To run:

PYTHONPATH=. python tools/build.py download

The resulting packages can be found in the ../l2tbuilds directory or the location specified by --build-directory.

To customize your dpkg build the following scripts can be used:

  • post-download.sh; to run after the download step.

Build target: dpkg

The dpkg build target can be used to build deb files. For this the build script uses "dpkg-buildpackage" and relies on "debhelper".

Make sure that build dependencies are installed on your build system at the moment the build script does not install these for you and the batch build will be interrupted.

sudo apt-get install build-essential autoconf automake autopoint libtool gettext pkg-config debhelper devscripts fakeroot quilt autotools-dev zlib1g-dev libbz2-dev libssl-dev libfuse-dev libfuse-dev python-dev python-setuptools

To run:

PYTHONPATH=. python tools/build.py dpkg

To customize your dpkg build the following scripts can be used:

  • prep-dpkg.sh; to run to prepare the dpkg building step, e.g. changing the changelog
  • post-dpkg.sh; to run after the dpkg building step, e.g. for signing packages.

The build script expects these scripts to be located in the build directory.

The resulting deb (and related) files can be found in the ../l2tbuilds directory or the location specified by --build-directory.

Build target: dpkg-source

The dpkg-source build target can be used to build source deb files. For this the build script uses "debuild" and relies on "debhelper".

To run:

PYTHONPATH=. python tools/build.py dpkg-source

The dpkg-source build targed is similar to the dpkg build target and therefore the prep-dpkg-source.sh and post-dpkg-source.sh scripts can be used to prepare the dpkg packaging files and upload it to a PPA e.g.

prep-dpkg-source.sh

export NAME="Joachim Metz";
export EMAIL="[email protected]";

PROJECT=$1;
VERSION=$2;
VERSION_SUFFIX=$3;
DISTRIBUTION=$4;
ARCHITECTURE=$5;

dch --preserve -v ${VERSION}-1${VERSION_SUFFIX}~${DISTRIBUTION} --distribution ${DISTRIBUTION} --urgency low "Modifications for PPA release."

post-dpkg-source.sh

PROJECT=$1;
VERSION=$2;
VERSION_SUFFIX=$3;
DISTRIBUTION=$4;
ARCHITECTURE=$5;

dput ppa:gift/testing ../${PROJECT}_${VERSION}-1${VERSION_SUFFIX}~${DISTRIBUTION}_${ARCHITECTURE}.changes

Note that the source package needs to be signed and therefore a GPG key needs to be set for "${NAME} <${EMAIL}>".

The dpkg-source option will build source dpkg packages for multiple distributions by default: precise, trusty, utopic, vivid, wily. At the moment this is hard coded in the build script.

Build target: rpm

The rpm build target can be used to build binary rpm files. For this the build script uses "rpmbuild".

Make sure that build dependencies are installed on your build system at the moment the build script does not install these for you and the batch build will be interrupted.

To run:

PYTHONPATH=. python tools/build.py rpm

The resulting rpm files can be found in the ../l2tbuilds directory or the location specified by --build-directory.

Build target: srpm

The srpm build target can be used to build source rpm files. For this the build script uses "rpmbuild".

Make sure that build dependencies are installed on your build system at the moment the build script does not install these for you and the batch build will be interrupted.

To run:

PYTHONPATH=. python tools/build.py srpm

The resulting .src.rpm files can be found in the ../l2tbuilds directory or the location specified by --build-directory.

Build target: wheel

The wheel build target can be used to build Python wheel (.whl) files.