Archived
40 lines
1.4 KiB
Bash
40 lines
1.4 KiB
Bash
# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package
|
|
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
|
|
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
|
|
|
|
# The prepare function is executed in the root of the temp directory
|
|
# This function is used for putting downloaded files to the correct location or applying patches
|
|
prepare() {
|
|
cd "$BPM_SOURCE"
|
|
for p in "$BPM_WORKDIR"/*.patch; do
|
|
patch -Np1 -i "$p"
|
|
done
|
|
|
|
local OPTS=(
|
|
PREFIX=/usr
|
|
BINDIR=/usr/bin
|
|
MANDIR=/usr/share/man
|
|
SYSCONFDIR=/etc
|
|
MAILRC=/etc/mailx.rc
|
|
MAILSPOOL=/var/mail
|
|
UCBINSTALL=/usr/bin/install
|
|
SENDMAIL=/usr/sbin/sendmail
|
|
)
|
|
echo "${OPTS[@]}" > makeflags
|
|
}
|
|
|
|
# The build function is executed in the source directory
|
|
# This function is used to compile the source code
|
|
build() {
|
|
make $(cat makeflags) IPv6=-DHAVE_IPv6_FUNCS CFLAGS="${CFLAGS} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
|
|
}
|
|
|
|
# The package function is executed in the source directory
|
|
# This function is used to move the compiled files into the output directory
|
|
package() {
|
|
make $(cat makeflags) DESTDIR="$BPM_OUTPUT" install
|
|
|
|
# Install package license
|
|
install -Dm644 "$BPM_SOURCE"/COPYING "$BPM_OUTPUT"/usr/share/licenses/mailx/COPYING
|
|
}
|