14
0

- Add patch set-c-standard-17.patch:

* Set the C standard to c17 until libmilter is fixed.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pymilter?expand=0&rev=20
This commit is contained in:
2025-07-30 05:00:30 +00:00
committed by Git OBS Bridge
commit ea78f1a65c
8 changed files with 283 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

View File

@@ -0,0 +1,65 @@
From 1ead9028fc63ae3ec6ea3b0c438e6ed088a2b20e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?=
<jaime.marquinez.ferrandiz@fastmail.net>
Date: Tue, 5 Mar 2024 19:14:30 +0100
Subject: [PATCH] Remove calls to the deprecated method "assertEquals"
Reference: https://github.com/sdgathman/pymilter/pull/57
It has been removed in python 3.12
---
testsample.py | 6 +++---
testutils.py | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/testsample.py b/testsample.py
index 100d1a6..70222bf 100644
--- a/testsample.py
+++ b/testsample.py
@@ -31,7 +31,7 @@ class BMSMilterTestCase(unittest.TestCase):
count = 10
while count > 0:
rc = ctx._connect(helo='milter-template.example.org')
- self.assertEquals(rc,Milter.CONTINUE)
+ self.assertEqual(rc,Milter.CONTINUE)
with open('test/'+fname,'rb') as fp:
rc = ctx._feedFile(fp)
milter = ctx.getpriv()
@@ -46,7 +46,7 @@ class BMSMilterTestCase(unittest.TestCase):
ctx._setsymval('{auth_type}','batcomputer')
ctx._setsymval('j','mailhost')
rc = ctx._connect()
- self.assertEquals(rc,Milter.CONTINUE)
+ self.assertEqual(rc,Milter.CONTINUE)
with open('test/'+fname,'rb') as fp:
rc = ctx._feedFile(fp)
milter = ctx.getpriv()
@@ -69,7 +69,7 @@ class BMSMilterTestCase(unittest.TestCase):
milter = ctx.getpriv()
# self.assertTrue(milter.user == 'batman',"getsymval failed: "+
# "%s != %s"%(milter.user,'batman'))
- self.assertEquals(milter.user,'batman')
+ self.assertEqual(milter.user,'batman')
self.assertTrue(milter.auth_type != 'batcomputer',"setsymlist failed")
self.assertTrue(rc == Milter.ACCEPT)
self.assertTrue(ctx._bodyreplaced,"Message body not replaced")
diff --git a/testutils.py b/testutils.py
index 56ec161..93e078c 100644
--- a/testutils.py
+++ b/testutils.py
@@ -24,11 +24,11 @@ class AddrCacheTestCase(unittest.TestCase):
self.assertTrue(cache.has_key('foo@bar.com'))
self.assertTrue(not cache.has_key('hello@bar.com'))
self.assertTrue('baz@bar.com' in cache)
- self.assertEquals(cache['temp@bar.com'],'testing')
+ self.assertEqual(cache['temp@bar.com'],'testing')
s = open(self.fname).readlines()
self.assertTrue(len(s) == 2)
self.assertTrue(s[0].startswith('foo@bar.com '))
- self.assertEquals(s[1].strip(),'baz@bar.com')
+ self.assertEqual(s[1].strip(),'baz@bar.com')
# check that new result overrides old
cache['temp@bar.com'] = None
self.assertTrue(not cache['temp@bar.com'])
--
2.44.0

3
pymilter-1.0.5.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8093032829ddd53261dbe2991959514156767f3785dfb095ed9b17f3fba965e1
size 1030610

59
python-pymilter.changes Normal file
View File

@@ -0,0 +1,59 @@
-------------------------------------------------------------------
Wed Jul 30 04:59:43 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch set-c-standard-17.patch:
* Set the C standard to c17 until libmilter is fixed.
-------------------------------------------------------------------
Tue Jun 10 09:04:00 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to pip-based build
-------------------------------------------------------------------
Tue Mar 5 18:22:42 UTC 2024 - Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fastmail.net>
- Actually run the correct tests
- Fix the fdupes call
- Add 0001-Remove-calls-to-the-deprecated-method-assertEquals.patch
-------------------------------------------------------------------
Sat Jan 7 23:24:10 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 1.0.5:
* fix deprecation warnings
-------------------------------------------------------------------
Sat Feb 13 00:04:30 UTC 2021 - Neal Gompa <ngompa13@gmail.com>
- Fix dependency on py3dns so that flavor builds generate correctly
-------------------------------------------------------------------
Fri Feb 12 13:10:10 UTC 2021 - Markéta Machová <mmachova@suse.com>
- Drop py{2.3}-only parts as py2 is skipped
-------------------------------------------------------------------
Wed Dec 11 08:19:51 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
- Require full python for sqlite module
-------------------------------------------------------------------
Thu Apr 25 08:37:53 UTC 2019 - pgajdos@suse.com
- version update to 1.0.4
- cleanup unused files, additional platform support
- Minor doc updates
- patch step for python3 no longer required in build
- turn the test suite on
- deleted patches
- pymilter-dns_dsn.patch (upstreamed)
-------------------------------------------------------------------
Thu Sep 6 12:54:13 UTC 2018 - Jan Engelhardt <jengelh@inai.de>
- Fix grammar issues in description. Fix RPM group.
-------------------------------------------------------------------
Thu Sep 6 02:33:45 UTC 2018 - Neal Gompa <ngompa13@gmail.com>
- Initial packaging

104
python-pymilter.spec Normal file
View File

@@ -0,0 +1,104 @@
#
# spec file for package python-pymilter
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2018 Neal Gompa <ngompa13@gmail.com>.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# we don't want to provide private python extension libs
%global __provides_exclude_from ^(%{python2_sitearch}/.*\\.so|%{python3_sitearch}/.*\\.so)$
# Python 2 module isn't building properly and we don't really need it right now anyway...
Name: python-pymilter
Version: 1.0.5
Release: 0
Summary: Python interface to the sendmail milter API
License: GPL-2.0-or-later
URL: https://www.bmsi.com/python/milter.html
Source0: https://github.com/sdgathman/pymilter/archive/pymilter-%{version}.tar.gz
Source1: tmpfiles-python-pymilter.conf
# PATCH-FIX-UPSTREAM: https://github.com/sdgathman/pymilter/pull/57
Patch1: 0001-Remove-calls-to-the-deprecated-method-assertEquals.patch
# PATCH-FIX-UPSTREAM https://github.com/sdgathman/pymilter/pull/70
Patch2: set-c-standard-17.patch
BuildRequires: %{python_module bsddb3}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: %{pythons}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: sendmail-devel >= 8.13
BuildRequires: systemd-rpm-macros
# Common subpackage named as such to avoid creating flavor packages
Requires: pymilter-common = %{version}-%{release}
Requires: python
Requires: python-bsddb3
Requires: python-py3dns
%python_subpackages
%description
This is a Python extension module to enable python scripts to attach to
sendmail's libmilter functionality. Additional Python modules provide for
navigation and modification of MIME parts, sending DSNs, and doing CBV.
%package -n pymilter-common
Summary: Common files for pymilter
Requires(post): systemd
BuildArch: noarch
%description -n pymilter-common
This package contains the common files used for pymilter.
%prep
%autosetup -n pymilter-pymilter-%{version} -p1
%build
%pyproject_wheel
%install
%pyproject_install
mkdir -p %{buildroot}%{_localstatedir}/log/milter
mkdir -p %{buildroot}%{_libexecdir}/milter
mkdir -p %{buildroot}%{_tmpfilesdir}
install -m 0644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf
%python_expand %fdupes %{buildroot}/%{$python_sitearch}
%check
# remove tests that don't work
rm test.py testpolicy.py
%pyunittest_arch -v
%files %{python_files}
%doc README.md ChangeLog NEWS TODO CREDITS sample.py template.py
%license COPYING
%{python_sitearch}/Milter
%{python_sitearch}/milter.cpython*
%{python_sitearch}/mime.py
%{python_sitearch}/pymilter-%{version}*-info
%pycache_only %{python_sitearch}/__pycache__/mime*
%files -n pymilter-common
%license COPYING
%{_libexecdir}/milter
%dir %attr(0755,mail,mail) %{_localstatedir}/log/milter
%{_tmpfilesdir}/%{name}.conf
%post -n pymilter-common
%tmpfiles_create %{_tmpfilesdir}/%{name}.conf
%changelog

27
set-c-standard-17.patch Normal file
View File

@@ -0,0 +1,27 @@
From 050b3a15bc00a31968cbdcf627692c1eb2ca3219 Mon Sep 17 00:00:00 2001
From: Sandro <devel@penguinpee.nl>
Date: Wed, 12 Mar 2025 23:44:55 +0100
Subject: [PATCH] Set C standard to C17 explicitely
GCC 15 uses C23 by default. But `libmilter` is not compatible, yet.
This breaks the build as `bool` is a keyword in C23 (issue #68).
---
setup.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index 958feee..a6fe2a0 100644
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,10 @@
# set MAX_ML_REPLY to 1 for sendmail < 8.13
define_macros = [ ('MAX_ML_REPLY',32) ],
# save lots of debugging time testing rfc2553 compliance
- extra_compile_args = [ "-Werror=implicit-function-declaration" ]
+ extra_compile_args = [
+ "-Werror=implicit-function-declaration",
+ "-std=gnu17",
+ ]
),
],
keywords = ['sendmail','milter'],

View File

@@ -0,0 +1 @@
D /var/run/milter 0755 mail mail -