]> git.pld-linux.org Git - packages/opensmtpd.git/blob - opensmtpd.spec
up to 5.4.2p1
[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.1
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 Patch0:         chroot-path.patch
20 Patch1:         makemap-paths.patch
21 URL:            http://www.opensmtpd.org/
22 BuildRequires:  autoconf
23 BuildRequires:  automake
24 BuildRequires:  bison
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
38 Requires:       rc-scripts
39 Provides:       group(smtpd)
40 Provides:       group(smtpq)
41 Provides:       smtpdaemon
42 Provides:       user(smtpd)
43 Provides:       user(smtpq)
44 Obsoletes:      smtpdaemon
45 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
47 %define         _privsepdir     /usr/share/empty
48
49 %description
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.
54
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.
61
62 %prep
63 %setup -q %{?prerelease: -n %{name}-%{prerelease}p1}
64 %patch0 -p1
65 %patch1 -p1
66
67 %build
68 %{__aclocal}
69 %{__autoconf}
70 %{__autoheader}
71 %{__automake}
72 %configure \
73         --sysconfdir=%{_sysconfdir}/mail \
74         --libexecdir=%{_libdir}/%{name} \
75         --with-mantype=man \
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
81
82 %{__make}
83
84 %install
85 rm -rf $RPM_BUILD_ROOT
86 %{__make} install \
87         DESTDIR=$RPM_BUILD_ROOT
88
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
93 %if %{with pam}
94 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/pam.d/smtp
95 %endif
96 touch $RPM_BUILD_ROOT%{_sysconfdir}/mail/aliases.db
97
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
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
This page took 0.071894 seconds and 3 git commands to generate.