]> git.pld-linux.org Git - packages/sendmail.git/commitdiff
- adding/deleting smmsp user+group in pre/postun
authorJakub Bogusz <qboosh@pld-linux.org>
Tue, 25 Sep 2001 21:19:50 +0000 (21:19 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- simplified installing doc
- some updates in %%install and %%files (NFY)

Changed files:
    sendmail.spec -> 1.68

sendmail.spec

index c1cb3422bdd092dba15c2d5bdadcc70d8abd445d..5efb45338b6c0e34dc26253d4c923ced5760763a 100644 (file)
@@ -14,7 +14,6 @@ License:      BSD
 Group:         Networking/Daemons
 Group(de):     Netzwerkwesen/Server
 Group(pl):     Sieciowe/Serwery
-Provides:      smtpdaemon
 Source0:       ftp://ftp.sendmail.org/pub/sendmail/%{name}.%{version}.tar.gz
 Source1:       %{name}.init
 Source2:       http://www.informatik.uni-kiel.de/~ca/email/rules/check.tar
@@ -37,10 +36,16 @@ Patch9:             %{name}-hprescan-dos.patch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 BuildRequires: cyrus-sasl-devel
 BuildRequires: db3-devel
-%{!?_without_ldap:BuildRequires:       openldap-devel}
 BuildRequires: pam-devel
+%{!?_without_ldap:BuildRequires:       openldap-devel}
 Requires:      m4
-Prereq:                chkconfig
+Prereq:                /sbin/chkconfig
+Prereq:                /usr/sbin/groupadd
+Prereq:                /usr/sbin/useradd
+Prereq:                /usr/sbin/groupdel
+Prereq:                /usr/sbin/userdel
+Prereq:                /usr/bin/getgid
+Prereq:                /bin/id
 Provides:      smtpdaemon
 Obsoletes:     smtpdaemon
 Obsoletes:     exim
@@ -111,7 +116,6 @@ sed -e 's|@@PATH@@|\.\.|' < %{SOURCE6} > cf/cf/redhat.mc
 install %{SOURCE7} config.m4
 
 %build
-
 %if %{?debug:0}%{!?debug:1}
 echo "define(\`confLDOPTS\', \`-s\')" >> config.m4
 %endif
@@ -120,8 +124,7 @@ echo "APPENDDEF(\`confMAPDEF\', \`-DLDAPMAP\')" >> config.m4
 echo "APPENDDEF(\`confLIBS\', \`-lldap -llber\')" >> config.m4
 %endif
 
-RPM_OPT_FLAGS="%{rpmcflags} \
-       -DUSE_VENDOR_CF_PATH=1 -DNETINET6 -D_FFR_TESTMODE_DROP_PRIVS"
+RPM_OPT_FLAGS="%{rpmcflags} -DUSE_VENDOR_CF_PATH=1 -DNETINET6"
 export RPM_OPT_FLAGS
 
 cd sendmail    && sh Build -f ../config.m4
@@ -157,21 +160,20 @@ SMINSTOPT="DESTDIR=$RPM_BUILD_ROOT SBINOWN=$IDNU SBINGRP=$IDNG \
 ln -sf ../sbin/makemap $RPM_BUILD_ROOT%{_bindir}/makemap
 %{__make} $SMINSTOPT install -C $OBJDIR/smrsh
 
-# install docs by hand
-install -d $RPM_BUILD_ROOT%{_docdir}/sendmail
-cp -ar FAQ LICENSE KNOWNBUGS README RELEASE_NOTES doc $RPM_BUILD_ROOT%{_docdir}/sendmail
-cp -f smrsh/README $RPM_BUILD_ROOT%{_docdir}/sendmail/README.smrsh
-cp -f cf/README $RPM_BUILD_ROOT%{_docdir}/sendmail/README.cf
-
 # install the cf files
 cd cf
 rm -f cf/{Build,Makefile} feature/*~
 cp -ar * $RPM_BUILD_ROOT%{_libdir}/sendmail-cf
 cd -
 
+# sendmail.{cf,mc}
 install cf/cf/redhat.cf $RPM_BUILD_ROOT%{_sysconfdir}/sendmail.cf
 sed -e 's|@@PATH@@|%{_libdir}/sendmail-cf|' < %{SOURCE6} \
        > $RPM_BUILD_ROOT%{_sysconfdir}/sendmail.mc
+
+# submit.mc (submit.cf is installed automatically)
+install cf/cf/submit.mc $RPM_BUILD_ROOT%{_sysconfdir}
+
 echo "# local-host-names - include all aliases for your machine here." \
        > $RPM_BUILD_ROOT%{_sysconfdir}/local-host-names
 
@@ -209,13 +211,33 @@ install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/sendmail
 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/Makefile
 install %{SOURCE8} $RPM_BUILD_ROOT/etc/sasl/Sendmail.conf
 
-mv -f $RPM_BUILD_ROOT/usr/share/doc/sendmail/{FAQ,KNOWNBUGS,LICENSE,README,README.cf,doc/op/op.me} .
+mv -f smrsh/README README.smrsh
+mv -f cf/README README.cf
+mv -f doc/op/op.me .
 
-gzip -9nf FAQ KNOWNBUGS README README.cf op.me RELEASE_NOTES
+gzip -9nf FAQ KNOWNBUGS README* doc/op/op.me RELEASE_NOTES
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%pre
+if [ -n "`/usr/bin/getgid smmsp`" ]; then
+       if [ "`/usr/bin/getgid smmsp`" != "72" ]; then
+               echo "Warning: group smmsp haven't gid=72. Correct this before installing sendmail." 1>&2
+               exit 1
+       fi
+else
+       /usr/sbin/groupadd -g 72 -r -f smmsp
+fi
+if [ -n "`/bin/id -u smmsp 2>/dev/null`" ]; then
+       if [ "`/bin/id -u smmsp`" != "72" ]; then
+               echo "Warning: user smmsp haven't uid=72. Correct this before installing sendmail." 1>&2
+               exit 1
+       fi
+else
+       /usr/sbin/useradd -u 72 -r -d /var/spool/clientqueue -s /bin/false -c "Sendmail Message Submission Program" -g smmsp smmsp 1>&2
+fi
+
 %post
 #
 # Convert old format to new
@@ -224,14 +246,14 @@ if [ -f /etc/mail/deny ] ; then
        cat /etc/mail/deny | \
                awk 'BEGIN{ print "# Entries from obsoleted /etc/mail/deny"} \
                {print $1" REJECT"}' >> /etc/mail/access
-       cp /etc/mail/deny /etc/mail/deny.rpmorig
+       cp -f /etc/mail/deny /etc/mail/deny.rpmorig
 fi
 for oldfile in relay_allow ip_allow name_allow ; do
        if [ -f /etc/mail/$oldfile ] ; then
                cat /etc/mail/$oldfile | \
                        awk "BEGIN { print \"# Entries from obsoleted /etc/mail/$oldfile\" ;} \
                        { print $1\" RELAY\" }" >> /etc/mail/access
-               cp /etc/mail/$oldfile /etc/mail/$oldfile.rpmorig
+               cp -f /etc/mail/$oldfile /etc/mail/$oldfile.rpmorig
        fi
 done
 
@@ -242,7 +264,7 @@ if [ -f /etc/sendmail.cw ] ; then
        cat /etc/sendmail.cw  | \
                awk 'BEGIN { print "# Entries from obsoleted /etc/sendmail.cw" ;} \
                { print $1 }' >> /etc/mail/local-host-names
-       cp /etc/sendmail.cw /etc/sendmail.cw.rpmorig
+       cp -f /etc/sendmail.cw /etc/sendmail.cw.rpmorig
 fi
 #
 # Rebuild maps (next reboot will rebuild also)
@@ -271,6 +293,12 @@ if [ "$1" = "0" ]; then
        /sbin/chkconfig --del sendmail
 fi
 
+%postun
+if [ "$1" = "0" ]; then
+       /usr/sbin/userdel smmsp 2>/dev/null
+       /usr/sbin/groupdel smmsp 2>/dev/null
+fi
+
 # removal of compatibility links
 %triggerpostun -- sendmail < 8.10.1
 /sbin/chkconfig --add sendmail
@@ -285,7 +313,7 @@ fi
 %attr(755,root,root) %{_bindir}/rmail
 %attr(755,root,root) %{_bindir}/makemap
 %attr(755,root,root) %{_sbindir}/makemap
-%attr(6755,root,mail) %{_sbindir}/sendmail
+%attr(2755,root,smmsp) %{_sbindir}/sendmail
 %attr(755,root,root) %{_bindir}/newaliases
 %attr(755,root,root) %{_bindir}/mailq
 %attr(755,root,root) %{_sbindir}/smrsh
@@ -304,10 +332,13 @@ fi
 # XXX can't do noreplace here or new sendmail will not deliver.
 %config(noreplace) %{_sysconfdir}/sendmail.cf
 %config(noreplace) %{_sysconfdir}/sendmail.mc
+%config(noreplace) %{_sysconfdir}/submit.cf
+%config(noreplace) %{_sysconfdir}/submit.mc
 %config(noreplace) %{_sysconfdir}/local-host-names
 %config(noreplace) %{_sysconfdir}/aliases
 %attr(0644,root,mail) %ghost %{_sysconfdir}/aliases.db
 %attr(0770,root,mail) %dir /var/spool/mqueue
+%attr(0770,root,smmsp) %dir /var/spool/clientmqueue
 %dir /etc/smrsh
 %dir %{_sysconfdir}
 
This page took 0.066348 seconds and 4 git commands to generate.