]> git.pld-linux.org Git - packages/opensmtpd.git/blob - opensmtpd.spec
22d3001c710030c4d855d9fd353c59d885345d78
[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.2
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
47 %description
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.
52
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.
59
60 %prep
61 %setup -q
62
63 %build
64 %{__aclocal}
65 %{__autoconf}
66 %{__autoheader}
67 %{__automake}
68 %configure \
69         --sysconfdir=%{_sysconfdir}/mail \
70         --libexecdir=%{_libdir}/%{name} \
71         --with-mantype=man \
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
77
78 %{__make}
79
80 %install
81 rm -rf $RPM_BUILD_ROOT
82 %{__make} install \
83         DESTDIR=$RPM_BUILD_ROOT
84
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
89 %if %{with pam}
90 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/smtp
91 %endif
92 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases.db
93
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
97
98 %clean
99 rm -rf $RPM_BUILD_ROOT
100
101 %pre
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
106
107 %post
108 /sbin/chkconfig --add %{name}
109 %service %{name} restart
110 %systemd_post %{name}.service
111
112 %preun
113 if [ $1 = 0 ]; then
114         %service %{name} stop
115         /sbin/chkconfig --del %{name}
116 fi
117 %systemd_preun %{name}.service
118
119 %postun
120 if [ "$1" = "0" ]; then
121         %userremove smtpd
122         %userremove smtpq
123         %groupremove smtpd
124         %groupremove smtpq
125 fi
126 %systemd_reload
127
128 %files
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
135 %if %{with pam}
136 %config(noreplace) %verify(not md5 mtime size) /etc/pam.d/smtp
137 %endif
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
This page took 0.072414 seconds and 2 git commands to generate.