summaryrefslogtreecommitdiff
path: root/README.md
blob: deb1152c0ed559112d99ababaa94652e3e140274 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# [Package Tools](https://radix.pro/build-system/pkgtool/)

**pkgtools** is a set of programs to create, install, remove, and update
packages on the root file system.

## Table of contents

* [Bootstrap script](#bootstrap-script)
* [Install](#install)
* [Configurations](#configurations)
* [Cross compilation example](#cross-compilation-example)
* [Dialog](#dialog)
* [License](#license)


## Bootstrap script

The **bootstrap** script aspecialy created for autotools install automation.
To install autotools into source directory on build machine (i.e. when
**build == host**) the bootstrap script can be run without arguments. In this
case autotools will be installed from current root file system.

For the cross environment the **--target-dest-dir** options allows to install
some stuf from development root file system:

```Bash
$ TARGET_DEST_DIR=/home/developer/prog/trunk-672/dist/.s9xx-glibc/enybox-x2 \
  ./bootstrap --target-dest-dir=${TARGET_DEST_DIR}
```

For example, in this case the **dialog.m4** script will be taken from the
**${TARGET_DEST_DIR}/usr/share/aclocal** directory.


## Install

On the build machine the installation process seems like that

```Bash
$ tar xJvf pkgtools-0.2.2.tar.xz
$ mkdir build
$ cd build
$ ../pkgtools-0.2.2/configure --prefix=/usr
$ make
$ make install DESTDIR=$PKG exec_prefix=/
```

Note that the **exec_prefix=/** used for canonical installation of
pkgtools utilities into **${DESTDIR}/sbin/** directory instead of
**${DESTDIR}/usr/sbin/** which is not corresponds to
[**FHS**](https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf).


## Configurations

Pkgtools support **GnuPG** signing of packages and also simple
user interface based on **dialog** library.

#### OpenPGP support options:

```Bash
  --with-gpg2=no
  --with-gpg2=yes
  --with-gpg2=${TARGET_DEST_DIR}/usr
```

If the **--with-gpg2** option is not specified then **GnuPG** support
is disabled.

#### Dialog options:

```Bash
  --with-dialog=no
  --with-dialog=yes
  --with-dialog=${TARGET_DEST_DIR}/usr
  --with-dialog-test=no
  --with-dialog-test=yes
```

Dialog support is enabled by default. The option **--with-dialog=no**
disables the dialog support.


#### Distribution options:

```Bash
  --with-distro-name[=NAME]        The name of distribution
  --with-distro-version[=VERSION]  The distribution version
```

To show all available options you can make use of

```Bash
$ ./configure --help
```


## Cross compilation example

```Bash
TARGET_DEST_DIR=/home/developer/prog/trunk-672/dist/.s9xx-glibc/enybox-x2
TOOLCHAIN_PATH=/opt/toolchains/aarch64-S9XX-linux-glibc/1.1.4/bin
TARGET=aarch64-s9xx-linux-gnu

DIALOG_CONFIG=${TARGET_DEST_DIR}/usr/bin/dialog-config \
STRIP="${TOOLCHAIN_PATH}/${TARGET}-strip" \
CC="${TOOLCHAIN_PATH}/${TARGET}-gcc --sysroot=${TARGET_DEST_DIR}" \
./configure --prefix=/usr
  --build=x86_64-pc-linux-gnu \
  --host=${TARGET} \
  --with-gpg2=${TARGET_DEST_DIR}/usr \
  --with-dialog=${TARGET_DEST_DIR}/usr \
  --with-dialog-test=yes
```

Also we can make use of additional variables such as **CFLAGS**, **LDFLAGS**:

```Bash
LDFLAGS="-L${TARGET_DEST_DIR}/lib -L${TARGET_DEST_DIR}/usr/lib"
TARGET_INCPATH="-L${TARGET_DEST_DIR}/usr/include"
CFLAGS="${TARGET_INCPATH}"
CPPFLAGS="${TARGET_INCPATH}"
```


## [Dialog](https://invisible-island.net/dialog/dialog.html)

The original **dialog** sources have some bugs such as memory leaks and also
the **dialog** package doesn't have correct autotools scripts. If you want to
use **libdialog** with **pkgtools** then you have to install the dialog package
with our [patch](doc/dialog/dialog-1.3-20210621.patch). This patch provides
**dialog.m4** and more convenient **dialog-config** script for
[dialog-1.3-20210621.tgz](ftp://ftp.invisible-island.net/dialog/dialog-1.3-20210621.tgz)
source package.


## [License](https://radix.pro/legal/licenses/)

Code and documentation copyright 2009-2023 Andrey V. Kosteltsev.<br/>
Code and documentation released under [the **Radix.pro** License](https://cgit.radix.pro/radix/pkgtools.git/trunk/LICENSE).

#### The text of this license can be found on our website at:

> [https://radix.pro/licenses/LICENSE-1.0-en_US.txt](https://radix.pro/licenses/LICENSE-1.0-en_US.txt)<br/>
> [https://radix.pro/licenses/LICENSE-1.0-en_US.txt](https://radix.pro/licenses/LICENSE-1.0-ru_RU.txt)