summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-09-18 19:05:52 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2018-09-18 19:08:56 -0400
commit11e955270830a584d39f4c6a2beea166491f0b3e (patch)
tree27c9ad2b9aff00cde7d2d749657ebb5976d6a0e6
parentcacd0616e9794eb1062e1122a97f28e690a8e1c6 (diff)
Add config-parabola-base-mailman
-rw-r--r--config-parabola-base-mailman.PKGBUILD51
1 files changed, 51 insertions, 0 deletions
diff --git a/config-parabola-base-mailman.PKGBUILD b/config-parabola-base-mailman.PKGBUILD
new file mode 100644
index 0000000..84472a0
--- /dev/null
+++ b/config-parabola-base-mailman.PKGBUILD
@@ -0,0 +1,51 @@
+# -*- 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
+}