25 lines
1.0 KiB
Plaintext
25 lines
1.0 KiB
Plaintext
# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package
|
|
# BPM expects there to be an 'output' directory under the root of the temporary directory after this script finishes executing, otherwise your program may not be correctly installed
|
|
# It is recommended you create the 'output' directory along with a 'source' directory in the root of the temporary directory like this
|
|
echo "Compiling ${NAME}..."
|
|
# Creating SOURCE and OUTPUT variables
|
|
SOURCE="$(pwd)"/source
|
|
OUTPUT="$(pwd)"/output
|
|
# Creating the 'source' and 'output' directories
|
|
mkdir "$SOURCE"
|
|
mkdir "$OUTPUT"
|
|
# Creating DOWNLOAD and FILENAME variables
|
|
DOWNLOAD="https://www.my-url.com/file.tar.gz"
|
|
FILENAME="${DOWNLOAD##*/}"
|
|
# Downloading files
|
|
wget "$DOWNLOAD"
|
|
# Extracting archive into 'source'
|
|
tar -xvf "$FILENAME" --strip-components=1 -C "$SOURCE"
|
|
# Changing directory into 'source'
|
|
cd "$SOURCE"
|
|
# Configuring and compiling ${NAME}
|
|
./configure --prefix=/usr
|
|
make
|
|
make install DESTDIR="$OUTPUT"
|
|
echo "${NAME} compilation complete!"
|