Bug 61270

Summary: Sendmail spec file issues
Product: [Retired] Red Hat Raw Hide Reporter: Henri Schlereth <henris>
Component: sendmailAssignee: Florian La Roche <laroche>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: chrismcc, herrold, joerg
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-01-22 17:45:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Henri Schlereth 2002-03-15 19:51:33 UTC
Description of Problem:


A straight rebuild of the rpm generates sendmail.sendmail and the init scripts
fail looking for
sendmail.

The heuristic for > 6.2 <=7.1 fails on a 6.2 box with a boolean -1 (set to 6.0
or 6.1 and it
works perfectly)
Dispite mods  to remove the extra .sendmail in the spec file the compile fails
with a globbing
error still looking for sendmail.sendmail et al on 7.0 boxes (dont know why, all
the changes
work just fine on a 7.1 boxen)
However on the plus side the 7.1 rpm runs fine on the 7.0 boxes. Only catch is
that a 
server sendmail restart doesnt work, you actually have to do a stop/ start.


Version-Release number of selected component (if applicable):
8.12-2.7

How Reproducible:


Steps to Reproduce:
1. 
2. 
3. 

Actual Results:


Expected Results:


Additional Information:

Comment 1 Sammy 2002-03-15 20:59:46 UTC
I just experienced this! /usr/sbin/sendmail.sendmail......some other comments:

1. It would be nice if everything goes into /etc/mail including sendmail.cf
   file.

2. One should add similar comments on top of the submit.cf file that shows
   how it can be recompiled with m4.


Comment 2 Christopher McCrory 2002-03-18 18:00:20 UTC
for sendmail spec file:
install libsm.a as some milter programs need it to compile
if version check for prog.sendmail move

@@ -306,7 +283,9 @@
 install -m 755 -d $RPM_BUILD_ROOT%{_libdir}
 install -m 644  $OBJDIR/libmilter/libmilter.a $RPM_BUILD_ROOT%{_libdir}
 install -m 644  $OBJDIR/libsmutil/libsmutil.a $RPM_BUILD_ROOT%{_libdir}
+install -m 644  $OBJDIR/libsm/libsm.a         $RPM_BUILD_ROOT%{_libdir}
 
+%if %{errata} > 72
 mv $RPM_BUILD_ROOT%{_sbindir}/sendmail $RPM_BUILD_ROOT%{_sbindir}/sendmail.sendmail
 for i in mailq newaliases rmail; do
        mv $RPM_BUILD_ROOT%{_bindir}/$i $RPM_BUILD_ROOT%{_bindir}/$i.sendmail
@@ -314,6 +293,7 @@
 mv $RPM_BUILD_ROOT%{_mandir}/man1/mailq.1
$RPM_BUILD_ROOT%{_mandir}/man1/mailq.sendmail.1
 mv $RPM_BUILD_ROOT%{_mandir}/man1/newaliases.1
$RPM_BUILD_ROOT%{_mandir}/man1/newaliases.sendmail.1
 mv $RPM_BUILD_ROOT%{_mandir}/man5/aliases.5
$RPM_BUILD_ROOT%{_mandir}/man5/aliases.sendmail.5
+%endif
 
 mv $RPM_BUILD_ROOT%{_includedir}/*.h $RPM_BUILD_ROOT%{_includedir}/libmilter
 


@@ -423,24 +403,38 @@
 /usr/sbin/praliases
 /usr/bin/hoststat
 /usr/bin/purgestat
-/usr/bin/rmail.sendmail
 /usr/bin/makemap
+/usr/bin/vacation
 /usr/sbin/makemap
+%if %{errata} > 72
 %attr(2755,root,smmsp)/usr/sbin/sendmail.sendmail
+/usr/bin/rmail.sendmail
 /usr/bin/newaliases.sendmail
 /usr/bin/mailq.sendmail
+%else
+%attr(2755,root,smmsp)/usr/sbin/sendmail
+/usr/bin/rmail
+/usr/bin/newaliases
+/usr/bin/mailq
+%endif
 /usr/sbin/smrsh
 /usr/lib/sendmail

 %{_mandir}/man8/smrsh.8*
+%if %{errata} > 72
 %{_mandir}/man5/aliases.sendmail.5*
 %{_mandir}/man1/newaliases.sendmail.1*
 %{_mandir}/man1/mailq.sendmail.1*
+%else
+%{_mandir}/man5/aliases.5*
+%{_mandir}/man1/newaliases.1*
+%{_mandir}/man1/mailq.1*
+%endif
 
 %config(noreplace)             /etc/mail/statistics
 %config(noreplace)             /etc/sendmail.cf
@@ -489,6 +483,7 @@
 %{_includedir}/libmilter/*.h
 %{_libdir}/libmilter.a
 %{_libdir}/libsmutil.a
+%{_libdir}/libsm.a
 
 %files doc



Comment 3 Christopher McCrory 2002-03-18 18:02:05 UTC
db maps are ghosted, don;t bother making them

@@ -278,13 +257,11 @@
 EOF
 for map in virtusertable access domaintable mailertable
   do
-    touch $RPM_BUILD_ROOT/etc/mail/${map}
-    chmod 0644 $RPM_BUILD_ROOT/etc/mail/${map}
-    $RPM_BUILD_ROOT%{_bindir}/makemap -C $RPM_BUILD_ROOT/etc/sendmail.cf hash
$RPM_BUILD_ROOT/etc/mail/${map}.db < $RPM_BUILD_ROOT/etc/mail/${map}
-    chmod 0644 $RPM_BUILD_ROOT/etc/mail/${map}.db
+    touch $RPM_BUILD_ROOT/etc/mail/${map}{,.db}
+    chmod 0644 $RPM_BUILD_ROOT/etc/mail/${map}{,.db}
   done
 install -m644 %{SOURCE3} $RPM_BUILD_ROOT/etc/aliases
-$RPM_BUILD_ROOT/usr/bin/makemap -C $RPM_BUILD_ROOT/etc/sendmail.cf hash
$RPM_BUILD_ROOT/etc/aliases.db < %{SOURCE3}
+touch $RPM_BUILD_ROOT/etc/aliases.db
 
 install -m644 %SOURCE4 $RPM_BUILD_ROOT/etc/sysconfig/sendmail
 install -m755 %SOURCE1 $RPM_BUILD_ROOT%{initdir}/sendmail



Comment 4 Christopher McCrory 2002-03-18 18:07:20 UTC
ditch
APPENDDEF(`conf_sendmail_ENVDEF', `-D_FFR_MILTER=1')
in config.m4 as MILTER is now a stable

in the 8.12.2-7 spec the different config.m4 were a little screwy
IIHO, they should all be the same
- hesiod for <72

I havn't tried it but openssl is in 6.2 eratta so the SSL stuff might be OK




Comment 5 Christopher McCrory 2002-03-18 18:12:48 UTC
+pushd devtools/Site
<snip> 
 %patch0 -p1
<snip>
+mv redhat.config.m4 site.config.m4
+popd


A Devtools/Site/site.config.m4 will get used automagically

Possibly add it as a %doc entry


Sorry for the multiple submissions, but it made it easier for me to remember
what I had changed locally



Comment 6 Christopher McCrory 2002-03-18 18:15:14 UTC
And IMHO, yes all files in /etc/mail would be better than some in /etc and some
in /etc/mail



Comment 7 Florian La Roche 2002-03-20 16:54:30 UTC
http://people.redhat.com/laroche/sendmail-8.12.2-9.src.rpm

Let me know what is missing.

Thanks,

Florian La Roche


Comment 8 Christopher McCrory 2002-03-21 14:38:10 UTC
laroche:
I emailed you on a compile error I was getting.  It turns out I had a shared mem
segment in use ( ? ) that was causing the t-shm test to fail.  The only way I
could clear it was a reboot :(

[chrismcc@philippe libsm]$ ./t-shm 
2 of 2 tests completed successfully
4 of 4 tests completed successfully

works now.



Comment 9 Christopher McCrory 2002-03-27 15:53:22 UTC
for redhat.config.m4

-if test %{errata} -gt 72 ; then
 %patch0 -p1
-elif test %{errata} -gt 62 ; then
-%patch1 -p1
-else
-%patch2 -p1
+if test %{errata} -le 72 ; then
+# Don't use hesiod
+%{__perl} -pi -e "s#(-DHESIOD|-DHES_GETMAILHOST|-lhesiod)##" redhat.config.m4


This eliminates having to keep 3 different config files around



Comment 10 Christopher McCrory 2002-03-27 15:54:49 UTC
let aliases live in /etc/mail instead of /etc

-%patch5 -p1
+# leave aliases in /etc/mail
+# %patch5 -p1

Also requires redhat.mc `ALIASES" line removal



Comment 11 Christopher McCrory 2002-03-27 15:57:47 UTC
...
-pushd makemap
-sh Build -f ../redhat.config.m4
-popd
+for SUBDIR in libsm libsmutil libsmdb sendmail editmap mail.local \
+             mailstats makemap praliases rmail smrsh vacation \
+             libmilter
+do
+ pushd ${SUBDIR}
+  sh Build -f ../redhat.config.m4
+ popd
+done
+
...

+for SUBDIR in libsm libsmutil libsmdb sendmail editmap mail.local \
+             mailstats makemap praliases rmail smrsh vacation \
+             libmilter
+do
+  Make force-install -C $OBJDIR/${SUBDIR} || Make install -C $OBJDIR/${SUBDIR}
+done

+# /usr/sbin/mail.local
+/usr/bin/vacation
+/usr/sbin/editmap

+%{_mandir}/man8/editmap.8*
+# %{_mandir}/man8/mail.local.8*
+%{_mandir}/man1/vacation.1*



makes keeping track of the dirs easier.  They are also build in the same order
as the Makefile indicates  (if it matters)

mail.local installed but not packaged

vacation added




Comment 12 Christopher McCrory 2002-03-27 15:58:34 UTC
fix submit.mc

-install -m 644 cf/cf/submit.mc $RPM_BUILD_ROOT/etc/mail/submit.mc
+# add this so m4 submit.mc works
+echo "include(\`/usr/share/sendmail-cf/m4/cf.m4')" > \
+     $RPM_BUILD_ROOT/etc/mail/submit.mc
+cat  cf/cf/submit.mc >> \
+     $RPM_BUILD_ROOT/etc/mail/submit.mc



Comment 13 Christopher McCrory 2002-03-27 15:59:47 UTC
Add to /etc/mail/Makefile

%.cf: %.mc
        # make running via sudo easy
        @echo "running m4 ${@:.cf=}.mc > $@"
        @/usr/bin/m4 ${@:.cf=}.mc > $@



Comment 14 Christopher McCrory 2002-03-27 16:01:42 UTC
if errata is 62 this just breaks

%if %{errata} > 62
%if %{errata} <= 70
BuildRequires: cyrus-sasl
...




Comment 15 Sammy 2002-03-28 17:20:27 UTC
The problem with /usr/sbin/sendmail.sendmail exists upto and including
version 8.12.2-11....this is bad because the old sendmail binary is not
replaced and trying to restart it fails. I thought this was fixed in -10.


Comment 16 Christopher McCrory 2002-06-23 15:55:19 UTC
What I added to the init script to start the queue runner

start() {
        # Start daemons.

        if ! test -f /var/run/sm-client.pid ; then
        echo -n $"Starting sm-client: "
                touch /var/run/sm-client.pid
                chown smmsp:smmsp /var/run/sm-client.pid
        daemon /usr/sbin/sendmail -L sm-msp-queue -Ac \
                                  $([ -n "$QUEUE" ] && echo -q$QUEUE)
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sm-client
        fi



stop() {
        # Stop daemons.
        if test -f /var/run/sm-client.pid ; then
                echo -n $"Shutting down sm-client: "
                killproc sm-client
                RETVAL=$?
                echo
                [ $RETVAL -eq 0 ] && rm -f /var/run/sm-client.pid
                [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sm-client
        fi

Comment 17 Florian La Roche 2003-01-22 17:45:35 UTC
This should be all resolved in the newest rpm. Please open a new bugzilla
entry for further changes you want to have included.

Thanks a lot,

Florian La Roche