Skip to content

Commit e622a02

Browse files
authored
[DOCS] Add guides for building FreeSWITCH build-dependencies
* [DOCS] Add guides for building FreeSWITCH build-dependencies * Add `build-dependencies.sh` script
1 parent 675bd8f commit e622a02

File tree

11 files changed

+1498
-11
lines changed

11 files changed

+1498
-11
lines changed

scripts/packaging/build/README.md

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
# Building FreeSWITCH packages using `FSDEB`
2+
## Install build dependencies first
3+
In order to build FreeSWITCH packages first you need to install build dependencies. There are two ways:
4+
* [From our FreeSWITCH Debian repository](#install-build-dependencies-from-repo) (using [FSGET](/scripts/packaging) for example) - the simplest way
5+
* [Manually compile the build dependencies](#manually-compile-build-dependencies)
6+
7+
<a name="install-build-dependencies-from-repo"></a>
8+
### Configuring FreeSWITCH Debian repo (for dependencies)
9+
Since we are building a FreeSWITCH release let's configure FreeSWITCH Community Release Debian repo.
10+
We recommend using [FSGET](/scripts/packaging).
11+
12+
Replace `<PAT or API token>` with your `SignalWire Personal Access Token (PAT)`
13+
[HOWTO Create a SignalWire Personal Access Token](https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Installation/how-to-create-a-personal-access-token/how-to-create-a-personal-access-token)
14+
```bash
15+
curl -sSL https://freeswitch.org/fsget | bash -s <PAT or API token>
16+
```
17+
Configuring the repo is enough. Dependencies will be installed during the FreeSWITCH building process.
18+
19+
<a name="manually-compile-build-dependencies"></a>
20+
### Manually compile the build dependencies
21+
Just follow this [Dependency Building Guide](dependencies/README.md) without the need to set up the FreeSWITCH Debian repo.</br>
22+
Although we recommend using the FreeSWITCH Debian repo as all the dependencies are already prebuilt for you.
23+
24+
---
225
## Prerequisites
3-
FreeSWITCH packages can be built when FreeSWITCH is cloned using `git` only.
26+
FreeSWITCH packages can be built when FreeSWITCH is cloned using `git` only.
427
(Methods described here won't work if you download a source tarball and extract it)
528

629
Please make sure you have `git` and `curl` installed:
@@ -17,16 +40,7 @@ cd /usr/src
1740
git clone https://github.com/signalwire/freeswitch -b v1.10
1841
```
1942

20-
## Configuring FreeSWITCH Debian repo (for dependencies)
21-
Since we are building a FreeSWITCH release let's configure FreeSWITCH Community Release Debian repo.
22-
We recommend using [FSGET](/scripts/packaging).
23-
24-
Replace `<PAT or API token>` with your `SignalWire Personal Access Token (PAT)`
25-
[HOWTO Create a SignalWire Personal Access Token](https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Installation/how-to-create-a-personal-access-token/how-to-create-a-personal-access-token)
26-
```bash
27-
curl -sSL https://freeswitch.org/fsget | bash -s <PAT or API token>
28-
```
29-
43+
---
3044
## Building packages with `FSDEB`
3145
```bash
3246
curl -sSL https://freeswitch.org/fsdeb | bash -s -- -b 999 -o /usr/src/fsdebs/ -w /usr/src/freeswitch
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# FreeSWITCH Build Dependencies
2+
3+
This directory is organized into subfolders, where each subfolder contains build instructions for a single Debian package. These packages are dependencies required to build FreeSWITCH's Debian packages.
4+
5+
## Recommended order of building:
6+
7+
- [libbroadvoice](libbroadvoice/README.md)
8+
- [libilbc](libilbc/README.md)
9+
- [libsilk](libsilk/README.md)
10+
- [spandsp](spandsp/README.md)
11+
- [sofia-sip](sofia-sip/README.md)
12+
- [libks](libks/README.md)
13+
- [signalwire-c](signalwire-c/README.md)
14+
- [libv8](libv8/README.md) (only for `AMD64`)
15+
16+
## Build Dependencies Script
17+
18+
A convenient script `build-dependencies.sh` is provided to automate the building of dependencies. This script offers several options to customize the build process.
19+
20+
### Usage
21+
22+
```bash
23+
./build-dependencies.sh [options] [library_names...]
24+
```
25+
26+
### Options
27+
28+
- `-h, --help`: Show the help message
29+
- `-b, --build-number N`: Set build number (default: 42 or env value)
30+
- `-a, --all`: Build all libraries
31+
- `-s, --setup`: Set up build environment before building
32+
- `-o, --output DIR`: Set output directory (default: /var/local/deb)
33+
- `-p, --prefix DIR`: Set source path prefix (default: /usr/src)
34+
- `-r, --repo`: Set up local repository after building
35+
- `-c, --clone`: Clone required repositories before building
36+
- `-g, --git-https`: Use HTTPS instead of SSH for git cloning
37+
38+
### Examples
39+
40+
Set up environment, clone repositories, and build all dependencies:
41+
```bash
42+
./build-dependencies.sh --build-number 123 --setup --all --repo --clone
43+
```
44+
45+
Complete build with all options (setup environment, build all libraries, create local repo, clone repos with HTTPS):
46+
```bash
47+
./build-dependencies.sh --build-number 123 --setup --all --repo --clone --git-https
48+
```
49+
50+
Build specific libraries with full automation:
51+
```bash
52+
./build-dependencies.sh --build-number 123 --setup --repo --clone --git-https libks signalwire-c
53+
```
54+
55+
### Running in Docker
56+
57+
You can run the build script inside a Docker container for a clean, isolated build environment:
58+
59+
```bash
60+
docker run -it -v $(pwd):/root/scripts debian:bookworm bash -c "cd /root/scripts && bash"
61+
```

0 commit comments

Comments
 (0)