packages: DenyHosts/DenyHosts.spec, DenyHosts/silentpurge.patch (NEW) - do ...

glen glen at pld-linux.org
Thu Apr 1 08:21:40 CEST 2010


Author: glen                         Date: Thu Apr  1 06:21:40 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- do not flood log every minute with purge messages
- use macros for python cleanup
- replace env shebang with python one
- rel 5

---- Files affected:
packages/DenyHosts:
   DenyHosts.spec (1.29 -> 1.30) , silentpurge.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/DenyHosts/DenyHosts.spec
diff -u packages/DenyHosts/DenyHosts.spec:1.29 packages/DenyHosts/DenyHosts.spec:1.30
--- packages/DenyHosts/DenyHosts.spec:1.29	Fri Mar 13 16:36:45 2009
+++ packages/DenyHosts/DenyHosts.spec	Thu Apr  1 08:21:35 2010
@@ -3,14 +3,15 @@
 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
@@ -43,24 +44,27 @@
 
 %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
 
@@ -97,6 +101,12 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.30  2010/04/01 06:21:35  glen
+- do not flood log every minute with purge messages
+- use macros for python cleanup
+- replace env shebang with python one
+- rel 5
+
 Revision 1.29  2009/03/13 15:36:45  hawk
 - release 4
 
@@ -160,7 +170,7 @@
 - up to 1.0.1
 
 Revision 1.9  2005/07/29 22:02:03  zbyniu
-- - BR: python-modules, rpm-pythonprov; spaces -> tabs
+- BR: python-modules, rpm-pythonprov; spaces -> tabs
 
 Revision 1.8  2005/07/29 10:08:42  darekr
 - fixed perms for init script

================================================================
Index: packages/DenyHosts/silentpurge.patch
diff -u /dev/null packages/DenyHosts/silentpurge.patch:1.1
--- /dev/null	Thu Apr  1 08:21:40 2010
+++ packages/DenyHosts/silentpurge.patch	Thu Apr  1 08:21:35 2010
@@ -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)
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/DenyHosts/DenyHosts.spec?r1=1.29&r2=1.30&f=u



More information about the pld-cvs-commit mailing list