%define name DenyHosts %define version 2.4b %define release 5 Summary: DenyHosts is a utility to help sys admins thwart ssh hackers Name: %{name} Version: %{version} Release: %{release} Source0: %{name}-%{version}.tar.gz Source1: denyhosts.init Source2: logrotate.denyhosts License: GPL v2 Provides: denyhosts Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-buildroot Prefix: %{_prefix} BuildArchitectures: noarch Vendor: Phil Schwartz Packager: Craig Millar Url: http://denyhosts.sourceforge.net Distribution: %(head -1 /etc/SuSE-release) Patch0: %name-%version-env.diff Patch1: %name-%version-conf.diff Requires: python BuildRequires: bash python python-devel rpm rpm-python BuildRequires: gzip popt popt-devel zlib zlib-devel %description DenyHosts is a python program that automatically blocks ssh attacks by adding entries to /etc/hosts.deny. DenyHosts will also inform Linux administrators about offending hosts, attacked users and suspicious logins. %prep %setup %patch0 -p0 %patch1 -p0 %build python setup.py build %install python setup.py install --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES mkdir -p $RPM_BUILD_ROOT%_prefix/bin mkdir -p $RPM_BUILD_ROOT%_prefix/sbin mkdir -p $RPM_BUILD_ROOT/%_sysconfdir/init.d install -m 754 $RPM_SOURCE_DIR/denyhosts.init \ $RPM_BUILD_ROOT/%_sysconfdir/init.d/denyhosts ln -sf ../../etc/init.d/denyhosts $RPM_BUILD_ROOT/%_prefix/sbin/rcdenyhosts ln -sf ../../usr/bin/denyhosts.py $RPM_BUILD_ROOT%_prefix/bin/denyhosts install -m 644 $RPM_BUILD_ROOT/usr/share/denyhosts/denyhosts.cfg-dist $RPM_BUILD_ROOT/%_sysconfdir/denyhosts.conf install -d $RPM_BUILD_ROOT/etc/logrotate.d install -m 644 $RPM_SOURCE_DIR/logrotate.denyhosts \ $RPM_BUILD_ROOT/%_sysconfdir/logrotate.d/denyhosts %clean rm -rf $RPM_BUILD_ROOT %files -f INSTALLED_FILES %defattr(-,root,root) %attr (0754,root,root) %config %_sysconfdir/init.d/denyhosts %attr (0755,root,root) %_prefix/bin/denyhosts %attr (0755,root,root) %_prefix/sbin/rcdenyhosts %attr (0644,root,root) %config(noreplace) %_sysconfdir/denyhosts.conf %attr (0644,root,root) %config %_sysconfdir/logrotate.d/denyhosts %changelog -n DenyHosts * Fri May 05 2006 - me@craigmillar.org - Added logrotate script * Wed Apr 19 2006 - me@craigmillar.org - Updated version to version 2.4b - patch still necessary * Tue Mar 28 2006 - me@craigmillar.org - Updated version to version 2.2 - patch still necessary * Mon Mar 13 2006 - me@craigmillar.org - Add patch to change /bin/env to /usr/bin/env in restricted_from_invalid.py and restricted_from_passwd.py - Patch to make default config file more SUSE friendly and place it in /etc - Created init.d script to run the daemon and /usr/sbin/rcdenyhosts symlink