3 # - should mailq and newalises be in bindir?
6 %bcond_without pam # build without PAM support
9 %define prerelease 201310231634
10 Summary: Free implementation of the server-side SMTP protocol as defined by RFC 5321
13 Release: 0.%{prerelease}.%{rel}
16 #Source0: http://www.opensmtpd.org/archives/%{name}-%{version}.tar.gz
17 Source0: http://www.opensmtpd.org/archives/%{name}-%{prerelease}p1.tar.gz
18 # Source0-md5: d4c28a45527356fbec19853220e3688d
19 Source1: %{name}.service
22 URL: http://www.opensmtpd.org/
23 BuildRequires: automake
25 BuildRequires: db-devel
26 BuildRequires: libevent-devel
27 BuildRequires: libtool
28 BuildRequires: openssl-devel
29 %{?with_pam:BuildRequires: pam-devel}
30 BuildRequires: rpmbuild(macros) >= 1.228
31 Requires(post,preun): /sbin/chkconfig
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 %define _privsepdir /usr/share/empty
40 OpenSMTPD is a FREE implementation of the server-side SMTP protocol as
41 defined by RFC 5321, with some additional standard extensions. It
42 allows ordinary machines to exchange e-mails with other systems
43 speaking the SMTP protocol.
45 Started out of dissatisfaction with other implementations, OpenSMTPD
46 nowadays is a fairly complete SMTP implementation. OpenSMTPD is
47 primarily developed by Gilles Chehade, Eric Faurot and Charles
48 Longeau; with contributions from various OpenBSD hackers. OpenSMTPD is
49 part of the OpenBSD Project. The software is freely usable and
50 re-usable by everyone under an ISC license.
53 %setup -q %{?prerelease: -n %{name}-%{prerelease}p1}
57 CFLAGS="$CFLAGS -I%{_includedir}/libdb4"
58 LDFLAGS="$LDFLAGS -L%{_libdir}/libdb4"
61 --sysconfdir=%{_sysconfdir}/mail \
62 --libexecdir=%{_libdir}/%{name} \
64 %{?with_pam:--with-pam} \
65 --with-privsep-user=smtpd \
66 --with-queue-user=smtpq \
67 --with-privsep-path=%{_privsepdir} \
68 --with-sock-dir=%{_localstatedir}/run
73 rm -rf $RPM_BUILD_ROOT
75 DESTDIR=$RPM_BUILD_ROOT
77 install -d $RPM_BUILD_ROOT{%{systemdunitdir},/etc/{rc.d/init.d,pam.d}}
78 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/opensmtpd.service
79 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/opensmtpd
81 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/smtp
84 # /usr/sbin/sendmail compatibility is not required /usr/lib/sendmail is
85 install -d $RPM_BUILD_ROOT%{_prefix}/lib
86 mv $RPM_BUILD_ROOT{%{_bindir},%{_prefix}/lib}/sendmail
89 rm -rf $RPM_BUILD_ROOT
95 %useradd -r -g smtpd -s /sbin/nologin -c "OpenSMTPd privsep user" -d /usr/share/empty smtpd
96 %useradd -r -g smtpq -s /sbin/nologin -c "OpenSMTPd queue user" -d /usr/share/empty smtpq
100 /sbin/chkconfig --add %{name}
101 %service %{name} restart
102 %systemd_post %{name}.service
106 %service %{name} stop
107 /sbin/chkconfig --del %{name}
109 %systemd_preun %{name}.service
115 %defattr(644,root,root,755)
116 %doc LICENSE README.md THANKS
117 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/smtpd.conf
119 %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/smtp
121 %attr(754,root,root) /etc/rc.d/init.d/opensmtpd
122 %{systemdunitdir}/%{name}.service
123 %attr(755,root,root) %{_sbindir}/mailq
124 %attr(755,root,root) %{_sbindir}/makemap
125 %attr(755,root,root) %{_sbindir}/newaliases
126 %attr(755,root,root) %{_sbindir}/smtpctl
127 %attr(755,root,root) %{_sbindir}/smtpd
128 %attr(755,root,root) %{_prefix}/lib/sendmail
129 %{_mandir}/man5/aliases.5*
130 %{_mandir}/man5/forward.5*
131 %{_mandir}/man5/smtpd.conf.5*
132 %{_mandir}/man5/table.5*
133 %{_mandir}/man8/makemap.8*
134 %{_mandir}/man8/newaliases.8*
135 %{_mandir}/man8/sendmail.8*
136 %{_mandir}/man8/smtpctl.8*
137 %{_mandir}/man8/smtpd.8*
138 %dir %{_libdir}/%{name}
139 %dir %{_libdir}/%{name}/smtpd
140 %attr(755,root,root) %{_libdir}/%{name}/smtpd/backend-queue-null
141 %attr(755,root,root) %{_libdir}/%{name}/smtpd/backend-queue-ram
142 %attr(755,root,root) %{_libdir}/%{name}/smtpd/backend-queue-stub
143 %attr(755,root,root) %{_libdir}/%{name}/smtpd/backend-scheduler-ram
144 %attr(755,root,root) %{_libdir}/%{name}/smtpd/backend-scheduler-stub
145 %attr(755,root,root) %{_libdir}/%{name}/smtpd/filter-dnsbl
146 %attr(755,root,root) %{_libdir}/%{name}/smtpd/filter-monkey
147 %attr(755,root,root) %{_libdir}/%{name}/smtpd/filter-stub
148 %attr(755,root,root) %{_libdir}/%{name}/smtpd/filter-trace
149 %attr(755,root,root) %{_libdir}/%{name}/smtpd/mail.local
150 %attr(755,root,root) %{_libdir}/%{name}/smtpd/table-passwd
151 %attr(755,root,root) %{_libdir}/%{name}/smtpd/table-stub