Radix cross Linux package tools

Package Tools – is a set of utilities to create, install, and update RcL packages

3 Commits   0 Branches   2 Tags
11c606a6 (kx 2023-04-11 01:18:34 +0300   1) 
11c606a6 (kx 2023-04-11 01:18:34 +0300   2) # [Package Tools](https://radix.pro/build-system/pkgtool/)
11c606a6 (kx 2023-04-11 01:18:34 +0300   3) 
11c606a6 (kx 2023-04-11 01:18:34 +0300   4) **pkgtools** is a set of programs to create, install, remove, and update
11c606a6 (kx 2023-04-11 01:18:34 +0300   5) packages on the root file system.
11c606a6 (kx 2023-04-11 01:18:34 +0300   6) 
11c606a6 (kx 2023-04-11 01:18:34 +0300   7) ## Table of contents
11c606a6 (kx 2023-04-11 01:18:34 +0300   8) 
11c606a6 (kx 2023-04-11 01:18:34 +0300   9) * [Bootstrap script](#bootstrap-script)
11c606a6 (kx 2023-04-11 01:18:34 +0300  10) * [Install](#install)
11c606a6 (kx 2023-04-11 01:18:34 +0300  11) * [Configurations](#configurations)
11c606a6 (kx 2023-04-11 01:18:34 +0300  12) * [Cross compilation example](#cross-compilation-example)
11c606a6 (kx 2023-04-11 01:18:34 +0300  13) * [Dialog](#dialog)
11c606a6 (kx 2023-04-11 01:18:34 +0300  14) * [License](#license)
11c606a6 (kx 2023-04-11 01:18:34 +0300  15) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  16) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  17) ## Bootstrap script
11c606a6 (kx 2023-04-11 01:18:34 +0300  18) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  19) The **bootstrap** script aspecialy created for autotools install automation.
11c606a6 (kx 2023-04-11 01:18:34 +0300  20) To install autotools into source directory on build machine (i.e. when
11c606a6 (kx 2023-04-11 01:18:34 +0300  21) **build == host**) the bootstrap script can be run without arguments. In this
11c606a6 (kx 2023-04-11 01:18:34 +0300  22) case autotools will be installed from current root file system.
11c606a6 (kx 2023-04-11 01:18:34 +0300  23) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  24) For the cross environment the **--target-dest-dir** options allows to install
11c606a6 (kx 2023-04-11 01:18:34 +0300  25) some stuf from development root file system:
11c606a6 (kx 2023-04-11 01:18:34 +0300  26) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  27) ```Bash
11c606a6 (kx 2023-04-11 01:18:34 +0300  28) $ TARGET_DEST_DIR=/home/developer/prog/trunk-672/dist/.s9xx-glibc/enybox-x2 \
11c606a6 (kx 2023-04-11 01:18:34 +0300  29)   ./bootstrap --target-dest-dir=${TARGET_DEST_DIR}
11c606a6 (kx 2023-04-11 01:18:34 +0300  30) ```
11c606a6 (kx 2023-04-11 01:18:34 +0300  31) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  32) For example, in this case the **dialog.m4** script will be taken from the
11c606a6 (kx 2023-04-11 01:18:34 +0300  33) **${TARGET_DEST_DIR}/usr/share/aclocal** directory.
11c606a6 (kx 2023-04-11 01:18:34 +0300  34) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  35) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  36) ## Install
11c606a6 (kx 2023-04-11 01:18:34 +0300  37) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  38) On the build machine the installation process seems like that
11c606a6 (kx 2023-04-11 01:18:34 +0300  39) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  40) ```Bash
11c606a6 (kx 2023-04-11 01:18:34 +0300  41) $ tar xJvf pkgtools-0.2.1.tar.xz
11c606a6 (kx 2023-04-11 01:18:34 +0300  42) $ mkdir build
11c606a6 (kx 2023-04-11 01:18:34 +0300  43) $ cd build
11c606a6 (kx 2023-04-11 01:18:34 +0300  44) $ ../pkgtools-0.2.1/configure --prefix=/usr
11c606a6 (kx 2023-04-11 01:18:34 +0300  45) $ make
11c606a6 (kx 2023-04-11 01:18:34 +0300  46) $ make install DESTDIR=$PKG exec_prefix=/
11c606a6 (kx 2023-04-11 01:18:34 +0300  47) ```
11c606a6 (kx 2023-04-11 01:18:34 +0300  48) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  49) Note that the **exec_prefix=/** used for canonical installation of
11c606a6 (kx 2023-04-11 01:18:34 +0300  50) pkgtools utilities into **${DESTDIR}/sbin/** directory instead of
11c606a6 (kx 2023-04-11 01:18:34 +0300  51) **${DESTDIR}/usr/sbin/** which is not corresponds to
11c606a6 (kx 2023-04-11 01:18:34 +0300  52) [**FHS**](https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf).
11c606a6 (kx 2023-04-11 01:18:34 +0300  53) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  54) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  55) ## Configurations
11c606a6 (kx 2023-04-11 01:18:34 +0300  56) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  57) Pkgtools support **GnuPG** signing of packages and also simple
11c606a6 (kx 2023-04-11 01:18:34 +0300  58) user interface based on **dialog** library.
11c606a6 (kx 2023-04-11 01:18:34 +0300  59) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  60) #### OpenPGP support options:
11c606a6 (kx 2023-04-11 01:18:34 +0300  61) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  62) ```Bash
11c606a6 (kx 2023-04-11 01:18:34 +0300  63)   --with-gpg2=no
11c606a6 (kx 2023-04-11 01:18:34 +0300  64)   --with-gpg2=yes
11c606a6 (kx 2023-04-11 01:18:34 +0300  65)   --with-gpg2=${TARGET_DEST_DIR}/usr
11c606a6 (kx 2023-04-11 01:18:34 +0300  66) ```
11c606a6 (kx 2023-04-11 01:18:34 +0300  67) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  68) If the **--with-gpg2** option is not specified then **GnuPG** support
11c606a6 (kx 2023-04-11 01:18:34 +0300  69) is disabled.
11c606a6 (kx 2023-04-11 01:18:34 +0300  70) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  71) #### Dialog options:
11c606a6 (kx 2023-04-11 01:18:34 +0300  72) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  73) ```Bash
11c606a6 (kx 2023-04-11 01:18:34 +0300  74)   --with-dialog=no
11c606a6 (kx 2023-04-11 01:18:34 +0300  75)   --with-dialog=yes
11c606a6 (kx 2023-04-11 01:18:34 +0300  76)   --with-dialog=${TARGET_DEST_DIR}/usr
11c606a6 (kx 2023-04-11 01:18:34 +0300  77)   --with-dialog-test=no
11c606a6 (kx 2023-04-11 01:18:34 +0300  78)   --with-dialog-test=yes
11c606a6 (kx 2023-04-11 01:18:34 +0300  79) ```
11c606a6 (kx 2023-04-11 01:18:34 +0300  80) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  81) Dialog support is enabled by default. The option **--with-dialog=no**
11c606a6 (kx 2023-04-11 01:18:34 +0300  82) disables the dialog support.
11c606a6 (kx 2023-04-11 01:18:34 +0300  83) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  84) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  85) #### Distribution options:
11c606a6 (kx 2023-04-11 01:18:34 +0300  86) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  87) ```Bash
11c606a6 (kx 2023-04-11 01:18:34 +0300  88)   --with-distro-name[=NAME]        The name of distribution
11c606a6 (kx 2023-04-11 01:18:34 +0300  89)   --with-distro-version[=VERSION]  The distribution version
11c606a6 (kx 2023-04-11 01:18:34 +0300  90) ```
11c606a6 (kx 2023-04-11 01:18:34 +0300  91) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  92) To show all available options you can make use of
11c606a6 (kx 2023-04-11 01:18:34 +0300  93) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  94) ```Bash
11c606a6 (kx 2023-04-11 01:18:34 +0300  95) $ ./configure --help
11c606a6 (kx 2023-04-11 01:18:34 +0300  96) ```
11c606a6 (kx 2023-04-11 01:18:34 +0300  97) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  98) 
11c606a6 (kx 2023-04-11 01:18:34 +0300  99) ## Cross compilation example
11c606a6 (kx 2023-04-11 01:18:34 +0300 100) 
11c606a6 (kx 2023-04-11 01:18:34 +0300 101) ```Bash
11c606a6 (kx 2023-04-11 01:18:34 +0300 102) TARGET_DEST_DIR=/home/developer/prog/trunk-672/dist/.s9xx-glibc/enybox-x2
11c606a6 (kx 2023-04-11 01:18:34 +0300 103) TOOLCHAIN_PATH=/opt/toolchains/aarch64-S9XX-linux-glibc/1.1.4/bin
11c606a6 (kx 2023-04-11 01:18:34 +0300 104) TARGET=aarch64-s9xx-linux-gnu
11c606a6 (kx 2023-04-11 01:18:34 +0300 105) 
11c606a6 (kx 2023-04-11 01:18:34 +0300 106) DIALOG_CONFIG=${TARGET_DEST_DIR}/usr/bin/dialog-config \
11c606a6 (kx 2023-04-11 01:18:34 +0300 107) STRIP="${TOOLCHAIN_PATH}/${TARGET}-strip" \
11c606a6 (kx 2023-04-11 01:18:34 +0300 108) CC="${TOOLCHAIN_PATH}/${TARGET}-gcc --sysroot=${TARGET_DEST_DIR}" \
11c606a6 (kx 2023-04-11 01:18:34 +0300 109) ./configure --prefix=/usr
11c606a6 (kx 2023-04-11 01:18:34 +0300 110)   --build=x86_64-pc-linux-gnu \
11c606a6 (kx 2023-04-11 01:18:34 +0300 111)   --host=${TARGET} \
11c606a6 (kx 2023-04-11 01:18:34 +0300 112)   --with-gpg2=${TARGET_DEST_DIR}/usr \
11c606a6 (kx 2023-04-11 01:18:34 +0300 113)   --with-dialog=${TARGET_DEST_DIR}/usr \
11c606a6 (kx 2023-04-11 01:18:34 +0300 114)   --with-dialog-test=yes
11c606a6 (kx 2023-04-11 01:18:34 +0300 115) ```
11c606a6 (kx 2023-04-11 01:18:34 +0300 116) 
11c606a6 (kx 2023-04-11 01:18:34 +0300 117) Also we can make use of additional variables such as **CFLAGS**, **LDFLAGS**:
11c606a6 (kx 2023-04-11 01:18:34 +0300 118) 
11c606a6 (kx 2023-04-11 01:18:34 +0300 119) ```Bash
11c606a6 (kx 2023-04-11 01:18:34 +0300 120) LDFLAGS="-L${TARGET_DEST_DIR}/lib -L${TARGET_DEST_DIR}/usr/lib"
11c606a6 (kx 2023-04-11 01:18:34 +0300 121) TARGET_INCPATH="-L${TARGET_DEST_DIR}/usr/include"
11c606a6 (kx 2023-04-11 01:18:34 +0300 122) CFLAGS="${TARGET_INCPATH}"
11c606a6 (kx 2023-04-11 01:18:34 +0300 123) CPPFLAGS="${TARGET_INCPATH}"
11c606a6 (kx 2023-04-11 01:18:34 +0300 124) ```
11c606a6 (kx 2023-04-11 01:18:34 +0300 125) 
11c606a6 (kx 2023-04-11 01:18:34 +0300 126) 
11c606a6 (kx 2023-04-11 01:18:34 +0300 127) ## [Dialog](https://invisible-island.net/dialog/dialog.html)
11c606a6 (kx 2023-04-11 01:18:34 +0300 128) 
11c606a6 (kx 2023-04-11 01:18:34 +0300 129) The original **dialog** sources have some bugs such as memory leaks and also
11c606a6 (kx 2023-04-11 01:18:34 +0300 130) the **dialog** package doesn't have correct autotools scripts. If you want to
11c606a6 (kx 2023-04-11 01:18:34 +0300 131) use **libdialog** with **pkgtools** then you have to install the dialog package
11c606a6 (kx 2023-04-11 01:18:34 +0300 132) with our [patch](doc/dialog/dialog-1.3-20210621.patch). This patch provides
11c606a6 (kx 2023-04-11 01:18:34 +0300 133) **dialog.m4** and more convenient **dialog-config** script for
11c606a6 (kx 2023-04-11 01:18:34 +0300 134) [dialog-1.3-20210621.tgz](ftp://ftp.invisible-island.net/dialog/dialog-1.3-20210621.tgz)
11c606a6 (kx 2023-04-11 01:18:34 +0300 135) source package.
11c606a6 (kx 2023-04-11 01:18:34 +0300 136) 
11c606a6 (kx 2023-04-11 01:18:34 +0300 137) 
11c606a6 (kx 2023-04-11 01:18:34 +0300 138) ## [License](https://radix.pro/legal/licenses/)
11c606a6 (kx 2023-04-11 01:18:34 +0300 139) 
11c606a6 (kx 2023-04-11 01:18:34 +0300 140) Code and documentation copyright 2009-2023 Andrey V. Kosteltsev.<br/>
11c606a6 (kx 2023-04-11 01:18:34 +0300 141) Code and documentation released under [the **Radix.pro** License](https://cgit.radix.pro/radix/pkgtools.git/trunk/LICENSE).
11c606a6 (kx 2023-04-11 01:18:34 +0300 142) 
11c606a6 (kx 2023-04-11 01:18:34 +0300 143) #### The text of this license can be found on our website at:
11c606a6 (kx 2023-04-11 01:18:34 +0300 144) 
11c606a6 (kx 2023-04-11 01:18:34 +0300 145) > [https://radix.pro/licenses/LICENSE-1.0-en_US.txt](https://radix.pro/licenses/LICENSE-1.0-en_US.txt)<br/>
11c606a6 (kx 2023-04-11 01:18:34 +0300 146) > [https://radix.pro/licenses/LICENSE-1.0-en_US.txt](https://radix.pro/licenses/LICENSE-1.0-ru_RU.txt)