File rkhunter.spec of Package rkhunter
%define realname rkhunter
%define realver 1.4.6
%define srcext tar.gz
# Common info
Name: %{realname}
Version: %{realver}
Release: wiz%{?extraver:0.}1%{?dist}
License: GPL-2.0
Group: Productivity/Security
URL: http://rkhunter.sourceforge.net/
Summary: The Rootkit Hunter
# Install-time parameters
Requires: perl%{?suse_version:-base}
# Build-time parameters
BuildRoot: %{_tmppath}/%{name}-root
BuildArch: noarch
Source: http://sourceforge.net/projects/rkhunter/files/%{realname}/%{realver}/%{realname}-%{realver}%{?extraver}.%{srcext}
%description
Rootkit Hunter (RKH) is an easy-to-use tool which checks computers running
UNIX (clones) for the presence of rootkits and other unwanted tools.
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}
%{__sed} -i '/PREFIX=/ s|/usr/local|%{_prefix}|' installer.sh
%build
%install
./installer.sh --layout RPM --install
%{__rm} -rf %{buildroot}%{_datadir}/doc/%{realname}-%{realver}
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
%files
%defattr(-,root,root)
%doc files/ACKNOWLEDGMENTS files/CHANGELOG files/FAQ files/LICENSE files/README
%config(noreplace) %{_sysconfdir}/rkhunter.conf
%{_bindir}/rkhunter
%dir %{_libdir}/rkhunter/scripts
%dir %{_libdir}/rkhunter
%{_libdir}/rkhunter/scripts/*
%dir %{_localstatedir}/lib/rkhunter/db/i18n
%dir %{_localstatedir}/lib/rkhunter/db/signatures
%dir %{_localstatedir}/lib/rkhunter/db
%dir %{_localstatedir}/lib/rkhunter/tmp
%dir %{_localstatedir}/lib/rkhunter
%{_localstatedir}/lib/rkhunter/db/i18n/*
%{_localstatedir}/lib/rkhunter/db/signatures/*.ldb
%{_localstatedir}/lib/rkhunter/db/*.dat
%doc %{_mandir}/man8/rkhunter.8*
%changelog