5 kx
5 kx # [Package Tools](https://radix.pro/build-system/pkgtool/)
5 kx
5 kx **pkgtools** is a set of programs to create, install, remove, and update
5 kx packages on the root file system.
5 kx
5 kx ## Table of contents
5 kx
5 kx * [Bootstrap script](#bootstrap-script)
5 kx * [Install](#install)
5 kx * [Configurations](#configurations)
5 kx * [Cross compilation example](#cross-compilation-example)
5 kx * [Dialog](#dialog)
5 kx * [License](#license)
5 kx
5 kx
5 kx ## Bootstrap script
5 kx
5 kx The **bootstrap** script aspecialy created for autotools install automation.
5 kx To install autotools into source directory on build machine (i.e. when
5 kx **build == host**) the bootstrap script can be run without arguments. In this
5 kx case autotools will be installed from current root file system.
5 kx
5 kx For the cross environment the **--target-dest-dir** options allows to install
5 kx some stuf from development root file system:
5 kx
5 kx ```Bash
5 kx $ TARGET_DEST_DIR=/home/developer/prog/trunk-672/dist/.s9xx-glibc/enybox-x2 \
5 kx ./bootstrap --target-dest-dir=${TARGET_DEST_DIR}
5 kx ```
5 kx
5 kx For example, in this case the **dialog.m4** script will be taken from the
5 kx **${TARGET_DEST_DIR}/usr/share/aclocal** directory.
5 kx
5 kx
5 kx ## Install
5 kx
5 kx On the build machine the installation process seems like that
5 kx
5 kx ```Bash
5 kx $ tar xJvf pkgtools-0.2.1.tar.xz
5 kx $ mkdir build
5 kx $ cd build
5 kx $ ../pkgtools-0.2.1/configure --prefix=/usr
5 kx $ make
5 kx $ make install DESTDIR=$PKG exec_prefix=/
5 kx ```
5 kx
5 kx Note that the **exec_prefix=/** used for canonical installation of
5 kx pkgtools utilities into **${DESTDIR}/sbin/** directory instead of
5 kx **${DESTDIR}/usr/sbin/** which is not corresponds to
5 kx [**FHS**](https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf).
5 kx
5 kx
5 kx ## Configurations
5 kx
5 kx Pkgtools support **GnuPG** signing of packages and also simple
5 kx user interface based on **dialog** library.
5 kx
5 kx #### OpenPGP support options:
5 kx
5 kx ```Bash
5 kx --with-gpg2=no
5 kx --with-gpg2=yes
5 kx --with-gpg2=${TARGET_DEST_DIR}/usr
5 kx ```
5 kx
5 kx If the **--with-gpg2** option is not specified then **GnuPG** support
5 kx is disabled.
5 kx
5 kx #### Dialog options:
5 kx
5 kx ```Bash
5 kx --with-dialog=no
5 kx --with-dialog=yes
5 kx --with-dialog=${TARGET_DEST_DIR}/usr
5 kx --with-dialog-test=no
5 kx --with-dialog-test=yes
5 kx ```
5 kx
5 kx Dialog support is enabled by default. The option **--with-dialog=no**
5 kx disables the dialog support.
5 kx
5 kx
5 kx #### Distribution options:
5 kx
5 kx ```Bash
5 kx --with-distro-name[=NAME] The name of distribution
5 kx --with-distro-version[=VERSION] The distribution version
5 kx ```
5 kx
5 kx To show all available options you can make use of
5 kx
5 kx ```Bash
5 kx $ ./configure --help
5 kx ```
5 kx
5 kx
5 kx ## Cross compilation example
5 kx
5 kx ```Bash
5 kx TARGET_DEST_DIR=/home/developer/prog/trunk-672/dist/.s9xx-glibc/enybox-x2
5 kx TOOLCHAIN_PATH=/opt/toolchains/aarch64-S9XX-linux-glibc/1.1.4/bin
5 kx TARGET=aarch64-s9xx-linux-gnu
5 kx
5 kx DIALOG_CONFIG=${TARGET_DEST_DIR}/usr/bin/dialog-config \
5 kx STRIP="${TOOLCHAIN_PATH}/${TARGET}-strip" \
5 kx CC="${TOOLCHAIN_PATH}/${TARGET}-gcc --sysroot=${TARGET_DEST_DIR}" \
5 kx ./configure --prefix=/usr
5 kx --build=x86_64-pc-linux-gnu \
5 kx --host=${TARGET} \
5 kx --with-gpg2=${TARGET_DEST_DIR}/usr \
5 kx --with-dialog=${TARGET_DEST_DIR}/usr \
5 kx --with-dialog-test=yes
5 kx ```
5 kx
5 kx Also we can make use of additional variables such as **CFLAGS**, **LDFLAGS**:
5 kx
5 kx ```Bash
5 kx LDFLAGS="-L${TARGET_DEST_DIR}/lib -L${TARGET_DEST_DIR}/usr/lib"
5 kx TARGET_INCPATH="-L${TARGET_DEST_DIR}/usr/include"
5 kx CFLAGS="${TARGET_INCPATH}"
5 kx CPPFLAGS="${TARGET_INCPATH}"
5 kx ```
5 kx
5 kx
5 kx ## [Dialog](https://invisible-island.net/dialog/dialog.html)
5 kx
5 kx The original **dialog** sources have some bugs such as memory leaks and also
5 kx the **dialog** package doesn't have correct autotools scripts. If you want to
5 kx use **libdialog** with **pkgtools** then you have to install the dialog package
5 kx with our [patch](doc/dialog/dialog-1.3-20210621.patch). This patch provides
5 kx **dialog.m4** and more convenient **dialog-config** script for
5 kx [dialog-1.3-20210621.tgz](ftp://ftp.invisible-island.net/dialog/dialog-1.3-20210621.tgz)
5 kx source package.
5 kx
5 kx
5 kx ## [License](https://radix.pro/legal/licenses/)
5 kx
5 kx Code and documentation copyright 2009-2023 Andrey V. Kosteltsev.<br/>
5 kx Code and documentation released under [the **Radix.pro** License](https://cgit.radix.pro/radix/pkgtools.git/trunk/LICENSE).
5 kx
5 kx #### The text of this license can be found on our website at:
5 kx
5 kx > [https://radix.pro/licenses/LICENSE-1.0-en_US.txt](https://radix.pro/licenses/LICENSE-1.0-en_US.txt)<br/>
5 kx > [https://radix.pro/licenses/LICENSE-1.0-en_US.txt](https://radix.pro/licenses/LICENSE-1.0-ru_RU.txt)