-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathpymilter.spec
300 lines (234 loc) · 10.2 KB
/
pymilter.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# we don't want to provide private python extension libs
%global sum Python interface to sendmail milter API
%global __provides_exclude_from ^(%{python2_sitearch})/.*\\.so$
%if 0%{?epel} == 7
%global python3 python36
%else
%global python3 python3
%endif
Summary: %{sum}
Name: python-pymilter
Version: 1.0.4
Release: 1%{?dist}
Url: http://bmsi.com/pymilter
Source: https://github.com/sdgathman/pymilter/archive/pymilter-%{version}.tar.gz
#Source1: tmpfiles-python-pymilter.conf
# remove unit tests that require network for check
Patch: pymilter-check.patch
License: GPLv2+
Group: Development/Libraries
BuildRequires: python2-devel, %{python3}-devel, sendmail-devel >= 8.13
# python-2.6.4 gets RuntimeError: not holding the import lock
# Need python2.6 specific pydns, not the version for system python
BuildRequires: gcc
%global _description\
This is a python extension module to enable python scripts to\
attach to sendmail's libmilter functionality. Additional python\
modules provide for navigating and modifying MIME parts, sending\
DSNs, and doing CBV.
%description %_description
%package -n python2-pymilter
Summary: %{sum}
%if 0%{?epel} >= 6
Requires: python-pydns
%else
Requires: python2-pydns
%endif
Requires: %{name}-common = %{version}-%{release}
%{?python_provide:%python_provide python2-pymilter}
%description -n python2-pymilter %_description
%package -n %{python3}-pymilter
Summary: %{sum}
%if 0%{?fedora} >= 26
Requires: %{python3}-py3dns
%endif
Requires: %{name}-common = %{version}-%{release}
%{?python_provide:%python_provide %{python3}-pymilter}
%description -n %{python3}-pymilter %_description
%package common
Summary: Common files and directories for python milters
BuildArch: noarch
%description common
Common files and directories used for python milters
%package selinux
Summary: SELinux policy module for pymilter
Group: System Environment/Base
Requires: policycoreutils, selinux-policy-targeted
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
BuildRequires: policycoreutils, checkpolicy, selinux-policy-devel
%if 0%{?epel} >= 6
BuildRequires: policycoreutils-python
%else
BuildRequires: policycoreutils-python-utils
%endif
%description selinux
Give sendmail_t additional access to stream sockets used to communicate
with milters.
%prep
%setup -q -n pymilter-pymilter-%{version}
#patch -p1 -b .check
%build
%py2_build
%py3_build
checkmodule -m -M -o pymilter.mod pymilter.te
semodule_package -o pymilter.pp -m pymilter.mod
%install
%py2_install
%py3_install
mkdir -p %{buildroot}/run/milter
mkdir -p %{buildroot}%{_localstatedir}/log/milter
mkdir -p %{buildroot}%{_libexecdir}/milter
#mkdir -p %{buildroot}%{_prefix}/lib/tmpfiles.d
#install -m 0644 %{SOURCE1} %{buildroot}%{_prefix}/lib/tmpfiles.d/%{name}.conf
# install selinux modules
mkdir -p %{buildroot}%{_datadir}/selinux/targeted
cp -p pymilter.pp %{buildroot}%{_datadir}/selinux/targeted
%check
py2path=$(ls -d build/lib.linux-*-2.*)
py3path=$(ls -d build/lib.linux-*-3.*)
PYTHONPATH=${py2path}:. python2 test.py &&
PYTHONPATH=${py3path}:. python3 test.py
%files -n python2-pymilter
%license COPYING
%doc README ChangeLog NEWS TODO CREDITS sample.py milter-template.py
%{python2_sitearch}/*
%files -n %{python3}-pymilter
%license COPYING
%doc README ChangeLog NEWS TODO CREDITS sample.py milter-template.py
%{python3_sitearch}/*
%files common
%dir %{_libexecdir}/milter
%{_prefix}/lib/tmpfiles.d/%{name}.conf
%dir %attr(0755,mail,mail) %{_localstatedir}/log/milter
%dir %attr(0755,mail,mail) /run/milter
%files selinux
%doc pymilter.te
%{_datadir}/selinux/targeted/*
%post selinux
%{_sbindir}/semodule -s targeted -i %{_datadir}/selinux/targeted/pymilter.pp \
&>/dev/null || :
%postun selinux
if [ $1 -eq 0 ] ; then
%{_sbindir}/semodule -s targeted -r pymilter &> /dev/null || :
fi
%changelog
- New upstream release: cleanup unused files, additional platform support
- Minor doc updates
- New upstream release
- patch step for python3 no longer required in build
- Add unit tests to %%check
- use libexec instead of libdir
- add python34 subpackage on el7
- build for both python2 and python3
- add selinux policy allowing sendmail_t access to milters
- Update Python macros to new packaging standards
(See https://fedoraproject.org/wiki/Changes/Move_usr_bin_python_into_separate_package)
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
- Escape macros in %%changelog
- Python 2 binary package renamed to python2-pymilter
See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
>>>>>>> 021796e51e5919812f1c300d1830ef9ed378db2d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
- Updated to 1.0
- Use tmpfiles and /run
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
- Add COPYING
- Fix buildroot macros and dist macro
- rebuilt with proper file permission
- Fixup for fedora release
- Add Milter.test module for unit testing milters.
- Fix typo that prevented setsymlist from being active.
- Change untrapped exception message to:
- "pymilter: untrapped exception in milter app"
- Raise RuntimeError when result != CONTINUE for @noreply and @nocallback
- Remove redundant table in miltermodule
- Fix CNAME chain duplicating TXT records in Milter.dns (from pyspf).
- Raise ValueError on unescaped '%%' passed to setreply
- Grace time at end of Greylist window
- Print milter.error for invalid callback return type.
(Since stacktrace is empty, the TypeError exception is confusing.)
- Fix milter-template.py
- Tweak Milter.utils.addr2bin and Milter.dynip to handle IP6
- Handle IP6 in Milter.utils.iniplist()
- python-2.6
- Handle source route in Milter.utils.parse_addr()
- Fix default arg in chgfrom.
- Disable negotiate callback for libmilter < 8.14.3 (1,0,1)
- Change result of @noreply callbacks to NOREPLY when so negotiated.
- Cache callback negotiation
- Add new callback support: data,negotiate,unknown
- Auto-negotiate protocol steps
- Fix missing address of optional param to addrcpt
- Stop using INSTALLED_FILES to make Fedora happy
- Remove config flag from start.sh glue
- Own /var/log/milter
- Use _localstatedir
- Changes to meet Fedora standards
- Split pymilter into its own CVS module
- Support chgfrom and addrcpt_par
- Support NS records in Milter.dns
- /var/run/milter directory must be owned by mail
- improved parsing into email and fullname (still 2 self test failures)
- implement no-DSN CBV, reduce full DSNs
- Use ifarch hack to build milter and milter-spf packages as noarch
- Remove spf dependency from dsn.py, add dns.py
- move AddrCache, parse_addr, iniplist to Milter package
- move parse_header to Milter.utils
- fix plock for missing source and can't change owner/group
- split out pymilter and pymilter-spf packages
- move milter apps to /usr/lib/pymilter
- SPF moved to pyspf RPM
- Support CBV timeout