Restore r130 until .service unit problem with 1284779+ has been addressed
OBS-URL: https://build.opensuse.org/package/show/security/fail2ban?expand=0&rev=133
This commit is contained in:
@@ -1,12 +1,3 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Jun 10 13:23:16 UTC 2025 - Nathan Cutler <ncutler@suse.com>
|
||||
|
||||
- spec:
|
||||
* Use pyproject macros to build and install (including
|
||||
implementing manual install for files under /etc and /usr from
|
||||
the wheel)
|
||||
* some BuildRequires cleanup
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jun 6 11:15:38 UTC 2025 - Max Lin <mlin@suse.com>
|
||||
|
||||
|
@@ -16,8 +16,6 @@
|
||||
#
|
||||
|
||||
|
||||
%define pythons python3
|
||||
|
||||
%{!?tmpfiles_create:%global tmpfiles_create systemd-tmpfiles --create}
|
||||
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
||||
%if ! %{defined _fillupdir}
|
||||
@@ -46,15 +44,11 @@ Patch201: %{name}-0.10.4-env-script-interpreter.patch
|
||||
Patch301: harden_fail2ban.service.patch
|
||||
# PATCH-FIX-OPENSUSE fail2ban-fix-openssh98.patch meissner@suse.com -- support openssh9.8 bsc#1230101
|
||||
Patch302: fail2ban-fix-openssh98.patch
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module pyinotify >= 0.8.3}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module systemd}
|
||||
BuildRequires: %{python_module tools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: logrotate
|
||||
BuildRequires: python-rpm-macros
|
||||
BuildRequires: python3-setuptools
|
||||
BuildRequires: python3-tools
|
||||
# timezone package is required to run the tests
|
||||
BuildRequires: timezone
|
||||
Requires: cron
|
||||
@@ -65,10 +59,12 @@ Requires: python3 >= 3.5
|
||||
Requires: python3-setuptools
|
||||
Requires: whois
|
||||
BuildArch: noarch
|
||||
BuildRequires: python3-systemd
|
||||
BuildRequires: pkgconfig(systemd)
|
||||
Requires: python3-systemd
|
||||
Requires: systemd > 204
|
||||
%{?systemd_requires}
|
||||
BuildRequires: python3-pyinotify >= 0.8.3
|
||||
Requires: python3-pyinotify >= 0.8.3
|
||||
%if 0%{?suse_version} < 1600
|
||||
Obsoletes: SuSEfirewall2-%{name}
|
||||
@@ -126,12 +122,13 @@ sed -i -e 's|%{_datadir}/doc/%{name}|%{_docdir}/%{name}|' setup.py
|
||||
|
||||
%build
|
||||
export CFLAGS="%{optflags}"
|
||||
%pyproject_wheel
|
||||
python3 setup.py build
|
||||
gzip man/*.{1,5}
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%python_expand %fdupes %{buildroot}%{python3_sitelib}
|
||||
python3 setup.py install \
|
||||
--root=%{buildroot} \
|
||||
--prefix=%{_prefix}
|
||||
|
||||
install -d -m 755 %{buildroot}%{_mandir}/man{1,5}
|
||||
install -p -m 644 man/fail2ban-*.1.gz %{buildroot}%{_mandir}/man1
|
||||
@@ -153,21 +150,7 @@ install -p -m 644 %{SOURCE5} %{buildroot}%{_tmpfilesdir}/%{name}.conf
|
||||
|
||||
ln -sf service %{buildroot}%{_sbindir}/rc%{name}
|
||||
|
||||
install -d -m 755 %{buildroot}%{_sysconfdir}
|
||||
install -d -m 755 %{buildroot}%{_sysconfdir}/%{name}
|
||||
install -d -m 755 %{buildroot}%{_sysconfdir}/%{name}/action.d
|
||||
install -d -m 755 %{buildroot}%{_sysconfdir}/%{name}/fail2ban.d
|
||||
install -d -m 755 %{buildroot}%{_sysconfdir}/%{name}/filter.d
|
||||
install -d -m 755 %{buildroot}%{_sysconfdir}/%{name}/jail.d
|
||||
echo "# Do all your modifications to the jail's configuration in jail.local!" > %{buildroot}%{_sysconfdir}/%{name}/jail.local
|
||||
cp -av config/action.d/* %{buildroot}%{_sysconfdir}/%{name}/action.d
|
||||
cp -av config/filter.d/* %{buildroot}%{_sysconfdir}/%{name}/filter.d
|
||||
cp -av config/paths-common.conf %{buildroot}%{_sysconfdir}/%{name}
|
||||
cp -av config/paths-opensuse.conf %{buildroot}%{_sysconfdir}/%{name}
|
||||
cp -av config/fail2ban.conf %{buildroot}%{_sysconfdir}/%{name}
|
||||
cp -av config/jail.conf %{buildroot}%{_sysconfdir}/%{name}
|
||||
rm -rv %{buildroot}%{python3_sitelib}%{_sysconfdir}
|
||||
rm -rv %{buildroot}%{python3_sitelib}%{_docdir}/%{name}
|
||||
|
||||
install -d -m 0755 %{buildroot}%{_localstatedir}/lib/%{name}/
|
||||
|
||||
@@ -183,6 +166,13 @@ perl -i -lpe 's{(After|PartOf)=(.*)}{$1=$2 SuSEfirewall2.service}' \
|
||||
%endif
|
||||
install -D -m 755 files/nagios/check_fail2ban %{buildroot}%{nagios_plugindir}/check_%{name}
|
||||
|
||||
# install docs using the macro
|
||||
rm -r %{buildroot}%{_docdir}/%{name}
|
||||
|
||||
%python3_fix_shebang
|
||||
# remove duplicates
|
||||
%fdupes -s %{buildroot}%{python3_sitelib}
|
||||
|
||||
%check
|
||||
# tests require python-pyinotify to be installed, so don't run them on older versions
|
||||
%if 0%{?suse_version} >= 1500
|
||||
@@ -197,6 +187,8 @@ export LANG=en_US.UTF-8
|
||||
%post
|
||||
%fillup_only
|
||||
%tmpfiles_create %{_tmpfilesdir}/%{name}.conf
|
||||
# The next line is not workin in Leap 42.1, so keep the old way
|
||||
#%%tmpfiles_create %%{_tmpfilesdir}/%%{name}.conf
|
||||
%service_add_post %{name}.service
|
||||
|
||||
%preun
|
||||
|
Reference in New Issue
Block a user