#!/bin/sh set -o errexit # First argument of this script is the package name # Reading system configuration informations, functions and package versions. source ../sysinfos source ../functions source ../packages-list # Applying patches (if any) apply_patches ${1} MMPREFIX="/usr/lib/mailman" groupadd -f 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} # Problems when using a separate build directory cd ${LFS_TMP}/${1} ../${1}/configure \ --prefix=${MMPREFIX} \ --with-cgi-gid=${APACHE_USER} \ --with-mail-gid=${SENDMAIL_GID} \ --sysconfdir=/etc make make install # Checking installation directory permissions ${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 # Copy the Mailman, Python, and GNU logos to a location accessible to the web server. 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 # 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 "" >> /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 "" >> /etc/apache/httpd.conf fi # Setting default password /usr/lib/mailman/bin/mmsitepass mailman # Adding cron entries cat > /etc/fcron/mailman.crontab << "EOF" # # !mailto(postmaster) # # This is needed because the mailman user doesn't have a # login shell defined in /etc/passwd. SHELL = /bin/sh # # At 8AM every day, mail reminders to admins as to pending requests. # They are less likely to ignore these reminders if they're mailed # early in the morning, but of course, this is local time... ;) 0 8 * * * /usr/bin/python -S _MMPREFIX_/cron/checkdbs # # At 9AM, send notifications to disabled members that are due to be # reminded to re-enable their accounts. 0 9 * * * /usr/bin/python -S _MMPREFIX_/cron/disabled # # Noon, mail digests for lists that do periodic as well as threshhold delivery. 0 12 * * * /usr/bin/python -S _MMPREFIX_/cron/senddigests # # 5 AM on the first of each month, mail out password reminders. 0 5 1 * * /usr/bin/python -S _MMPREFIX_/cron/mailpasswds # # Every 5 mins, try to gate news to mail. You can comment this one out # if you don't want to allow gating, or don't have any going on right now, # or want to exclusively use a callback strategy instead of polling. #0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/bin/python -S _MMPREFIX_/cron/gate_news # # At 3:27am every night, regenerate the gzip'd archive file. Only # turn this on if the internal archiver is used and # 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 string_add "fcrontab -u mailman -c /etc/fcron/fcron.conf /etc/fcron/mailman.crontab" \ /etc/fcron/configure # Reloading cron configuration /etc/fcron/configure # Bootscript install -v -m740 ${SCRDIR}/bootscripts/mailman /etc/rc.d/init.d # script-name start stop 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 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 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 sed -i -e "s!_DOMAIN_!${DOMAIN}!g" ${MMPREFIX}/Mailman/mm_cfg.py exit $?