* Thu Jan 16 2025 Jean-Philippe Pialasse <jpp@koozali.org> 1.03-28.sme

- fix missing mini-qmail pre and post scriptlet [SME: 12872]
This commit is contained in:
Jean-Philippe Pialasse 2025-01-16 21:50:19 -05:00
parent 3e95e7c828
commit 4a8240bbd6

View File

@ -410,76 +410,12 @@ user_check qmailq $qmailq $qmail /var/qmail /bin/false
user_check qmailr $qmailr $qmail /var/qmail /bin/false user_check qmailr $qmailr $qmail /var/qmail /bin/false
user_check qmails $qmails $qmail /var/qmail /bin/false user_check qmails $qmails $qmail /var/qmail /bin/false
%pre -n mini-qmail
# Prior to installing the package, ensure that the qmail users and groups
# exist and have the correct uid and gid information. This ensures that
# uid and gid values match the values which are compiled into the binaries
# GIDs
nofiles=400
qmail=401
# UIDs
alias=400
qmaild=401
qmaill=402
qmailp=403
qmailq=404
qmailr=405
qmails=406
group_check()
{
if grep "^$1:" /etc/group > /dev/null 2>&1
then
if [ $(grep "^$1:" /etc/group | /usr/bin/cut -d: -f3) != $2 ]
then
/usr/sbin/groupdel $1
/usr/sbin/groupadd -g $2 $1
fi
else
/usr/sbin/groupadd -g $2 $1
fi
}
group_check nofiles $nofiles
group_check qmail $qmail
user_check()
{
if grep "^$1:" /etc/passwd > /dev/null 2>&1
then
if [ $(grep "^$1:" /etc/passwd | /usr/bin/cut -d: -f3,4) != "$2:$3" ]
then
/usr/sbin/userdel $1
/usr/sbin/useradd -u $2 -M -g $3 -d $4 -s $5 $1
fi
else
/usr/sbin/useradd -u $2 -M -g $3 -d $4 -s $5 $1
fi
}
user_check alias $alias $nofiles /var/qmail/alias /bin/false
user_check qmaild $qmaild $nofiles /var/qmail /bin/false
user_check qmaill $qmaill $nofiles /var/qmail /bin/false
user_check qmailp $qmailp $nofiles /var/qmail /bin/false
user_check qmailq $qmailq $qmail /var/qmail /bin/false
user_check qmailr $qmailr $qmail /var/qmail /bin/false
user_check qmails $qmails $qmail /var/qmail /bin/false
%post %post
dd bs=1024 count=1 if=/dev/zero of=/var/qmail/queue/lock/tcpto &> /dev/null dd bs=1024 count=1 if=/dev/zero of=/var/qmail/queue/lock/tcpto &> /dev/null
chown qmailr:qmail /var/qmail/queue/lock/tcpto &> /dev/null chown qmailr:qmail /var/qmail/queue/lock/tcpto &> /dev/null
chmod 644 /var/qmail/queue/lock/tcpto &> /dev/null chmod 644 /var/qmail/queue/lock/tcpto &> /dev/null
exit 0 exit 0
%post -n mini-qmail
dd bs=1024 count=1 if=/dev/zero of=/var/qmail/queue/lock/tcpto &> /dev/null
chown qmailr:qmail /var/qmail/queue/lock/tcpto &> /dev/null
chmod 644 /var/qmail/queue/lock/tcpto &> /dev/null
exit 0
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
@ -801,6 +737,70 @@ URL: http://cr.yp.to/qmail/mini.html
%description -n mini-qmail %description -n mini-qmail
A mini-qmail installation doesn't have a mail queue. Instead it gives each new message to a central server through QMQP A mini-qmail installation doesn't have a mail queue. Instead it gives each new message to a central server through QMQP
%pre -n mini-qmail
# Prior to installing the package, ensure that the qmail users and groups
# exist and have the correct uid and gid information. This ensures that
# uid and gid values match the values which are compiled into the binaries
# GIDs
nofiles=400
qmail=401
# UIDs
alias=400
qmaild=401
qmaill=402
qmailp=403
qmailq=404
qmailr=405
qmails=406
group_check()
{
if grep "^$1:" /etc/group > /dev/null 2>&1
then
if [ $(grep "^$1:" /etc/group | /usr/bin/cut -d: -f3) != $2 ]
then
/usr/sbin/groupdel $1
/usr/sbin/groupadd -g $2 $1
fi
else
/usr/sbin/groupadd -g $2 $1
fi
}
group_check nofiles $nofiles
group_check qmail $qmail
user_check()
{
if grep "^$1:" /etc/passwd > /dev/null 2>&1
then
if [ $(grep "^$1:" /etc/passwd | /usr/bin/cut -d: -f3,4) != "$2:$3" ]
then
/usr/sbin/userdel $1
/usr/sbin/useradd -u $2 -M -g $3 -d $4 -s $5 $1
fi
else
/usr/sbin/useradd -u $2 -M -g $3 -d $4 -s $5 $1
fi
}
user_check alias $alias $nofiles /var/qmail/alias /bin/false
user_check qmaild $qmaild $nofiles /var/qmail /bin/false
user_check qmaill $qmaill $nofiles /var/qmail /bin/false
user_check qmailp $qmailp $nofiles /var/qmail /bin/false
user_check qmailq $qmailq $qmail /var/qmail /bin/false
user_check qmailr $qmailr $qmail /var/qmail /bin/false
user_check qmails $qmails $qmail /var/qmail /bin/false
%post -n mini-qmail
dd bs=1024 count=1 if=/dev/zero of=/var/qmail/queue/lock/tcpto &> /dev/null
chown qmailr:qmail /var/qmail/queue/lock/tcpto &> /dev/null
chmod 644 /var/qmail/queue/lock/tcpto &> /dev/null
exit 0
%files -n mini-qmail %files -n mini-qmail
%attr(755,root,qmail) %dir /var/qmail %attr(755,root,qmail) %dir /var/qmail
#%attr(2755,alias,qmail) %dir /var/qmail/alias #%attr(2755,alias,qmail) %dir /var/qmail/alias