From 12f4d8c6a38eb3cf8916009c56718a4df2d6fa24 Mon Sep 17 00:00:00 2001 From: rhatto Date: Sun, 23 Dec 2007 21:46:47 +0000 Subject: maildrop: using vmail user/group and forcing its id to 5000 git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@1565 370017ae-e619-0410-ac65-c121f96126d4 --- mail/filter/maildrop/maildrop.SlackBuild | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'mail') diff --git a/mail/filter/maildrop/maildrop.SlackBuild b/mail/filter/maildrop/maildrop.SlackBuild index 8e0808b5..5cd05857 100755 --- a/mail/filter/maildrop/maildrop.SlackBuild +++ b/mail/filter/maildrop/maildrop.SlackBuild @@ -40,7 +40,7 @@ PKG=${PKG:=$TMP/package-$PKG_NAME} REPOS=${REPOS:=$TMP} PREFIX=${PREFIX:=/usr} PKG_WORK="$TMP/$SRC_NAME" -CONF_OPTIONS=${CONF_OPTIONS:="--enable-maildrop-uid=mail --enable-maildrop-gid=mail"} +CONF_OPTIONS=${CONF_OPTIONS:="--enable-maildrop-uid=vmail --enable-maildrop-gid=vmail"} NUMJOBS=${NUMJOBS:=""} # Set system libraries' path and optmization flags based on $ARCH @@ -89,6 +89,10 @@ tar --no-same-owner --no-same-permissions -xvf "$SRC_DIR/$SRC" || exit $ERROR_TA PKG_SRC=`ls -l | awk '/^d/ { print $8 }'` cd "$PKG_SRC" +echo Creating user and group vmail, if they does not exist... +groupadd vmail -g 5000 +useradd vmail -u 5000 -g 5000 + # Configure CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ @@ -142,6 +146,25 @@ maildrop: maildrop: EODESC +# Add a post-installation script (doinst.sh) +cat << EOSCRIPT > "$PKG/install/doinst.sh" +config() { + NEW="\$1" + OLD="\$(dirname \$NEW)/\$(basename \$NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r \$OLD ]; then + mv \$NEW \$OLD + elif [ "\$(cat \$OLD | md5sum)" = "\$(cat \$NEW | md5sum)" ]; then + # toss the redundant copy + rm \$NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config path/to/config_file.new +echo Trying to create user/group vmail with UID/GID 5000... ; groupadd vmail -g 5000 ; useradd vmail -u 5000 -g 5000 +EOSCRIPT + # Build the package cd "$PKG" makepkg -l y -c n "$REPOS/$PKG_NAME-$PKG_VERSION-$ARCH-$BUILD.tgz" || exit $ERROR_MKPKG -- cgit v1.2.3