Hello all
I've created an rpm for DenyHosts http://denyhosts.sourceforge.net/
which I find pretty useful. A brief synopsis first:
Summary: DenyHosts is a utility to help sys admins thwart ssh hackers
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.
I'm pretty inexperienced at rpm building, still learning really, and I was
wondering if someone could take a look at the source rpm I've created and let
me know if it's ok. You can find it here:
http://www.craigmillar.org/DenyHosts-2.4b-5.src.rpm
I'm attaching the spec file at the end of this message as well.
My main concern with the spec file is that I'd like the main executable to be
renamed denyhosts from denyhosts.py. I tried the following lines:
ln -sf ../../usr/bin/denyhosts.py $RPM_BUILD_ROOT%_prefix/bin/denyhosts
This works - but results in denyhosts and denyhosts.py in /usr/bin, so this
is in the linked to version.
mv ../../usr/bin/denyhosts.py $RPM_BUILD_ROOT%_prefix/bin/denyhosts
This doesn't work at all, which baffles me somewhat, as it's referencing the
same directory. Bah.
Finally, if this package is considered useful, how do I go about submitting
it for wider use? I can't promise to maintain it, but I think it's a pretty
nifty tool that would be of benefit to others.
Thanks for any responses
Craig
%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 <[EMAIL PROTECTED]>
Packager: Craig Millar <[EMAIL PROTECTED]>
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 - [EMAIL PROTECTED]
- Added logrotate script
* Wed Apr 19 2006 - [EMAIL PROTECTED]
- Updated version to version 2.4b - patch still necessary
* Tue Mar 28 2006 - [EMAIL PROTECTED]
- Updated version to version 2.2 - patch still necessary
* Mon Mar 13 2006 - [EMAIL PROTECTED]
- 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
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]