-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcourier-pythonfilter.spec
More file actions
67 lines (46 loc) · 1.94 KB
/
courier-pythonfilter.spec
File metadata and controls
67 lines (46 loc) · 1.94 KB
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
%define expect_egg_info %(%{__python3} -c "import distutils.command.install_egg_info" > /dev/null 2>&1 && echo 1 || echo 0)
%define courier_user %(. /etc/profile.d/courier.sh ; courier-config | grep ^mailuser | cut -f2 -d=)
%define courier_group %(. /etc/profile.d/courier.sh ; courier-config | grep ^mailgroup | cut -f2 -d=)
%define courier_libexec %(. /etc/profile.d/courier.sh ; courier-config | grep ^libexecdir | cut -f2 -d=)
Name: courier-pythonfilter
Version: 3.0
Release: 1%{?dist}
Summary: Python filtering architecture for the Courier MTA.
License: GPL-3.0-or-later
Url: https://github.com/gordonmessmer/courier-pythonfilter/
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3-pytest
BuildRequires: courier
Requires: courier
%global _description %{expand:
Pythonfilter provides a framework for writing message filters in
Python, as well as a selection of common filters.}
%description %_description
%prep
%autosetup
%generate_buildrequires
%pyproject_buildrequires
%build
%pyproject_wheel
%install
%pyproject_install
mv $RPM_BUILD_ROOT%{python3_sitelib}/etc $RPM_BUILD_ROOT%{_sysconfdir}
%pyproject_save_files -l pythonfilter courier
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/pythonfilter/quarantine
mkdir -p ${RPM_BUILD_ROOT}%{courier_libexec}/filters
ln -s %{_bindir}/pythonfilter ${RPM_BUILD_ROOT}%{courier_libexec}/filters
%check
# TODO: shorten socket_path = '%s/tests/spool/courier/allfilters/pythonfilter' % project_root in testfilter
#pytest
%files -f %{pyproject_files}
%doc README README.developers
%if %{expect_egg_info}
%{python3_sitelib}/courier_pythonfilter-*-info
%endif
%{_bindir}/*
%config(noreplace) %{_sysconfdir}/*
%attr(0700,%{courier_user},%{courier_group}) %dir %{_localstatedir}/lib/pythonfilter
%attr(0700,%{courier_user},%{courier_group}) %dir %{_localstatedir}/lib/pythonfilter/quarantine
%{courier_libexec}/filters/pythonfilter