]> git.pld-linux.org Git - packages/opensmtpd.git/blob - opensmtpd.spec
package queue dirs
[packages/opensmtpd.git] / opensmtpd.spec
1 # TODO
2 # - should mailq and newalises be in bindir?
3
4 # Conditional build:
5 %bcond_without  pam             # build without PAM support
6
7 Summary:        Free implementation of the server-side SMTP protocol as defined by RFC 5321
8 Name:           opensmtpd
9 Version:        5.4.2p1
10 Release:        0.6
11 License:        ISC
12 Group:          Daemons
13 Source0:        https://www.opensmtpd.org/archives/%{name}-%{version}.tar.gz
14 # Source0-md5:  c76b39a5fcc0ad05eea541e74b16e62a
15 Source1:        %{name}.service
16 Source2:        %{name}.init
17 Source3:        %{name}.pam
18 Source4:        aliases
19 URL:            http://www.opensmtpd.org/
20 BuildRequires:  autoconf
21 BuildRequires:  automake
22 BuildRequires:  bison
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
36 Requires:       rc-scripts
37 Provides:       group(smtpd)
38 Provides:       group(smtpq)
39 Provides:       smtpdaemon
40 Provides:       user(smtpd)
41 Provides:       user(smtpq)
42 Obsoletes:      smtpdaemon
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %define         _privsepdir     /usr/share/empty
46 %define         _spooldir       /var/spool/smtpd
47
48 %description
49 OpenSMTPD is a FREE implementation of the server-side SMTP protocol as
50 defined by RFC 5321, with some additional standard extensions. It
51 allows ordinary machines to exchange e-mails with other systems
52 speaking the SMTP protocol.
53
54 Started out of dissatisfaction with other implementations, OpenSMTPD
55 nowadays is a fairly complete SMTP implementation. OpenSMTPD is
56 primarily developed by Gilles Chehade, Eric Faurot and Charles
57 Longeau; with contributions from various OpenBSD hackers. OpenSMTPD is
58 part of the OpenBSD Project. The software is freely usable and
59 re-usable by everyone under an ISC license.
60
61 %prep
62 %setup -q
63
64 %build
65 %{__aclocal}
66 %{__autoconf}
67 %{__autoheader}
68 %{__automake}
69 %configure \
70         --sysconfdir=%{_sysconfdir}/mail \
71         --libexecdir=%{_libdir}/%{name} \
72         --with-mantype=man \
73         %{?with_pam:--with-pam} \
74         --with-privsep-user=smtpd \
75         --with-queue-user=smtpq \
76         --with-privsep-path=%{_privsepdir} \
77         --with-sock-dir=%{_localstatedir}/run
78
79 %{__make}
80
81 %install
82 rm -rf $RPM_BUILD_ROOT
83 %{__make} install \
84         DESTDIR=$RPM_BUILD_ROOT
85
86 install -d $RPM_BUILD_ROOT{%{systemdunitdir},/etc/{rc.d/init.d,pam.d}}
87 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/opensmtpd.service
88 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/opensmtpd
89 cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/mail
90 %if %{with pam}
91 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/smtp
92 %endif
93 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases.db
94
95 # /usr/sbin/sendmail compatibility is not required /usr/lib/sendmail is
96 install -d $RPM_BUILD_ROOT%{_prefix}/lib
97 mv $RPM_BUILD_ROOT{%{_bindir},%{_prefix}/lib}/sendmail
98
99 # queue dirs
100 install -d $RPM_BUILD_ROOT%{_spooldir}/{queue,corrupt,incoming,offline,purge,temporary}
101
102 %clean
103 rm -rf $RPM_BUILD_ROOT
104
105 %pre
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
110
111 %post
112 /sbin/chkconfig --add %{name}
113 %service %{name} restart
114 %systemd_post %{name}.service
115
116 %preun
117 if [ $1 = 0 ]; then
118         %service %{name} stop
119         /sbin/chkconfig --del %{name}
120 fi
121 %systemd_preun %{name}.service
122
123 %postun
124 if [ "$1" = "0" ]; then
125         %userremove smtpd
126         %userremove smtpq
127         %groupremove smtpd
128         %groupremove smtpq
129 fi
130 %systemd_reload
131
132 %files
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
139 %if %{with pam}
140 %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/smtp
141 %endif
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
174
175 %dir %attr(711,root,root) %{_spooldir}
176 %dir %attr(1777,root,root) %{_spooldir}/offline
177 %dir %attr(700,smtpq,root) %{_spooldir}/corrupt
178 %dir %attr(700,smtpq,root) %{_spooldir}/incoming
179 %dir %attr(700,smtpq,root) %{_spooldir}/purge
180 %dir %attr(700,smtpq,root) %{_spooldir}/queue
181 %dir %attr(700,smtpq,root) %{_spooldir}/temporary
This page took 0.088741 seconds and 3 git commands to generate.