forked from nomoresat/DPITunnel-cli
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Build, install, and use static libnl3
Signed-off-by: txtsd <[email protected]>
- Loading branch information
Showing
4 changed files
with
40 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/ash | ||
set -x | ||
|
||
# General updates | ||
apk update | ||
apk add cmake openssl openssl-dev openssl-libs-static linux-headers ninja-is-really-ninja alpine-sdk runuser sudo sed | ||
|
||
# Setup build environment | ||
addgroup $(whoami) abuild | ||
mkdir -p /var/cache/distfiles | ||
chmod a+w /var/cache/distfiles | ||
chgrp abuild /var/cache/distfiles | ||
chmod g+w /var/cache/distfiles | ||
cwd=$(pwd) | ||
|
||
# Create user to run abuild | ||
adduser -G abuild -g "Alpine Package Builder" -s /bin/ash -D abuilder | ||
echo "abuilder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers | ||
|
||
# Build static libnl3 | ||
runuser -u abuilder -- /usr/bin/abuild-keygen -n -a -i -b 4096 | ||
cd /home/abuilder | ||
runuser -u abuilder -- git clone https://gitlab.alpinelinux.org/alpine/aports.git --depth 1 | ||
cd /home/abuilder/aports/main/libnl3 | ||
# runuser -u abuilder -- /bin/sed -i "s/subpackages=\"/subpackages=\"\$pkgname-static /" APKBUILD | ||
runuser -u abuilder -- /bin/sed -i "s/--disable-static/--enable-static/" APKBUILD | ||
runuser -u abuilder -- /usr/bin/abuild -r | ||
apk add /home/abuilder/packages/main/$(abuild -A)/libnl3* | ||
|
||
# Build static DPITunnel-cli | ||
cd ${cwd} | ||
cmake -B build -DCMAKE_BUILD_TYPE=RELEASE -DSTATIC_BINARY=true -G Ninja . | ||
cmake --build build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.