diff --git a/fail2ban.changes b/fail2ban.changes
index f1e5d54..800372d 100644
--- a/fail2ban.changes
+++ b/fail2ban.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Mon Feb 26 08:17:28 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
+
+- Use %patch -P N instead of deprecated %patchN.
+
 -------------------------------------------------------------------
 Mon Jun  5 16:36:47 UTC 2023 - Lars Vogdt <lars@linux-schulserver.de>
 
diff --git a/fail2ban.spec b/fail2ban.spec
index dac3dd1..a50b44e 100644
--- a/fail2ban.spec
+++ b/fail2ban.spec
@@ -130,16 +130,16 @@ install -m644 %{SOURCE8} config/paths-opensuse.conf
 # Use openSUSE paths
 sed -i -e 's/^before = paths-.*/before = paths-opensuse.conf/' config/jail.conf
 
-%patch100 -p1
-%patch101 -p1
+%patch -P 100 -p1
+%patch -P 101 -p1
 %if 0%{?suse_version} < 1310
-%patch200 -p1
+%patch -P 200 -p1
 %endif
-%patch201 -p1
+%patch -P 201 -p1
 %if !0%{?suse_version} > 1500
-%patch300 -p1
+%patch -P 300 -p1
 %endif
-%patch301 -p1
+%patch -P 301 -p1
 
 rm 	config/paths-arch.conf \
 	config/paths-debian.conf \