Drop old pre F-23 conditionals, minor spec cleanups
This commit is contained in:
parent
c985dea1a1
commit
e9098955cd
144
sendmail.init
144
sendmail.init
@ -1,144 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# sendmail This shell script takes care of starting and stopping
|
||||
# sendmail.
|
||||
#
|
||||
# chkconfig: 2345 80 30
|
||||
# description: Sendmail is a Mail Transport Agent, which is the program \
|
||||
# that moves mail from one machine to another.
|
||||
# processname: sendmail
|
||||
# config: /etc/mail/sendmail.cf
|
||||
# pidfile: /var/run/sendmail.pid
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: sendmail smtpdaemon $mail-transfer-agent
|
||||
# Required-Start: $local_fs $network
|
||||
# Required-Stop: $local_fs $network
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: start and stop sendmail
|
||||
# Description: sendmail is a Mail Transport Agent (MTA)
|
||||
### END INIT INFO
|
||||
|
||||
# Source function library.
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
# Source networking configuration.
|
||||
[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network
|
||||
|
||||
# Source sendmail configureation.
|
||||
if [ -f /etc/sysconfig/sendmail ]; then
|
||||
. /etc/sysconfig/sendmail
|
||||
else
|
||||
DAEMON=no
|
||||
QUEUE=1h
|
||||
fi
|
||||
[ -z "$SMQUEUE" ] && SMQUEUE="$QUEUE"
|
||||
[ -z "$SMQUEUE" ] && SMQUEUE=1h
|
||||
|
||||
# Check that we're a privileged user
|
||||
[ `id -u` = 0 ] || exit 4
|
||||
|
||||
# Check that networking is up.
|
||||
[ "${NETWORKING}" = "no" ] && exit 1
|
||||
|
||||
[ -x /usr/sbin/sendmail ] || exit 5
|
||||
|
||||
prog="sendmail"
|
||||
|
||||
updateconf() {
|
||||
/etc/mail/make > /dev/null 2>&1
|
||||
if [ $? -eq 15 ]; then
|
||||
echo -n $"Package sendmail-cf is required to update configuration."
|
||||
warning
|
||||
echo
|
||||
fi
|
||||
/etc/mail/make aliases > /dev/null 2>&1
|
||||
}
|
||||
|
||||
start() {
|
||||
# Start daemons.
|
||||
ret=0
|
||||
updateconf
|
||||
echo -n $"Starting $prog: "
|
||||
daemon /usr/sbin/sendmail $([ "x$DAEMON" = xyes ] && echo -bd) \
|
||||
$([ -n "$QUEUE" ] && echo -q$QUEUE) $SENDMAIL_OPTARG
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/sendmail
|
||||
let ret+=$RETVAL
|
||||
|
||||
if [ ! -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
|
||||
if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
|
||||
/sbin/restorecon /var/run/sm-client.pid
|
||||
fi
|
||||
daemon --check sm-client /usr/sbin/sendmail -L sm-msp-queue -Ac \
|
||||
-q$SMQUEUE $SENDMAIL_OPTARG
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/sm-client
|
||||
let ret+=$RETVAL
|
||||
fi
|
||||
|
||||
[ $ret -eq 0 ] && return 0 || return 1
|
||||
}
|
||||
|
||||
stop() {
|
||||
# Stop daemons.
|
||||
if [ -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
|
||||
echo -n $"Shutting down $prog: "
|
||||
killproc sendmail
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sendmail
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
status -p /var/run/sendmail.pid >/dev/null || status -p /var/run/sm-client.pid >/dev/null
|
||||
running=$?
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start)
|
||||
[ $running -eq 0 ] && exit 0
|
||||
start
|
||||
RETVAL=$?
|
||||
;;
|
||||
stop)
|
||||
[ $running -eq 0 ] || exit 0
|
||||
stop
|
||||
RETVAL=$?
|
||||
;;
|
||||
restart|force-reload)
|
||||
stop
|
||||
start
|
||||
RETVAL=$?
|
||||
;;
|
||||
condrestart|try-restart)
|
||||
[ $running -eq 0 ] || exit 0
|
||||
stop
|
||||
start
|
||||
RETVAL=$?
|
||||
;;
|
||||
status)
|
||||
echo -n sendmail; status -p /var/run/sendmail.pid -l sendmail
|
||||
RETVAL=$?
|
||||
echo -n sm-client; status -p /var/run/sm-client.pid -l sm-client
|
||||
[ $RETVAL -eq 0 ] && RETVAL=$?
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
|
||||
RETVAL=2
|
||||
esac
|
||||
|
||||
exit $RETVAL
|
@ -19,10 +19,10 @@
|
||||
Summary: A widely used Mail Transport Agent (MTA)
|
||||
Name: sendmail
|
||||
Version: 8.15.2
|
||||
Release: 31%{?dist}
|
||||
Release: 32%{?dist}
|
||||
License: Sendmail
|
||||
Group: System Environment/Daemons
|
||||
URL: http://www.sendmail.org/
|
||||
|
||||
Source0: ftp://ftp.sendmail.org/pub/sendmail/sendmail.%{version}.tar.gz
|
||||
# Systemd Service file
|
||||
Source1: sendmail.service
|
||||
@ -40,8 +40,6 @@ Source6: sendmail-redhat.mc
|
||||
Source7: sm-client.service
|
||||
# pam config
|
||||
Source8: sendmail.pam
|
||||
# SysV initscript
|
||||
Source9: sendmail.init
|
||||
# sasl2 config
|
||||
Source11: Sendmail-sasl2.conf
|
||||
# default /etc/mail/access
|
||||
@ -94,7 +92,7 @@ Patch28: sendmail-8.15.2-openssl-1.1.0-fix.patch
|
||||
Patch29: sendmail-8.15.2-format-security.patch
|
||||
# rhbz#1473971
|
||||
Patch30: sendmail-8.15.2-openssl-1.1.0-ecdhe-fix.patch
|
||||
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
BuildRequires: libdb-devel
|
||||
BuildRequires: libnsl2-devel
|
||||
BuildRequires: hesiod-devel
|
||||
@ -104,13 +102,10 @@ BuildRequires: m4
|
||||
BuildRequires: systemd
|
||||
BuildRequires: gcc
|
||||
Provides: MTA smtpdaemon server(smtp)
|
||||
Requires(post): systemd systemd-sysv coreutils %{_sbindir}/alternatives %{_bindir}/openssl
|
||||
Requires(post): systemd coreutils %{_sbindir}/alternatives %{_bindir}/openssl
|
||||
Requires(preun): systemd %{_sbindir}/alternatives
|
||||
Requires(postun): systemd coreutils %{_sbindir}/alternatives
|
||||
Requires(pre): shadow-utils
|
||||
%if 0%{?fedora} < 23
|
||||
Requires: initscripts
|
||||
%endif
|
||||
Requires: procmail
|
||||
Requires: bash >= 2.0
|
||||
Requires: setup >= 2.5.31-1
|
||||
@ -138,22 +133,8 @@ If you ever need to reconfigure Sendmail, you will also need to have
|
||||
the sendmail-cf package installed. If you need documentation on
|
||||
Sendmail, you can install the sendmail-doc package.
|
||||
|
||||
%if 0%{?fedora} < 23
|
||||
%package sysvinit
|
||||
Summary: SysV initscript for sendmail
|
||||
Group: System Environment/Daemons
|
||||
BuildArch: noarch
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires(preun): chkconfig
|
||||
Requires(post): chkconfig
|
||||
|
||||
%description sysvinit
|
||||
This package contains the SysV initscript.
|
||||
%endif
|
||||
|
||||
%package doc
|
||||
Summary: Documentation about the Sendmail Mail Transport Agent program
|
||||
Group: Documentation
|
||||
BuildArch: noarch
|
||||
Requires: sendmail = %{version}-%{release}
|
||||
|
||||
@ -164,7 +145,6 @@ contributed scripts and tools for use with Sendmail.
|
||||
|
||||
%package milter-devel
|
||||
Summary: Development files for the sendmail milter library
|
||||
Group: Development/Libraries
|
||||
Requires: sendmail-milter%{?_isa} = %{version}-%{release}
|
||||
# The following Provides: and Obsoletes: can be dropped in f28+
|
||||
Provides: sendmail-devel%{?_isa} = %{version}-%{release}
|
||||
@ -176,7 +156,6 @@ Include files and devel libraries for the milter add-ons as part of sendmail.
|
||||
|
||||
%package cf
|
||||
Summary: The files needed to reconfigure Sendmail
|
||||
Group: System Environment/Daemons
|
||||
Requires: sendmail = %{version}-%{release}
|
||||
BuildArch: noarch
|
||||
Requires: m4
|
||||
@ -189,7 +168,6 @@ your sendmail.cf file.
|
||||
|
||||
%package milter
|
||||
Summary: The sendmail milter library
|
||||
Group: System Environment/Libraries
|
||||
|
||||
%description milter
|
||||
The sendmail Mail Filter API (Milter) is designed to allow third-party
|
||||
@ -316,8 +294,6 @@ done
|
||||
make -C doc/op op.pdf
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
|
||||
# create directories
|
||||
for d in %{_bindir} %{_sbindir} %{_includedir}/libmilter \
|
||||
%{_libdir} %{_mandir}/man{1,5,8} %{maildir} %{stdir} %{spooldir} \
|
||||
@ -437,9 +413,6 @@ touch %{buildroot}%{maildir}/aliasesdb-stamp
|
||||
touch %{buildroot}%{spooldir}/clientmqueue/sm-client.st
|
||||
|
||||
install -p -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/sysconfig/sendmail
|
||||
%if 0%{?fedora} < 23
|
||||
install -p -m 755 %{SOURCE9} %{buildroot}%{_initrddir}/sendmail
|
||||
%endif
|
||||
install -p -m 755 %{SOURCE2} %{buildroot}%{_sysconfdir}/NetworkManager/dispatcher.d/10-sendmail
|
||||
install -p -m 755 %{SOURCE3} %{buildroot}%{maildir}/make
|
||||
install -p -m 644 %{SOURCE5} %{buildroot}%{maildir}/Makefile
|
||||
@ -603,19 +576,6 @@ exit 0
|
||||
|
||||
%postun milter -p /sbin/ldconfig
|
||||
|
||||
%if 0%{?fedora} < 23
|
||||
%post sysvinit
|
||||
/sbin/chkconfig --add sendmail >/dev/null 2>&1 ||:
|
||||
|
||||
%preun sysvinit
|
||||
if [ "$1" = 0 ]; then
|
||||
%{_initrddir}/sendmail stop >/dev/null 2>&1 ||:
|
||||
/sbin/chkconfig --del sendmail >/dev/null 2>&1 ||:
|
||||
fi
|
||||
|
||||
%postun sysvinit
|
||||
[ "$1" -ge "1" ] && %{_initrddir}/sendmail condrestart >/dev/null 2>&1 ||:
|
||||
%endif
|
||||
|
||||
%files
|
||||
%dir %{_docdir}/sendmail
|
||||
@ -743,12 +703,11 @@ fi
|
||||
%dir %{_docdir}/sendmail/contrib
|
||||
%attr(0644,root,root) %{_docdir}/sendmail/contrib/*
|
||||
|
||||
%if 0%{?fedora} < 23
|
||||
%files sysvinit
|
||||
%{_initrddir}/sendmail
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Tue Oct 16 2018 Peter Robinson <pbrobinson@fedoraproject.org> 8.15.2-32
|
||||
- Drop old pre F-23 conditionals, minor spec cleanups
|
||||
|
||||
* Wed Aug 29 2018 Jaroslav Škarvada <jskarvad@redhat.com> - 8.15.2-31
|
||||
- Added support for sendmail service reload
|
||||
Resolves: rhbz#1618552
|
||||
|
Loading…
Reference in New Issue
Block a user