-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
39 lines (30 loc) · 1.38 KB
/
build.sh
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
#!/bin/bash
set -e
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # Script to auto build packages from Slackbuilds.org # #
# # by - SpaceInvaderOne # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# only run if autobuild is set to yes
if [ "$AUTOBUILD" = "yes" ]; then
# working directory
cd /app
# download the SlackBuild
wget -O slackbuild.tar.gz "$SLACKBUILD_DOWNLOAD"
# process the file
SLACKBUILD_DIR=$(tar -tzf slackbuild.tar.gz | head -1 | cut -f1 -d"/")
tar -xzf slackbuild.tar.gz
rm slackbuild.tar.gz
# cd into the extracted directory
cd "$SLACKBUILD_DIR"
# download source into the directory
wget "$SOURCE_DOWNLOAD"
# make executable and run the SlackBuild script
chmod +x *.SlackBuild
./$(ls *.SlackBuild)
# say where the package is
echo "Build completed. Check the /tmp directory for the built package."
else
echo "AUTOBUILD is not set to 'yes'. Skipping automatic build."
# keep the container running
tail -f /dev/null
fi