summaryrefslogtreecommitdiff
path: root/contrib/build-with-debian/README.md
blob: 0e3b895a8e339dc084b29a23549f5e2f2d92bd3f (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

Showcase how to build and install on debian
===========================================

Guide how to build on a debian based system.


## Get Source

Change into an EMPTY directory and do:

```sh
git clone --depth=256 https://github.com/hiddenalpha/DeflateAndInflate.git ./.
```


## Choose a debian 9 system.

Take the debian system you want to use to build. A nice way to achieve
this is via docker (TIPP: take an older image for better ABI
portability):

In the command below, make sure WORK points to the dir where you cloned
the project to.

```sh
true \
    && WORK="$PWD" \
    && IMG=debian:oldstable-20230208-slim \
    && CNTR=DeflateAndInflate-DebianBuild \
    && docker pull "${IMG:?}" \
    && docker create --name "${CNTR:?}" -v "${WORK:?}:/work" -w /work "${IMG:?}" sh -c "while true;do sleep 1||break;done" \
    && docker start "${CNTR:?}" \
    && true
```


## Setup build environment

```sh
docker exec -ti -u0:0 "${CNTR:?}" sh -c 'true\
    && apt-get update \
    && apt-get install -y --no-install-recommends \
           curl gcc git make libc-dev ca-certificates tar zlib1g-dev \
    && true'
```


## configure & make

```sh
docker exec -ti -u$(id -u):$(id -g) "${CNTR:?}" sh -c 'true\
    && ./configure \
    && make -e clean \
    && make -e \
    && true'
```

A ready-to-distribute tarball is now ready in `./dist/`. If you'd like
to install it somewhere else, all you need is this tarball. If you want
to install on same system where you did build you can continue with the
*install* step below.


## install

BTW: This does nothing else than unpacking the built tar into configured
     directories.

```sh
make -e install
```