diff --git a/makefile b/makefile index 532253d22c4028ef00d34328cd22cf909616addd..4c0568f3baff2d4af073d7c719a911f274966805 100644 --- a/makefile +++ b/makefile @@ -11,4 +11,8 @@ SRCTAR=$(PKG).tar.gz $(SRCTAR): git archive --format=tar.gz --prefix=$(PKG)/ -o $(SRCTAR) $(PKG) +# add extra copy of name like github so annoyingly does... +github: + git archive --format=tar.gz --prefix=pymilter-$(PKG)/ -o $(SRCTAR) $(PKG) + gittar: $(SRCTAR) diff --git a/pymilter-check.patch b/pymilter-check.patch new file mode 100644 index 0000000000000000000000000000000000000000..f6ba33f2949019bae8a40446f8ad3c35706e535f --- /dev/null +++ b/pymilter-check.patch @@ -0,0 +1,27 @@ +diff -up ./Milter/utils.py.check ./Milter/utils.py +--- ./Milter/utils.py.check 2018-08-04 23:01:23.858668412 -0400 ++++ ./Milter/utils.py 2018-08-04 23:01:39.460869588 -0400 +@@ -68,10 +68,6 @@ def iniplist(ipaddr,iplist): + True + >>> iniplist('192.168.0.45',['192.168.0.*']) + True +- >>> iniplist('4.2.2.2',['b.resolvers.Level3.net']) +- True +- >>> iniplist('2606:2800:220:1::',['example.com/40']) +- True + >>> iniplist('4.2.2.2',['nothing.example.com']) + False + >>> iniplist('2001:610:779:0:223:6cff:fe9a:9cf3',['127.0.0.1','172.20.1.0/24','2001:610:779::/48']) +diff -up ./test.py.check ./test.py +--- ./test.py.check 2018-08-04 23:04:58.609420815 -0400 ++++ ./test.py 2018-08-04 23:05:40.070949438 -0400 +@@ -14,6 +14,8 @@ def suite(): + return s + + if __name__ == '__main__': ++ import sys + try: os.remove('test/milter.log') + except: pass +- unittest.TextTestRunner().run(suite()) ++ rc = unittest.TextTestRunner().run(suite()) ++ sys.exit(len(rc.failures)) diff --git a/pymilter.spec b/pymilter.spec index c25d1f8bd9c030fd8470ad3d06368ed39a5476c2..73d402e4bc2ebf347e6683cc5137c12e3d577ae2 100644 --- a/pymilter.spec +++ b/pymilter.spec @@ -2,7 +2,7 @@ %global sum Python interface to sendmail milter API %global __provides_exclude_from ^(%{python2_sitearch})/.*\\.so$ %if 0%{?epel} == 7 -%global python3 python34 +%global python3 python36 %else %global python3 python3 %endif @@ -13,7 +13,7 @@ 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 +#Source1: tmpfiles-python-pymilter.conf # remove unit tests that require network for check Patch: pymilter-check.patch License: GPLv2+ @@ -79,11 +79,10 @@ with milters. %prep %setup -q -n pymilter-pymilter-%{version} -%patch -p1 -b .check +#patch -p1 -b .check %build %py2_build -#patch -p1 -b -z .py3 <milter.patch # not needed since 1.0.3 %py3_build checkmodule -m -M -o pymilter.mod pymilter.te semodule_package -o pymilter.pp -m pymilter.mod @@ -95,8 +94,8 @@ semodule_package -o pymilter.pp -m pymilter.mod 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 +#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