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 Patch0: chroot-path.patch
20 Patch1: makemap-paths.patch
21 URL: http://www.opensmtpd.org/
22 BuildRequires: autoconf
23 BuildRequires: automake
25 BuildRequires: db-devel
26 BuildRequires: libevent-devel
27 BuildRequires: openssl-devel
28 %{?with_pam:BuildRequires: pam-devel}
29 BuildRequires: rpmbuild(macros) >= 1.228
30 BuildRequires: zlib-devel
31 Requires(post,preun): /sbin/chkconfig
32 Requires(postun): /usr/sbin/groupdel
33 Requires(postun): /usr/sbin/userdel
34 Requires(pre): /bin/id
35 Requires(pre): /usr/bin/getgid
36 Requires(pre): /usr/sbin/groupadd
37 Requires(pre): /usr/sbin/useradd
39 Provides: group(smtpd)
40 Provides: group(smtpq)
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 %define _privsepdir /usr/share/empty
50 OpenSMTPD is a FREE implementation of the server-side SMTP protocol as
51 defined by RFC 5321, with some additional standard extensions. It
52 allows ordinary machines to exchange e-mails with other systems
53 speaking the SMTP protocol.
55 Started out of dissatisfaction with other implementations, OpenSMTPD
56 nowadays is a fairly complete SMTP implementation. OpenSMTPD is
57 primarily developed by Gilles Chehade, Eric Faurot and Charles
58 Longeau; with contributions from various OpenBSD hackers. OpenSMTPD is
59 part of the OpenBSD Project. The software is freely usable and
60 re-usable by everyone under an ISC license.
63 %setup -q %{?prerelease: -n %{name}-%{prerelease}p1}
73 --sysconfdir=%{_sysconfdir}/mail \
74 --libexecdir=%{_libdir}/%{name} \
76 %{?with_pam:--with-pam} \
77 --with-privsep-user=smtpd \
78 --with-queue-user=smtpq \
79 --with-privsep-path=%{_privsepdir} \
80 --with-sock-dir=%{_localstatedir}/run
85 rm -rf $RPM_BUILD_ROOT
87 DESTDIR=$RPM_BUILD_ROOT
89 install -d $RPM_BUILD_ROOT{%{systemdunitdir},/etc/{rc.d/init.d,pam.d}}
90 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/opensmtpd.service
91 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/opensmtpd
92 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/mail
94 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/smtp
96 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases.db
98 # /usr/sbin/sendmail compatibility is not required /usr/lib/sendmail is
99 install -d $RPM_BUILD_ROOT%{_prefix}/lib
100 mv $RPM_BUILD_ROOT{%{_bindir},%{_prefix}/lib}/sendmail
103 rm -rf $RPM_BUILD_ROOT
106 %groupadd -g 297 smtpd
107 %groupadd -g 298 smtpq
108 %useradd -u 297 -g smtpd -s /sbin/nologin -c "OpenSMTPd privsep user" -d %{_privsepdir} smtpd
109 %useradd -u 298 -g smtpq -s /sbin/nologin -c "OpenSMTPd queue user" -d %{_privsepdir} smtpq
112 /sbin/chkconfig --add %{name}
113 %service %{name} restart
114 %systemd_post %{name}.service
118 %service %{name} stop
119 /sbin/chkconfig --del %{name}
121 %systemd_preun %{name}.service
124 if [ "$1" = "0" ]; then
133 %defattr(644,root,root,755)
134 %doc LICENSE README.md THANKS
135 %dir %{_sysconfdir}/mail
136 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/smtpd.conf
137 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/aliases
138 %ghost %{_sysconfdir}/mail/aliases.db
140 %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/smtp
142 %attr(754,root,root) /etc/rc.d/init.d/opensmtpd
143 %{systemdunitdir}/%{name}.service
144 %attr(755,root,root) %{_sbindir}/mailq
145 %attr(755,root,root) %{_sbindir}/makemap
146 %attr(755,root,root) %{_sbindir}/newaliases
147 %attr(755,root,root) %{_sbindir}/smtpctl
148 %attr(755,root,root) %{_sbindir}/smtpd
149 %attr(755,root,root) %{_prefix}/lib/sendmail
150 %{_mandir}/man5/aliases.5*
151 %{_mandir}/man5/forward.5*
152 %{_mandir}/man5/smtpd.conf.5*
153 %{_mandir}/man5/table.5*
154 %{_mandir}/man8/makemap.8*
155 %{_mandir}/man8/newaliases.8*
156 %{_mandir}/man8/sendmail.8*
157 %{_mandir}/man8/smtpctl.8*
158 %{_mandir}/man8/smtpd.8*
159 %dir %{_libdir}/%{name}
160 %dir %{_libdir}/%{name}/opensmtpd
161 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/encrypt
162 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/filter-dnsbl
163 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/filter-monkey
164 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/filter-stub
165 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/filter-trace
166 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/mail.local
167 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/queue-null
168 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/queue-ram
169 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/queue-stub
170 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/scheduler-ram
171 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/scheduler-stub
172 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/table-passwd
173 %attr(755,root,root) %{_libdir}/%{name}/opensmtpd/table-stub