1 # Thanks to doze_worm <shuimao@gmail.com> for the original port.
6 pkgdesc="The sendmail MTA"
9 provides=('sendmail=8.14')
11 backup=(etc/mail/aliases etc/mail/sendmail.cf)
12 source=("ftp://ftp.sendmail.org/pub/sendmail/${pkgname}.${pkgver}.tar.gz"
14 url="http://www.sendmail.org"
16 md5sums=('02ccfc331cc81ed00ec8bb5ecfc69018'
17 '506eeef3f427e2fd3e028a91de9943bd')
18 sha256sums=('fb65a86a0f87f12aefb933ee8990540f7a680a594f7fedfdd28918f3934bfb88'
19 'dcffe77814c2ea7b6349720505c2a788a79358889560398709bec29769042f8e')
21 install="${pkgname}.install"
24 addgroup="/usr/sbin/groupadd -g 25 smmsp"
25 adduser="/usr/sbin/useradd -c 'sendmail' -u 150 -g smmsp -d /var/spool/mail -s /bin/false smmsp"
28 getent passwd smmsp >/dev/null || need_user=yes
29 getent group smmsp >/dev/null || need_group=yes
30 case "$need_user,$need_group" in
35 echo "Must create user smmsp"
39 echo "Must create group smmsp"
43 echo "Must create user and group smmsp"
44 cmd="$addgroup && $adduser"
47 if [[ $(id -u) == 0 ]]; then
51 echo Executing sudo "$cmd"
52 /usr/bin/sudo sh -c "$cmd" || return 1
58 cd "$srcdir/${pkgname}-${pkgver}" || return 1
60 GROFF_NO_SGR=1 make -C doc/op op.txt op.ps
64 mkdir -p $pkgdir/etc/rc.d
65 cp sendmail.rc $pkgdir/etc/rc.d/sendmail
66 cd "$srcdir/${pkgname}-${pkgver}" || return 1
67 mkdir -p $pkgdir/usr/{bin,sbin,share/man,share/doc/sendmail} \
68 $pkgdir/usr/man/man{1,5,8} $pkgdir/var/spool/mqueue \
70 make install DESTDIR="$pkgdir" || return 1
71 make -C mail.local force-install DESTDIR="$pkgdir" || return 1
72 make -C rmail force-install DESTDIR="$pkgdir" || return 1
73 mv $pkgdir/usr/man/* $pkgdir/usr/share/man/
75 cp -r cf $pkgdir/usr/share/sendmail-cf
76 cp sendmail/aliases $pkgdir/etc/mail/aliases
77 cp cf/cf/generic-linux.cf $pkgdir/etc/mail/sendmail.cf
78 cp doc/op/op.{ps,txt} $pkgdir/usr/share/doc/sendmail/
79 find $pkgdir -user bin -print | xargs chown root
80 find $pkgdir -group bin -print | xargs chgrp root