2 # - should mailq and newalises be in bindir?
5 %bcond_without pam # build without PAM support
7 Summary: Free implementation of the server-side SMTP protocol as defined by RFC 5321
13 Source0: https://www.opensmtpd.org/archives/%{name}-%{version}.tar.gz
14 # Source0-md5: c76b39a5fcc0ad05eea541e74b16e62a
15 Source1: %{name}.service
19 URL: http://www.opensmtpd.org/
20 BuildRequires: autoconf
21 BuildRequires: automake
23 BuildRequires: db-devel
24 BuildRequires: libevent-devel
25 BuildRequires: openssl-devel
26 %{?with_pam:BuildRequires: pam-devel}
27 BuildRequires: rpmbuild(macros) >= 1.228
28 BuildRequires: zlib-devel
29 Requires(post,preun): /sbin/chkconfig
30 Requires(postun): /usr/sbin/groupdel
31 Requires(postun): /usr/sbin/userdel
32 Requires(pre): /bin/id
33 Requires(pre): /usr/bin/getgid
34 Requires(pre): /usr/sbin/groupadd
35 Requires(pre): /usr/sbin/useradd
37 Provides: group(smtpd)
38 Provides: group(smtpq)
43 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
45 %define _privsepdir /usr/share/empty
48 OpenSMTPD is a FREE implementation of the server-side SMTP protocol as
49 defined by RFC 5321, with some additional standard extensions. It
50 allows ordinary machines to exchange e-mails with other systems
51 speaking the SMTP protocol.
53 Started out of dissatisfaction with other implementations, OpenSMTPD
54 nowadays is a fairly complete SMTP implementation. OpenSMTPD is
55 primarily developed by Gilles Chehade, Eric Faurot and Charles
56 Longeau; with contributions from various OpenBSD hackers. OpenSMTPD is
57 part of the OpenBSD Project. The software is freely usable and
58 re-usable by everyone under an ISC license.
69 --sysconfdir=%{_sysconfdir}/mail \
70 --libexecdir=%{_libdir}/%{name} \
72 %{?with_pam:--with-pam} \
73 --with-privsep-user=smtpd \
74 --with-queue-user=smtpq \
75 --with-privsep-path=%{_privsepdir} \
76 --with-sock-dir=%{_localstatedir}/run
81 rm -rf $RPM_BUILD_ROOT
83 DESTDIR=$RPM_BUILD_ROOT
85 install -d $RPM_BUILD_ROOT{%{systemdunitdir},/etc/{rc.d/init.d,pam.d}}
86 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/opensmtpd.service
87 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/opensmtpd
88 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/mail
90 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/smtp
92 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases.db
94 # /usr/sbin/sendmail compatibility is not required /usr/lib/sendmail is
95 install -d $RPM_BUILD_ROOT%{_prefix}/lib
96 mv $RPM_BUILD_ROOT{%{_bindir},%{_prefix}/lib}/sendmail
99 rm -rf $RPM_BUILD_ROOT
102 %groupadd -g 297 smtpd
103 %groupadd -g 298 smtpq
104 %useradd -u 297 -g smtpd -s /sbin/nologin -c "OpenSMTPd privsep user" -d %{_privsepdir} smtpd
105 %useradd -u 298 -g smtpq -s /sbin/nologin -c "OpenSMTPd queue user" -d %{_privsepdir} smtpq
108 /sbin/chkconfig --add %{name}
109 %service %{name} restart
110 %systemd_post %{name}.service
114 %service %{name} stop
115 /sbin/chkconfig --del %{name}
117 %systemd_preun %{name}.service
120 if [ "$1" = "0" ]; then
129 %defattr(644,root,root,755)
130 %doc LICENSE README.md THANKS
131 %dir %{_sysconfdir}/mail
132 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/smtpd.conf
133 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/aliases
134 %ghost %{_sysconfdir}/mail/aliases.db
136 %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/smtp
138 %attr(754,root,root) /etc/rc.d/init.d/opensmtpd
139 %{systemdunitdir}/%{name}.service
140 %attr(755,root,root) %{_sbindir}/mailq
141 %attr(755,root,root) %{_sbindir}/makemap
142 %attr(755,root,root) %{_sbindir}/newaliases
143 %attr(755,root,root) %{_sbindir}/smtpctl
144 %attr(755,root,root) %{_sbindir}/smtpd
145 %attr(755,root,root) %{_prefix}/lib/sendmail
146 %{_mandir}/man5/aliases.5*
147 %{_mandir}/man5/forward.5*
148 %{_mandir}/man5/smtpd.conf.5*
149 %{_mandir}/man5/table.5*
150 %{_mandir}/man8/makemap.8*
151 %{_mandir}/man8/newaliases.8*
152 %{_mandir}/man8/sendmail.8*
153 %{_mandir}/man8/smtpctl.8*
154 %{_mandir}/man8/smtpd.8*
155 %dir %{_libdir}/%{name}
156 %dir %{_libdir}/%{name}/opensmtpd
157 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/encrypt
158 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/filter-dnsbl
159 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/filter-monkey
160 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/filter-stub
161 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/filter-trace
162 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/mail.local
163 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/queue-null
164 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/queue-ram
165 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/queue-stub
166 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/scheduler-ram
167 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/scheduler-stub
168 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/table-passwd
169 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/table-stub