]> git.pld-linux.org Git - packages/opensmtpd.git/blame - opensmtpd.spec
Release 2 (by relup.sh)
[packages/opensmtpd.git] / opensmtpd.spec
CommitLineData
74cd662a 1# TODO
4c4577b0 2# - should mailq and newaliases be in bindir?
e31b6fdb 3#
74cd662a
ER
4# Conditional build:
5%bcond_without pam # build without PAM support
ae4734f1 6%bcond_without table_db # build table-db backend
74cd662a 7
74cd662a 8Summary: Free implementation of the server-side SMTP protocol as defined by RFC 5321
e31b6fdb 9Summary(pl.UTF-8): Wolnodostępna implementacja strony serwerowej protokołu SMTP wg RFC 5321
74cd662a 10Name: opensmtpd
f23f9530 11Version: 6.8.0p2
90f33284 12Release: 2
74cd662a
ER
13License: ISC
14Group: Daemons
7c1f7555 15Source0: https://www.opensmtpd.org/archives/%{name}-%{version}.tar.gz
f23f9530 16# Source0-md5: 57209fc2bedf540b4649a42eb95341c5
74cd662a
ER
17Source1: %{name}.service
18Source2: %{name}.init
19Source3: %{name}.pam
8adbe1e9 20Source4: aliases
b45fa118 21Patch0: %{name}-ac.patch
e31b6fdb
JB
22URL: https://www.opensmtpd.org/
23BuildRequires: autoconf >= 2.69
74cd662a
ER
24BuildRequires: automake
25BuildRequires: bison
e31b6fdb 26%{?with_table_db:BuildRequires: db-devel}
4c4577b0 27BuildRequires: libasr-devel
74cd662a 28BuildRequires: libevent-devel
e31b6fdb 29BuildRequires: libtool >= 2:2
74cd662a
ER
30BuildRequires: openssl-devel
31%{?with_pam:BuildRequires: pam-devel}
32BuildRequires: rpmbuild(macros) >= 1.228
4cb11ef6 33BuildRequires: zlib-devel
74cd662a 34Requires(post,preun): /sbin/chkconfig
7f0d6214
ER
35Requires(postun): /usr/sbin/groupdel
36Requires(postun): /usr/sbin/userdel
37Requires(pre): /bin/id
38Requires(pre): /usr/bin/getgid
39Requires(pre): /usr/sbin/groupadd
40Requires(pre): /usr/sbin/useradd
74cd662a 41Requires: rc-scripts
badf7842 42Suggests: ca-certificates
7f0d6214
ER
43Provides: group(smtpd)
44Provides: group(smtpq)
74cd662a 45Provides: smtpdaemon
7f0d6214
ER
46Provides: user(smtpd)
47Provides: user(smtpq)
74cd662a 48Obsoletes: smtpdaemon
94d27dae 49%requires_ge_to openssl openssl-devel
74cd662a
ER
50BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51
badf7842
ER
52%define privsepdir /usr/share/empty
53%define spooldir /var/spool/smtpd
54%define certsdir /etc/certs
9c8fc530 55
74cd662a
ER
56%description
57OpenSMTPD is a FREE implementation of the server-side SMTP protocol as
58defined by RFC 5321, with some additional standard extensions. It
59allows ordinary machines to exchange e-mails with other systems
60speaking the SMTP protocol.
61
62Started out of dissatisfaction with other implementations, OpenSMTPD
63nowadays is a fairly complete SMTP implementation. OpenSMTPD is
64primarily developed by Gilles Chehade, Eric Faurot and Charles
65Longeau; with contributions from various OpenBSD hackers. OpenSMTPD is
66part of the OpenBSD Project. The software is freely usable and
67re-usable by everyone under an ISC license.
68
69%prep
86c67e9a 70%setup -q
82e2c352 71%patch0 -p1
74cd662a
ER
72
73%build
e31b6fdb
JB
74%{__libtoolize}
75%{__aclocal} -I m4
c7bec439
ER
76%{__autoconf}
77%{__autoheader}
78%{__automake}
74cd662a
ER
79%configure \
80 --sysconfdir=%{_sysconfdir}/mail \
e31b6fdb
JB
81 %{?with_pam:--with-auth-pam=smtp} \
82 --with-group-queue=smtpq \
74cd662a 83 --with-mantype=man \
e31b6fdb 84 --with-path-CAfile=%{certsdir}/ca-certificates.crt \
e20ff7b5 85 --with-path-empty=%{privsepdir} \
e31b6fdb
JB
86 %{?with_table_db:--with-table-db} \
87 --with-user-queue=smtpq \
88 --with-user-smtpd=smtpd
74cd662a
ER
89
90%{__make}
91
92%install
93rm -rf $RPM_BUILD_ROOT
e31b6fdb 94
74cd662a
ER
95%{__make} install \
96 DESTDIR=$RPM_BUILD_ROOT
97
98install -d $RPM_BUILD_ROOT{%{systemdunitdir},/etc/{rc.d/init.d,pam.d}}
99cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdunitdir}/opensmtpd.service
100install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/opensmtpd
8adbe1e9 101cp -p %{SOURCE4} $RPM_BUILD_ROOT/etc/mail
74cd662a
ER
102%if %{with pam}
103cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/smtp
104%endif
ddd6674a 105touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases.db
74cd662a 106
74cd662a 107install -d $RPM_BUILD_ROOT%{_prefix}/lib
82e2c352
AM
108ln -s %{_sbindir}/smtpctl $RPM_BUILD_ROOT%{_prefix}/lib/sendmail
109
110# other utils
111ln -s %{_sbindir}/smtpctl $RPM_BUILD_ROOT%{_sbindir}/mailq
e31b6fdb
JB
112ln -s %{_sbindir}/smtpctl $RPM_BUILD_ROOT%{_sbindir}/sendmail
113%if %{with table_db}
82e2c352
AM
114ln -s %{_sbindir}/smtpctl $RPM_BUILD_ROOT%{_sbindir}/makemap
115ln -s %{_sbindir}/smtpctl $RPM_BUILD_ROOT%{_sbindir}/newaliases
e31b6fdb 116%endif
74cd662a 117
2323b70c 118# queue dirs
badf7842 119install -d $RPM_BUILD_ROOT%{spooldir}/{queue,corrupt,incoming,offline,purge,temporary}
2323b70c 120
74cd662a
ER
121%clean
122rm -rf $RPM_BUILD_ROOT
123
124%pre
7f0d6214
ER
125%groupadd -g 297 smtpd
126%groupadd -g 298 smtpq
badf7842
ER
127%useradd -u 297 -g smtpd -s /sbin/nologin -c "OpenSMTPd privsep user" -d %{privsepdir} smtpd
128%useradd -u 298 -g smtpq -s /sbin/nologin -c "OpenSMTPd queue user" -d %{privsepdir} smtpq
74cd662a
ER
129
130%post
131/sbin/chkconfig --add %{name}
132%service %{name} restart
133%systemd_post %{name}.service
134
135%preun
136if [ $1 = 0 ]; then
137 %service %{name} stop
138 /sbin/chkconfig --del %{name}
139fi
140%systemd_preun %{name}.service
141
142%postun
7f0d6214
ER
143if [ "$1" = "0" ]; then
144 %userremove smtpd
145 %userremove smtpq
146 %groupremove smtpd
147 %groupremove smtpq
148fi
74cd662a
ER
149%systemd_reload
150
151%files
152%defattr(644,root,root,755)
b45fa118 153%doc LICENSE README.md
8adbe1e9 154%dir %{_sysconfdir}/mail
74cd662a 155%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/smtpd.conf
8adbe1e9 156%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mail/aliases
e31b6fdb 157%if %{with table_db}
ddd6674a 158%ghost %{_sysconfdir}/mail/aliases.db
e31b6fdb 159%endif
74cd662a
ER
160%if %{with pam}
161%config(noreplace) %verify(not md5 mtime size) /etc/pam.d/smtp
162%endif
163%attr(754,root,root) /etc/rc.d/init.d/opensmtpd
164%{systemdunitdir}/%{name}.service
b45fa118 165%attr(755,root,root) %{_bindir}/smtp
74cd662a 166%attr(755,root,root) %{_sbindir}/mailq
e31b6fdb 167%attr(755,root,root) %{_sbindir}/sendmail
74cd662a
ER
168%attr(755,root,root) %{_sbindir}/smtpctl
169%attr(755,root,root) %{_sbindir}/smtpd
170%attr(755,root,root) %{_prefix}/lib/sendmail
b45fa118 171%{_mandir}/man1/smtp.1*
74cd662a
ER
172%{_mandir}/man5/aliases.5*
173%{_mandir}/man5/forward.5*
174%{_mandir}/man5/smtpd.conf.5*
175%{_mandir}/man5/table.5*
74cd662a
ER
176%{_mandir}/man8/sendmail.8*
177%{_mandir}/man8/smtpctl.8*
178%{_mandir}/man8/smtpd.8*
9127fec2
ER
179
180%if %{with table_db}
181%attr(755,root,root) %{_sbindir}/makemap
182%attr(755,root,root) %{_sbindir}/newaliases
183%{_mandir}/man8/makemap.8*
184%{_mandir}/man8/newaliases.8*
185%endif
186
82e2c352
AM
187%dir %{_libexecdir}/%{name}
188%attr(755,root,root) %{_libexecdir}/%{name}/encrypt
417386e8 189%attr(755,root,root) %{_libexecdir}/%{name}/lockspool
e31b6fdb 190%attr(755,root,root) %{_libexecdir}/%{name}/mail.lmtp
82e2c352 191%attr(755,root,root) %{_libexecdir}/%{name}/mail.local
e31b6fdb
JB
192%attr(755,root,root) %{_libexecdir}/%{name}/mail.maildir
193%attr(755,root,root) %{_libexecdir}/%{name}/mail.mboxfile
194%attr(755,root,root) %{_libexecdir}/%{name}/mail.mda
2323b70c 195
badf7842 196%dir %attr(711,root,root) %{spooldir}
93258686 197%dir %attr(770,root,smtpq) %{spooldir}/offline
badf7842
ER
198%dir %attr(700,smtpq,root) %{spooldir}/corrupt
199%dir %attr(700,smtpq,root) %{spooldir}/incoming
200%dir %attr(700,smtpq,root) %{spooldir}/purge
201%dir %attr(700,smtpq,root) %{spooldir}/queue
202%dir %attr(700,smtpq,root) %{spooldir}/temporary
This page took 0.13089 seconds and 4 git commands to generate.