Files
exim/recipe.sh

76 lines
2.4 KiB
Bash

# This is the recipe.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"
install -Dm644 "$BPM_WORKDIR"/Makefile Local/Makefile
}
# The build function is executed in the source directory
# This function is used to compile the source code
build() {
make
}
# The package function is executed in the source directory
# This function is used to move the compiled files into the output directory
package() {
local BINS=(
exicyclog
exigrep
exim
exim_checkaccess
exim_dbmbuild
exim_dumpdb
exim_fixdb
exim_id_update
exim_lock
exim_msgdate
exim_tidydb
eximstats
exinext
exipick
exiqgrep
exiqsumm
exiwhat
)
pushd build-Linux-"${BPM_PKG_ARCH}"
install -Dm755 ${BINS[@]} -t "$BPM_OUTPUT"/usr/sbin/
chmod u+s "$BPM_OUTPUT"/usr/sbin/exim
for i in mailq newaliases rmail rsmtp runq sendmail; do
ln -sf exim "$BPM_OUTPUT"/usr/sbin/"$i"
done
popd
# Install documentation
install -Dm644 doc/exim.8 "$BPM_OUTPUT"/usr/share/man/man8/exim.8
# Install configuration file
install -Dm644 "$BPM_WORKDIR"/aliases "$BPM_OUTPUT"/etc/mail/aliases
sed -e "s#/etc/aliases#/etc/mail/aliases#g" \
-e "s#SYSTEM_ALIASES_FILE#/etc/mail/aliases#g" \
src/configure.default | install -Dm0644 /dev/stdin "$BPM_OUTPUT"/etc/mail/exim.conf
# Symlink for FHS compliancy
install -d "$BPM_OUTPUT"/usr/lib
ln -sf ../sbin/exim "$BPM_OUTPUT"/usr/lib/sendmail
# Install sysusers file
install -Dm644 "$BPM_WORKDIR"/sysusers "$BPM_OUTPUT"/usr/lib/sysusers.d/exim.conf
# Install esvm service
install -Dm644 "$BPM_WORKDIR"/exim.esv "$BPM_OUTPUT"/etc/esvm/services/exim.esv
# Install directories
install -dm770 -o root -g 79 "$BPM_OUTPUT"/var/spool/exim
install -dm770 -o 79 -g 79 "$BPM_OUTPUT"/var/spool/exim/db
install -dm770 -o root -g 79 "$BPM_OUTPUT"/var/log/exim
# Install package license
install -Dm644 "$BPM_SOURCE"/LICENCE "$BPM_OUTPUT"/usr/share/licenses/exim/LICENCE
}