updated on Wed Jan 25 20:08:56 UTC 2012
[aur-mirror.git] / mailman-pgp-smime / mailman.install
blob7ce4c2da26da64c64bbc94a6b86ffc6f87317ad6
1 ## arg 1:  the new package version
2 post_install() {
3   # Make sure the group and user "mailman" exists on this system and has the correct values
4   if grep -q "^mailman:" /etc/group &> /dev/null ; then
5     groupmod -g 80 -n mailman mailman &> /dev/null
6   else
7     groupadd -g 80 mailman &> /dev/null
8   fi
9   
10   if grep -q "^mailman:" /etc/passwd 2> /dev/null ; then
11     usermod -s /sbin/nologin -c "GNU Mailing List Manager" -d /usr/lib/mailman -u 80 -g mailman mailman &> /dev/null
12   else
13     useradd -s /sbin/nologin -c "GNU Mailing List Manager" -d /usr/lib/mailman -u 80 -g mailman -M -r mailman &> /dev/null
14   fi 
16   # check file permissions
17 #  cd /usr/lib/mailman && bin/check_perms -f  > /dev/null 2>&1     # -f applies fixes we should solve in the PKGBUILD
18   cd /usr/lib/mailman && bin/check_perms > /dev/null
20   echo ">>> Use '/usr/lib/mailman/bin/update -f' to convert lists created with unpatched mailman versions to the PGP/SMIME enabled format."
21   echo
22   echo "Having a backup of the list configurations is very recommended."
25 ## arg 1:  the new package version
26 ## arg 2:  the old package version
27 post_upgrade() {
28   post_install $1
31 ## arg 1:  the old package version
32 pre_remove() {
33   userdel mailman &>/dev/null
34   groupdel mailman &>/dev/null || /bin/true