#1 update to python3 from devel branch of 3.7
Merged 4 years ago by robert. Opened 4 years ago by rebus.
Unknown source master  into  master

file modified
+1
@@ -1,2 +1,3 @@

  /MacroMilter-*.tar.gz

  /macromilter-*.tar.gz

+ /macromilter-3.7.0-2761838.tar.gz 

\ No newline at end of file

file modified
+77 -18
@@ -1,34 +1,78 @@

  Summary:           Milter to check mails for suspicious Microsoft VBA macro code

  Name:              macromilter

- Version:           3.4.3

- Release:           5%{?dist}

- License:           MIT

  URL:               https://github.com/sbidy/MacroMilter

- Source0:           https://github.com/sbidy/MacroMilter/archive/%{version}/%{name}-%{version}.tar.gz

+ Version:           3.7.0

+ License:           MIT

+ %global            baserelease      1

+ 

+ # Build from release or from git snapshot

+ %bcond_without     snapshot

+ 

+ # Build python2 up till fc31 and rhel7, use python3 on fc32+ and rhel8+

+ %if ( 0%{?fedora} && 0%{?fedora} >= 32 ) || ( 0%{?rhel} && 0%{?rhel} >= 7 )

+ %bcond_with        python3

+ %else

+ %bcond_without     python3

+ %endif

+ 

+ %global            gituser         sbidy

+ %global            gitname         MacroMilter

+ #                                  3.7 branch pre-release

+ %global            gitdate         20191111

+ %global            commit          2761838f0358995828e38cdcce06f845162cc55f

+ %global            shortcommit     %(c=%{commit}; echo ${c:0:7})

+ 

+ 

+ %if ! 0%{?with_snapshot}

+ #Build from release

+ Source0:           https://github.com/%{gituser}/%{gitname}/archive/%{version}/%{name}-%{version}.tar.gz

+ Release:           %{baserelease}%{?dist}

+ %else

+ #Build from git snapshot

+ Source0:           https://github.com/%{gituser}/%{gitname}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz

+ Release:           0.%{baserelease}.%{gitdate}git%{shortcommit}%{?dist}

+ %endif

+ 

  Source1:           macromilter.service

  Source2:           macromilter.logrotate

  Source3:           macromilter.tmpfilesd

  Source4:           README.fedora

- Patch0:            macromilter-3.4.3-var-lib.patch

+ #Patch0:            macromilter-3.4.3-var-lib.patch

+ 

  BuildArch:         noarch

- BuildRequires:     python2-devel

+ 

  BuildRequires:     systemd

+ 

  Requires(pre):     shadow-utils

  Requires(post):    systemd

  Requires(preun):   systemd

  Requires(postun):  systemd

+ 

+ %if 0%{?with_python3}

+ BuildRequires:     python%{python3_pkgversion}-devel

+ Requires:          python%{python3_pkgversion}-oletools

+ Requires:          python%{python3_pkgversion}-pymilter

+ Requires:          python%{python3_pkgversion}-configparser

+ 

+ %else

+ BuildRequires:     python2-devel

+ Requires:          python2-oletools

+ 

  # No python3-pymilter package yet

  %if 0%{?rhel} > 7 || 0%{?fedora} > 27

  Requires:          python2-pymilter

  %else

  Requires:          python-pymilter

  %endif

- Requires:          python2-oletools

  %if 0%{?fedora}

  Requires:          python2-configparser

  %else

  Requires:          python-configparser

  %endif

+ 

+ %endif

+ 

+ 

  Provides:          MacroMilter = %{version}-%{release}

  

  %description
@@ -39,44 +83,59 @@

  and replaced by harmless text files or alternatively the whole e-mail will

  be rejected.

  

+ 

  %prep

- %setup -q -n MacroMilter-%{version}

+ %if ! 0%{?with_snapshot}

+ %autosetup -n MacroMilter-%{version}

+ %else

+ %autosetup -n MacroMilter-%{commit}

+ %endif

  cp -pf %{SOURCE4} .

- %patch0 -p1 -b .var-lib

+ 

  

  %build

  # Empty build section, most likely nothing required.

  

+ 

  %install

- install -D -p -m 755 %{name}/macromilter.py $RPM_BUILD_ROOT%{_bindir}/%{name}

- sed -e '1i #!%{_bindir}/python2' -i $RPM_BUILD_ROOT%{_bindir}/%{name}

- touch -c -r %{name}/macromilter.py $RPM_BUILD_ROOT%{_bindir}/%{name}

- install -D -p -m 644 %{name}/config.ini $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config.ini

- install -D -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_unitdir}/%{name}.service

- install -D -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/%{name}

- install -D -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_tmpfilesdir}/%{name}.conf

- mkdir -p $RPM_BUILD_ROOT{/run,%{_localstatedir}/{lib,log}}/%{name}/

+ install -D -p -m 755 %{name}/macromilter.py %{buildroot}%{_bindir}/%{name}

+ %if 0%{?with_python3}

+ sed -e '1i #!%{_bindir}/python3' -i %{buildroot}%{_bindir}/%{name}

+ %else

+ sed -e '1i #!%{_bindir}/python2' -i %{buildroot}%{_bindir}/%{name}

+ %endif

+ touch -c -r %{name}/macromilter.py %{buildroot}%{_bindir}/%{name}

+ install -D -p -m 644 %{name}/config.yaml %{buildroot}%{_sysconfdir}/%{name}/config.yaml

+ install -D -p -m 644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service

+ install -D -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}

+ install -D -p -m 644 %{SOURCE3} %{buildroot}%{_tmpfilesdir}/%{name}.conf

+ mkdir -p %{buildroot}{/run,%{_localstatedir}/{lib,log}}/%{name}/

+ 

  

  %pre

  getent group %{name} > /dev/null || %{_sbindir}/groupadd -r %{name}

  getent passwd %{name} > /dev/null || %{_sbindir}/useradd -r -g %{name} -d %{_localstatedir}/lib/%{name} -s /sbin/nologin -c "MacroMilter service" %{name}

  exit 0

  

+ 

  %post

  %systemd_post %{name}.service

  

+ 

  %preun

  %systemd_preun %{name}.service

  

+ 

  %postun

  %systemd_postun_with_restart %{name}.service

  

+ 

  %files

  %license LICENSE.md

  %doc README.fedora README.md

  %{_bindir}/%{name}

  %dir %{_sysconfdir}/%{name}/

- %config(noreplace) %{_sysconfdir}/%{name}/config.ini

+ %config(noreplace) %{_sysconfdir}/%{name}/config.yaml

  %dir %{_sysconfdir}/logrotate.d/

  %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}

  %{_unitdir}/%{name}.service

file modified
+1 -1
@@ -1,1 +1,1 @@

- SHA512 (macromilter-3.4.3.tar.gz) = 18a91fe0e7168cfb0372a432838ab52e6600ca7390e0aa231d3c2d211fa532eb489ec4f7277a52bbbbffeb34cf72733bdbe2334f7965fe2d254ad3cfefab5518

+ SHA512 (macromilter-3.7.0-2761838.tar.gz) = 47e19c9f67f130535de05a6db7324458a82aa98864436260c3257cff786e2f549ac004d8ca0004e0d1045a5adfaeab2b9ca378969f59af27452f18e1fc6ae051

Hello,
this will switch to python3 in the rawhide macromilter package.
Package for versions up to f31 will be still build with python2.
Michal Ambroz

Pull-Request has been merged by robert

4 years ago