# -*- fill-column: 75 -*- . ${BUILDFILE%/*}/common.sh pkgver=20180918 package() { preamble pkgdesc="Parabola server configuration: Make Mailman 2 play nice with configuration management" # #### mailman depends=(mailman) # The packager of the Mailman 2 package did a poor job, because they put # the main configuration file in /usr/lib/ instead of /etc/. They at least # put in a /etc/mailman/mm_cfg.py → /usr/lib/mailman/Mailman/mm_cfg.py # symlink so that at least you can find the file if you go looking around # in /etc/. # # However, that symlink it doesn't do anything for you if you'd like to be # able to back up your system configuration by backing up /etc/, or if you # track your system configuration by watching /etc/ (like with etckeeper), # or a number of other things that sysadmins like to do... # # The tidy solution would be to swap which path is the real file, and which # path is the symlink, but pacman would then discard our config when it # upgrades the mailman package. So instead, we need to make up a totally # new path for the real file... like `/etc/mailman/mm_cfg.real.py`. We # replace the file in /usr/ with a symlink to that. # # To make this all go smoothly, we do it with some slightly clever Holo # tricks. # When the default /usr/…/mm_cfg.py changes, save the new default version # as a .pacnew file in /etc add-file -m755 usr/share/holo/files/01-"$pkgname"/usr/lib/mailman/Mailman/mm_cfg.py <<-'EOF' #!/bin/sh tee etc/mailman/mm_cfg.real.py.pacnew EOF # then replace /usr/…/mm_cfg.py with a symlink to /etc/…/mm_cfg.real.py install -d usr/share/holo/files/02-"$pkgname"/usr/lib/mailman/Mailman ln -sT /etc/mailman/mm_cfg.real.py usr/share/holo/files/02-"$pkgname"/usr/lib/mailman/Mailman/mm_cfg.py # and initialize /etc/…/mm_cfg.real.py with the contents of the default # mm_cfg.py add-file etc/mailman/mm_cfg.real.py <<<'' add-file -m755 usr/share/holo/files/03-"$pkgname"/etc/mailman/mm_cfg.real.py.holoscript <<-'EOF' #!/bin/sh cat /usr/lib/mailman/Mailman/mm_cfg.py.dist EOF postamble }