Skip to content

Building

Joachim Metz edited this page Jun 4, 2017 · 1 revision

Introduction

The dfKinds source code can be build using Python distutils, which support building a MSI and RPM.

Or directly packaged with different package managers:

  • Using Debian package tools (DEB)
  • Using Mac OS X package tools (PKG)

Dependencies

dfKinds depends on various other projects to provide format support. These currently are:

  • Python 2.7 (or later) or Python 3.4 (or later)

Building

dfKinds uses Python distutils.

You can obtain dfkinds by checking the source out of git repository:

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

If you're running git on Windows make sure you have autocrlf turned off otherwise the tests using the test text files will fail.

git config --global core.autocrlf false

To build dfKinds run:

python setup.py build

To install run:

sudo python setup.py install

On Windows sudo is not available so run the command without it but make sure you can write to the Python site-packages (or equivalent) directory. On Windows it might be easier to build and install a MSI package.

Building a distributable source package

To build a distributable source package run:

python setup.py sdist

This will create a tar.gz file in the dist sub directory, e.g.

dist/dfkinds-20170604.tar.gz

Building a MSI package

To build a msi package run:

python setup.py bdist_msi

This will create a msi file in the dist sub directory, e.g.

dist\dfkinds-20170604.1.win32-py2.7.msi

Building a RPM package

To build a rpm package run:

python setup.py bdist_rpm

This will create a rpm file in the dist sub directory, e.g.

dist/dfkinds-20170604-1.noarch.rpm

To install run:

sudo rpm -ivh dist/dfkinds-20170604-1.noarch.rpm

Using Debian package tools (DEB)

Distutils has no build-in support for building dpkg (deb) packages.

To build a dpkg package run:

cd dfkinds
cp -rf config/dpkg/ debian
dpkg-buildpackage -rfakeroot
cd ..

This will create a deb file in the current directory, e.g.

python-dfkinds-20170604-1_all.deb

To install run:

sudo dpkg -i python-dfkinds-20170604-1_all.deb

Using Mac OS X package tools (PKG)

pkgbuild can be used to create a Mac OS X package.

The following instructions show how to build dfkinds.pkg and dfkinds.dmg from the command line.

First build dfkinds:

/usr/bin/python setup.py build

Next install the build files

/usr/bin/python setup.py install --root $PWD/tmp

If you are planning to distribute dfkinds.pkg make sure it contains a copy of the APL license:

find $PWD/tmp -type d -name \*.egg-info -exec cp LICENSE {} \;

To create the package (directory):

pkgbuild --root $PWD/tmp --identifier com.github.log2timeline.dfkinds --version <version> --ownership recommended ../dfkinds-<version>.pkg

To create a distributable disk image:

hdiutil create ../dfkinds-<version>.dmg -srcfolder ../dfkinds-<version>.pkg -fs HFS+