--- rpms/rkhunter/sme7/rkhunter.spec 2007/06/12 17:18:18 1.1 +++ rpms/rkhunter/sme7/rkhunter.spec 2008/02/29 19:45:05 1.10 @@ -1,27 +1,46 @@ +# No debuginfo: +%define debug_package %{nil} + +# If you want to debug, uncomment the next line and remove +# the duplicate percent sign (due to macro expansion) +#%%dump + +%define name rkhunter +%define ver 1.3.2 +%define rel 1 +%define epoch 0 + +# Don't change this define or also: +# 1. installer.sh --layout custom /temporary/dir/usr --striproot /temporary/dir --install +# 2. rewrite the files section below. +%define _prefix /usr + # We can't let RPM do the dependencies automatic because it'll then pick up # a correct but undesirable perl dependency, which rkhunter does not require # in order to function properly. AutoReqProv: no -Summary: Rootkit scans for rootkits, backdoors and local exploits. -Name: rkhunter -Version: 1.2.9 -Release: 3%{?dist} -Epoch: 0 -License: GPL -Group: Applications/System -URL: http://rkhunter.sourceforge.net/ -Source0: %{name}-%{version}.tar.gz -Patch0: rkhunter-sme7.patch -BuildArch: noarch -Requires: /bin/sh, /bin/ps, /bin/ls, /bin/cat, /bin/egrep, /usr/bin/strings -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Name: %{name} +Summary: %{name} scans for rootkits, backdoors and local exploits +Version: %{ver} +Release: %{rel}%{dist} +Epoch: %{epoch} +License: GPL +Group: Applications/System +Source0: %{name}-%{version}.tar.gz +Patch0: rkhunter-installer.patch +Patch1: rkhunter-nolib.patch +BuildArch: noarch +Requires: filesystem, bash, grep, findutils, net-tools, coreutils, e2fsprogs, modutils, procps, binutils, wget, perl +Provides: %{name} +URL: http://rkhunter.sourceforge.net/ +BuildRoot: %{_tmppath}/%{name}-%{version} %description -Rootkit scanner is scanning tool to ensure you for about 99.9%% you're -clean of nasty tools. This tool scans for rootkits, backdoors and local +Rootkit Hunter is a scanning tool to ensure you are about 99.9%% +clean of nasty tools. It scans for rootkits, backdoors and local exploits by running tests like: - - MD5 hash compare + - File hash check - Look for default files used by rootkits - Wrong file permissions for binaries - Look for suspected strings in LKM and KLD modules @@ -34,155 +53,113 @@ Rootkit Hunter is released as a GPL lice %prep -%setup -%patch -p1 +%setup -q +%patch0 -p1 +%patch1 -p1 %build -#%%configure ... -# We have nothing to configure... yet... %install -# Well... This could be a bit smaller if the install -# script was able to handle DSTDIR for example... - -# (cjo) remove old version of build root, if it exists -%{__rm} -rf ${RPM_BUILD_ROOT} +MANPATH="" +export MANPATH -%{__mkdir} -p ${RPM_BUILD_ROOT}%{_bindir} -%{__mkdir} -p ${RPM_BUILD_ROOT}%{_sysconfdir} -%{__mkdir} -p ${RPM_BUILD_ROOT}%{_libdir} -%{__mkdir} -p ${RPM_BUILD_ROOT}%{_libdir}/rkhunter/scripts -%{__mkdir} -p ${RPM_BUILD_ROOT}%{_docdir}/rkhunter-%{version} -%{__mkdir} -p ${RPM_BUILD_ROOT}%{_mandir}/man8 -%{__mkdir} -p ${RPM_BUILD_ROOT}%{_var}/rkhunter/{db,tmp} -%{__chmod} ug+rwx,o-rwx ${RPM_BUILD_ROOT}%{_var}/rkhunter/tmp - -%{__install} -m750 -p files/rkhunter ${RPM_BUILD_ROOT}%{_bindir}/ - -%{__install} -m640 -p files/backdoorports.dat ${RPM_BUILD_ROOT}%{_var}/rkhunter/db/ -%{__install} -m640 -p files/defaulthashes.dat ${RPM_BUILD_ROOT}%{_var}/rkhunter/db/ -%{__install} -m640 -p files/mirrors.dat ${RPM_BUILD_ROOT}%{_var}/rkhunter/db/ -%{__install} -m640 -p files/os.dat ${RPM_BUILD_ROOT}%{_var}/rkhunter/db/ -%{__install} -m640 -p files/md5blacklist.dat ${RPM_BUILD_ROOT}%{_var}/rkhunter/db/ -%{__install} -m640 -p files/programs_bad.dat ${RPM_BUILD_ROOT}%{_var}/rkhunter/db/ -%{__install} -m640 -p files/programs_good.dat ${RPM_BUILD_ROOT}%{_var}/rkhunter/db/ - -%{__install} -m644 -p files/CHANGELOG ${RPM_BUILD_ROOT}%{_docdir}/rkhunter-%{version}/ -%{__install} -m644 -p files/LICENSE ${RPM_BUILD_ROOT}%{_docdir}/rkhunter-%{version}/ -%{__install} -m644 -p files/README ${RPM_BUILD_ROOT}%{_docdir}/rkhunter-%{version}/ -%{__install} -m644 -p files/WISHLIST ${RPM_BUILD_ROOT}%{_docdir}/rkhunter-%{version}/ -%{__install} -m644 -p files/development/*.8 ${RPM_BUILD_ROOT}%{_mandir}/man8/ - -%{__install} -m750 -p files/check_modules.pl ${RPM_BUILD_ROOT}%{_libdir}/rkhunter/scripts/ -%{__install} -m750 -p files/check_port.pl ${RPM_BUILD_ROOT}%{_libdir}/rkhunter/scripts/ -%{__install} -m750 -p files/filehashmd5.pl ${RPM_BUILD_ROOT}%{_libdir}/rkhunter/scripts/ -%{__install} -m750 -p files/filehashsha1.pl ${RPM_BUILD_ROOT}%{_libdir}/rkhunter/scripts/ -%{__install} -m750 -p files/showfiles.pl ${RPM_BUILD_ROOT}%{_libdir}/rkhunter/scripts/ -%{__install} -m750 -p files/check_update.sh ${RPM_BUILD_ROOT}%{_libdir}/rkhunter/scripts/ - -# (cjo) Put installation root in configuration file, then copy the rest -# of the file from the original. -cat >> ${RPM_BUILD_ROOT}%{_sysconfdir}/rkhunter.conf << EOF -## Next three lines installed automatically by RPM. Do not change -## unless you know what you're doing... -INSTALLDIR=%{_prefix} -DBDIR=%{_var}/rkhunter/db -TMPDIR=%{_var}/rkhunter/tmp - -EOF +sh ./installer.sh --layout RPM --install -cat files/rkhunter.conf >> ${RPM_BUILD_ROOT}%{_sysconfdir}/rkhunter.conf -%{__chmod} 640 ${RPM_BUILD_ROOT}%{_sysconfdir}/rkhunter.conf +sed -i 's_#ALLOWPROCLISTEN=/sbin/dhclient_ALLOWPROCLISTEN=/sbin/dhclient_' ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}.conf +sed -i 's_#ALLOWPROCLISTEN=/usr/sbin/pppoe_ALLOWPROCLISTEN=/sbin/pppoe_' ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}.conf +sed -i 's_#ALLOWHIDDENFILE=/usr/share/man/man1/..1.gz_ALLOWHIDDENFILE=/usr/share/man/man1/..1.gz_' ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}.conf +sed -i '/#ALLOWPROCLISTEN=\/usr\/bin\/dhcpcd/iALLOWPROCLISTEN=\/usr\/sbin\/dhcpd' ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}.conf +sed -i '/#ALLOWPROCDELFILE=\/usr\/sbin\/mysqld/aALLOWPROCDELFILE=\/usr\/sbin\/httpd' ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}.conf +sed -i '/ALLOWPROCDELFILE=\/usr\/sbin\/httpd/aALLOWPROCDELFILE=\/usr\/sbin\/asterisk' ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}.conf -# Only root should use rkhunter (at least for now) -%{__chmod} o-rwx -R ${RPM_BUILD_ROOT}%{_libdir}/rkhunter -%{__chmod} o-rwx -R ${RPM_BUILD_ROOT}%{_var}/rkhunter/db - -# make a cron.daily file to mail us the reports +# Make a cron.daily file to mail us the reports %{__mkdir} -p "${RPM_BUILD_ROOT}/%{_sysconfdir}/cron.daily" %{__cat} > "${RPM_BUILD_ROOT}/%{_sysconfdir}/cron.daily/01-rkhunter" < -- Clean up spec so package can be built by koji/plague +%post +# Only do this on an initial install +if [ $1 -eq 1 ]; then + %{__cp} -p /etc/passwd /var/rkhunter/tmp >/dev/null 2>&1 || : + %{__cp} -p /etc/group /var/rkhunter/tmp >/dev/null 2>&1 || : +fi -* Wed Mar 07 2007 Shad L. Lords 1.2.9-3 -- Add sigs for 7.1.2 and 7.1.3 -* Sun Jan 28 2007 Shad L. Lords 1.2.9-2 -- Run updates as part of build process +%preun +# Only do this when removing the RPM +if [ $1 -eq 0 ]; then + %{__rm} -f /var/log/rkhunter.log /var/log/rkhunter.log.old >/dev/null 2>&1 + %{__rm} -rf /var/rkhunter/* >/dev/null 2>&1 +fi -* Sun Jan 28 2007 Shad L. Lords 1.2.9-1 -- Update to latest 1.2.9 -* Tue Dec 12 2006 Shad L. Lords 1.2.8-4 -- Add strings as a requirement. [SME: 2267] - -* Tue Dec 12 2006 Shad L. Lords 1.2.8-3 -- Added 7.1 +%clean +if [ "$RPM_BUILD_ROOT" = "/" ]; then + echo Invalid Build root \'"$RPM_BUILD_ROOT"\' + exit 1 +else + rm -rf $RPM_BUILD_ROOT +fi -* Thu Dec 07 2006 Shad L. Lords 1.2.8-2 -- Update to new release naming. No functional changes. -- Make Packager generic -* Sun Nov 12 2006 Shad L. Lords 1.2.8-1sme01 -- Updated to latest 1.2.8 +%define docdir %{_prefix}/share/doc/%{name}-%{version} +%files +%defattr(-,root,root) +%attr(640,root,root) %config(noreplace) %{_sysconfdir}/%{name}.conf +%attr(750,root,root) %{_prefix}/bin/%{name} +%attr(750,root,root) %dir %{_libdir}/%{name} +%attr(750,root,root) %dir %{_libdir}/%{name}/scripts +%attr(750,root,root) %{_libdir}/%{name}/scripts/*.pl +%attr(750,root,root) %{_libdir}/%{name}/scripts/*.sh +%attr(644,root,root) %doc %{_prefix}/share/man/man8/%{name}.8.gz +%attr(755,root,root) %dir %{docdir} +%attr(644,root,root) %doc %{docdir}/* +%attr(750,root,root) %dir %{_var}/%{name} +%attr(750,root,root) %dir %{_var}/%{name}/db +%attr(640,root,root) %{_var}/%{name}/db/*.dat +%attr(750,root,root) %dir %{_var}/%{name}/db/i18n +%attr(640,root,root) %{_var}/%{name}/db/i18n/* +%attr(750,root,root) %dir %{_var}/%{name}/tmp +%{_sysconfdir}/cron.daily/01-rkhunter -* Wed Feb 22 2006 Gordon Rowell 1.2.7-1sme07 -- Added 7.0pre[45] and 7.0prc3 [SME: 860 -* Mon Feb 20 2006 Gordon Rowell 1.2.7-1sme06 -- Added 7.0pre3 [SME: 845] +%changelog +* Fri Feb 29 2008 Shad L. Lords 1.3.2-1 +- Update to rkhunter v1.3.2 [SME: 4000] -* Sat Feb 4 2006 Gordon Rowell 1.2.7-1sme05 -- Added 7.0pre2 [SME: 653] +* Wed Jan 30 2008 Shad L. Lords 1.3.0-6 +- Fix asterisk to allow deleted files. [SME: 3795] -* Mon Jan 9 2006 Gordon Rowell 1.2.7-1sme04 -- Remove explicit call to /bin/mail from rkhunter daily cron job. If - there's no output, we don't want any mail either [SME: 421] +* Tue Jan 29 2008 Shad L. Lords 1.3.0-5 +- Correct pppoe binary location. +- Add asterisk binary to allow deleted files. [SME: 3795] -* Mon Jan 9 2006 Gordon Rowell 1.2.7-1sme03 -- Fix up format of os.dat entries. rkhunter knows about - /etc/e-smith-release [SME: 384] +* Mon Jan 7 2008 Shad L. Lords 1.3.0-4 +- Disable scan for suspicious files until fixed [SME: 3713] -* Mon Jan 9 2006 Gordon Rowell 1.2.7-1sme02 -- And add support for 7.0pre1 [SME: 384] +* Mon Dec 17 2007 Shad L. Lords 1.3.0-3 +- Change /var/lib to /var to be consistent with previous versions -* Mon Jan 9 2006 Gordon Rowell 1.2.7-1sme01 -- Add support for 7.0beta9, rc[12] and final [SME: 384] +* Mon Dec 17 2007 Shad L. Lords 1.3.0-2 +- Add a few more services for sme tests -* Wed Nov 09 2005 Charlie Brady 1.2.7-1es2 -- Add support for CentOS 4.{1,2,3} +* Mon Dec 17 2007 Shad L. Lords 1.3.0-1 +- Fix installer to not install in local +- Set parameters for sme specific tests -* Fri Jul 15 2005 Charlie Brady - 1.2.7-1es -- Upgrade to 1.2.7 +* Sun Feb 11 2007 unSpawn - pre-1.3.0 +- Sync spec with fixes, installer and CVS -* Sun Jun 05 2005 Charlie Brady - 1.2.6-2es -- Make cron job quieter -- Add SME6.1 and SME7 as recognised OSes. +* Sun Nov 12 2006 unSpawn - 1.2.9 +- Re-spec, new installer -* Tue May 10 2005 Charlie Brady - 1.2.6 -- Update to 1.2.6 +* Fri Sep 29 2006 unSpawn - 1.2.9 +- Updated for release 1.2.9 * Tue Aug 10 2004 Michael Boelen - 1.1.5 - Added update script @@ -227,3 +204,4 @@ EOF * Mon Mar 29 2004 Doncho N. Gunchev - 1.0.0-0 - initial .spec file +