#!/bin/sh
+set -o errexit
+
# First argument of this script is the package name
# Reading system configuration informations, functions and package versions.
source ../functions
source ../packages-list
-CUR_DIR=$(pwd)
-
# Applying patches (if any)
-apply_patches ${1} &&
+apply_patches ${1}
MMPREFIX="/usr/lib/mailman"
-hv_groupadd mailman &&
-hv_useradd -c "GNU-Mailman" -d ${MMPREFIX} -g mailman -s /bin/false mailman &&
+hv_groupadd mailman
+hv_useradd -c "GNU-Mailman" -d ${MMPREFIX} -g mailman -s /bin/false mailman
# Creating installation directory with correct permissions and ownerships.
-install --owner=mailman --group=mailman --mode=02775 -d ${MMPREFIX} &&
+install --owner=mailman --group=mailman --mode=02775 -d ${MMPREFIX}
# Problems when using a separate build directory
-cd ${LFS_TMP}/${1} &&
+cd ${LFS_TMP}/${1}
../${1}/configure \
--prefix=${MMPREFIX} \
--with-cgi-gid=${APACHE_USER} \
--with-mail-gid=${SENDMAIL_GID} \
- --sysconfdir=/etc &&
-make &&
-make install &&
+ --sysconfdir=/etc
+make
+make install
# Checking installation directory permissions
-${MMPREFIX}/bin/check_perms -f &&
+${MMPREFIX}/bin/check_perms -f
# Configure the web server to enable CGI script permission in the $prefix/cgi-bin
# to run CGI scripts.
string_add "ScriptAlias /mailman/ ${MMPREFIX}/cgi-bin/" /etc/apache/httpd.conf
# Creating directory for mailman icons with correct permissions and ownerships.
-install --owner=mailman --group=mailman --mode=2775 -d /srv/www/icons/mailman &&
+install --owner=mailman --group=mailman --mode=2775 -d /srv/www/icons/mailman
# Copy the Mailman, Python, and GNU logos to a location accessible to the web server.
-cp ${MMPREFIX}/icons/*.{jpg,png} /srv/www/icons/mailman &&
+cp ${MMPREFIX}/icons/*.{jpg,png} /srv/www/icons/mailman
# Specify location of icons directory in mailman configuration file.
-string_add "IMAGE_LOGOS = '/icons/mailman/'" ${MMPREFIX}/Mailman/mm_cfg.py &&
+string_add "IMAGE_LOGOS = '/icons/mailman/'" ${MMPREFIX}/Mailman/mm_cfg.py
# Addition to /etc/apache/httpd.conf
# First, checking if section exists
if ! grep "/pipermail/" /etc/apache/httpd.conf 1> /dev/null 2>&1; then
- echo "Alias /pipermail/ ${MMPREFIX}/archives/public/" >> /etc/apache/httpd.conf &&
- echo "<Directory /usr/lib/mailman/archives/public/>" >> /etc/apache/httpd.conf &&
- echo " Options FollowSymLinks" >> /etc/apache/httpd.conf &&
- echo " AllowOverride None" >> /etc/apache/httpd.conf &&
- echo " AddDefaultCharset Off" >> /etc/apache/httpd.conf &&
- echo "</Directory>" >> /etc/apache/httpd.conf || exit 1
-fi &&
+ echo "Alias /pipermail/ ${MMPREFIX}/archives/public/" >> /etc/apache/httpd.conf
+ echo "<Directory /usr/lib/mailman/archives/public/>" >> /etc/apache/httpd.conf
+ echo " Options FollowSymLinks" >> /etc/apache/httpd.conf
+ echo " AllowOverride None" >> /etc/apache/httpd.conf
+ echo " AddDefaultCharset Off" >> /etc/apache/httpd.conf
+ echo "</Directory>" >> /etc/apache/httpd.conf
+fi
# Setting default password
-/usr/lib/mailman/bin/mmsitepass mailman &&
+/usr/lib/mailman/bin/mmsitepass mailman
# Adding cron entries
-cat > /etc/fcron/mailman.crontab << "EOF" &&
+cat > /etc/fcron/mailman.crontab << "EOF"
#
# !mailto(postmaster)
#
# GZIP_ARCHIVE_TXT_FILES is false in mm_cfg.py
#27 3 * * * /usr/bin/python -S _MMPREFIX_/cron/nightly_gzip
EOF
-sed -i -e "s!_MMPREFIX_!${MMPREFIX}!g" /etc/fcron/mailman.crontab &&
+sed -i -e "s!_MMPREFIX_!${MMPREFIX}!g" /etc/fcron/mailman.crontab
string_add "fcrontab -u mailman -c /etc/fcron/fcron.conf /etc/fcron/mailman.crontab" \
- /etc/fcron/configure &&
+ /etc/fcron/configure
# Reloading cron configuration
-/etc/fcron/configure &&
+/etc/fcron/configure
# Bootscript
-install -v -m740 ${CUR_DIR}/bootscripts/mailman /etc/rc.d/init.d &&
+install -v -m740 ${SCRDIR}/bootscripts/mailman /etc/rc.d/init.d
# script-name start stop
-bootscript_add_rc3 mailman 75 15 &&
+bootscript_add_rc3 mailman 75 15
# URL
-string_add "DEFAULT_EMAIL_HOST = '_DOMAIN_'" ${MMPREFIX}/Mailman/mm_cfg.py &&
-string_add "DEFAULT_URL_HOST = 'www._DOMAIN_'" ${MMPREFIX}/Mailman/mm_cfg.py || exit 1
+string_add "DEFAULT_EMAIL_HOST = '_DOMAIN_'" ${MMPREFIX}/Mailman/mm_cfg.py
+string_add "DEFAULT_URL_HOST = 'www._DOMAIN_'" ${MMPREFIX}/Mailman/mm_cfg.py
if test -n ${HTTPD_PORT}; then
- string_add "DEFAULT_URL_PATTERN = 'http://%s:_DOMAIN_/mailman'" ${MMPREFIX}/Mailman/mm_cfg.py &&
- string_add "PUBLIC_ARCHIVE_URL = 'http://%(hostname)s:_HTTPD_PORT_/pipermail/%(listname)s'" ${MMPREFIX}/Mailman/mm_cfg.py || exit 1
+ string_add "DEFAULT_URL_PATTERN = 'http://%s:_DOMAIN_/mailman'" ${MMPREFIX}/Mailman/mm_cfg.py
+ string_add "PUBLIC_ARCHIVE_URL = 'http://%(hostname)s:_HTTPD_PORT_/pipermail/%(listname)s'" ${MMPREFIX}/Mailman/mm_cfg.py
fi
string_add "add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)" \
- ${MMPREFIX}/Mailman/mm_cfg.py &&
-sed -i -e "s!_HTTPD_PORT_!${HTTPD_PORT}!g" ${MMPREFIX}/Mailman/mm_cfg.py &&
+ ${MMPREFIX}/Mailman/mm_cfg.py
+sed -i -e "s!_HTTPD_PORT_!${HTTPD_PORT}!g" ${MMPREFIX}/Mailman/mm_cfg.py
sed -i -e "s!_DOMAIN_!${DOMAIN}!g" ${MMPREFIX}/Mailman/mm_cfg.py
-# Return last error
exit $?