]> git.pld-linux.org Git - packages/DenyHosts.git/commitdiff
- do not flood log every minute with purge messages auto/th/DenyHosts-2_6-5
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 1 Apr 2010 06:21:35 +0000 (06:21 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- use macros for python cleanup
- replace env shebang with python one
- rel 5

Changed files:
    DenyHosts.spec -> 1.30
    silentpurge.patch -> 1.1

DenyHosts.spec
silentpurge.patch [new file with mode: 0644]

index b1882167ba720b9fd6e9a781d1b320b96fa2c5bc..ec2cecc8d984804ebf312ebd3a030d4d63135bce 100644 (file)
@@ -2,14 +2,15 @@ Summary:      Script to help thwart SSH server attacks
 Summary(pl.UTF-8):     Skrypt do blokowania ataków na serwery SSH
 Name:          DenyHosts
 Version:       2.6
-Release:       4
+Release:       5
 License:       GPL v2
 Group:         Applications/System
-Source0:       http://dl.sourceforge.net/denyhosts/%{name}-%{version}.tar.gz
+Source0:       http://downloads.sourceforge.net/denyhosts/%{name}-%{version}.tar.gz
 # Source0-md5: fc2365305a9402886a2b0173d1beb7df
 Source1:       %{name}.cron
 Source2:       %{name}.cfg
 Source3:       %{name}.init
+Patch0:                silentpurge.patch
 URL:           http://www.denyhosts.net/
 BuildRequires: python-devel >= 1:2.5
 BuildRequires: python-modules
@@ -42,24 +43,27 @@ próbom włamania przez odcięcie włamywaczom dostępu do serwera.
 
 %prep
 %setup -q
+%patch0 -p1
+
+grep -r '/usr/bin/env python' -l . | xargs %{__sed} -i -e 's,/usr/bin/env python,%{__python},'
 
 %build
 echo 'VERSION="%{version}"' > version.py
-python setup.py build
+%{__python} setup.py build
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{%{_sysconfdir},/etc/cron.d,/etc/rc.d/init.d,%{_sbindir},/var/lib/%{name}}
-
-python setup.py install \
+%{__python} setup.py install \
        --root=$RPM_BUILD_ROOT \
        --optimize=2
 
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.d/%{name}
-install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}
-install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+%py_postclean
+
+cp -a %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.d/%{name}
+cp -a %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}
+install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
 mv $RPM_BUILD_ROOT%{_datadir}/denyhosts/daemon-control-dist $RPM_BUILD_ROOT%{_sbindir}/%{name}ctl
-rm $RPM_BUILD_ROOT%{py_sitescriptdir}/%{name}/*.py
 rm -r $RPM_BUILD_ROOT%{_datadir}/denyhosts
 echo "127.0.0.1" > $RPM_BUILD_ROOT/var/lib/%{name}/allowed-hosts
 
diff --git a/silentpurge.patch b/silentpurge.patch
new file mode 100644 (file)
index 0000000..ee789ce
--- /dev/null
@@ -0,0 +1,20 @@
+--- DenyHosts-2.6/DenyHosts/denyfileutil.py~   2006-04-20 06:44:58.000000000 +0300
++++ DenyHosts-2.6/DenyHosts/denyfileutil.py    2010-04-01 09:18:00.449710314 +0300
+@@ -137,7 +137,7 @@
+         self.cutoff = long(time.time()) - cutoff
+         debug("relative cutoff: %ld (seconds)", cutoff)
+         debug("absolute cutoff: %ld (epoch)", self.cutoff)
+-        info("purging entries older than: %s",
++        debug("purging entries older than: %s",
+              time.asctime(time.localtime(self.cutoff)))
+         
+         self.backup()
+@@ -153,7 +153,7 @@
+         else:
+             self.remove_temp()
+             
+-        info("num entries purged: %d", num_purged)
++        debug("num entries purged: %d", num_purged)
+         plugin_purge = prefs.get('PLUGIN_PURGE')
+         if plugin_purge:
+             plugin.execute(plugin_purge, purged_hosts)
This page took 0.125161 seconds and 4 git commands to generate.