1 |
# $Id$ |
2 |
|
3 |
# No debuginfo: |
4 |
%define debug_package %{nil} |
5 |
|
6 |
# If you want to debug, uncomment the next line and remove |
7 |
# the duplicate percent sign (due to macro expansion) |
8 |
#%%dump |
9 |
|
10 |
%define name rkhunter |
11 |
%define ver 1.3.2 |
12 |
%define rel 2 |
13 |
%define epoch 0 |
14 |
|
15 |
# Don't change this define or also: |
16 |
# 1. installer.sh --layout custom /temporary/dir/usr --striproot /temporary/dir --install |
17 |
# 2. rewrite the files section below. |
18 |
%define _prefix /usr |
19 |
|
20 |
# We can't let RPM do the dependencies automatic because it'll then pick up |
21 |
# a correct but undesirable perl dependency, which rkhunter does not require |
22 |
# in order to function properly. |
23 |
AutoReqProv: no |
24 |
|
25 |
Name: %{name} |
26 |
Summary: %{name} scans for rootkits, backdoors and local exploits |
27 |
Version: %{ver} |
28 |
Release: %{rel}%{dist} |
29 |
Epoch: %{epoch} |
30 |
License: GPL |
31 |
Group: Applications/System |
32 |
Source0: %{name}-%{version}.tar.gz |
33 |
Patch0: rkhunter-installer.patch |
34 |
Patch1: rkhunter-nolib.patch |
35 |
BuildArch: noarch |
36 |
Requires: filesystem, bash, grep, findutils, net-tools, coreutils, e2fsprogs, modutils, procps, binutils, wget, perl |
37 |
Provides: %{name} |
38 |
URL: http://rkhunter.sourceforge.net/ |
39 |
BuildRoot: %{_tmppath}/%{name}-%{version} |
40 |
|
41 |
%description |
42 |
Rootkit Hunter is a scanning tool to ensure you are about 99.9%% |
43 |
clean of nasty tools. It scans for rootkits, backdoors and local |
44 |
exploits by running tests like: |
45 |
- File hash check |
46 |
- Look for default files used by rootkits |
47 |
- Wrong file permissions for binaries |
48 |
- Look for suspected strings in LKM and KLD modules |
49 |
- Look for hidden files |
50 |
- Optional scan within plaintext and binary files |
51 |
- Software version checks |
52 |
- Application tests |
53 |
|
54 |
Rootkit Hunter is released as a GPL licensed project and free for everyone to use. |
55 |
|
56 |
|
57 |
%prep |
58 |
%setup -q |
59 |
%patch0 -p1 |
60 |
%patch1 -p1 |
61 |
|
62 |
%build |
63 |
|
64 |
%install |
65 |
MANPATH="" |
66 |
export MANPATH |
67 |
|
68 |
sh ./installer.sh --layout RPM --install |
69 |
|
70 |
sed -i 's_#ALLOWPROCLISTEN=/sbin/dhclient_ALLOWPROCLISTEN=/sbin/dhclient_' ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}.conf |
71 |
sed -i 's_#ALLOWPROCLISTEN=/usr/sbin/pppoe_ALLOWPROCLISTEN=/sbin/pppoe_' ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}.conf |
72 |
sed -i 's_#ALLOWHIDDENFILE=/usr/share/man/man1/..1.gz_ALLOWHIDDENFILE=/usr/share/man/man1/..1.gz_' ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}.conf |
73 |
sed -i '/#ALLOWPROCLISTEN=\/usr\/bin\/dhcpcd/iALLOWPROCLISTEN=\/usr\/sbin\/dhcpd' ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}.conf |
74 |
sed -i '/#ALLOWPROCDELFILE=\/usr\/sbin\/mysqld/aALLOWPROCDELFILE=\/usr\/sbin\/httpd' ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}.conf |
75 |
sed -i '/ALLOWPROCDELFILE=\/usr\/sbin\/httpd/aALLOWPROCDELFILE=\/usr\/sbin\/asterisk' ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}.conf |
76 |
sed -i '/ALLOWPROCDELFILE=\/usr\/sbin\/httpd/aALLOWPROCDELFILE=\/usr\/bin\/freshclam' ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}.conf |
77 |
|
78 |
# Make a cron.daily file to mail us the reports |
79 |
%{__mkdir} -p "${RPM_BUILD_ROOT}/%{_sysconfdir}/cron.daily" |
80 |
%{__cat} > "${RPM_BUILD_ROOT}/%{_sysconfdir}/cron.daily/01-rkhunter" <<EOF |
81 |
#!/bin/sh |
82 |
%{_bindir}/rkhunter --cronjob --update --disable apps,suspscan,system_commands --rwo |
83 |
exit 0 |
84 |
EOF |
85 |
%{__chmod} a+rwx,g-w,o-rwx ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily/01-rkhunter |
86 |
|
87 |
|
88 |
%post |
89 |
# Only do this on an initial install |
90 |
if [ $1 -eq 1 ]; then |
91 |
%{__cp} -p /etc/passwd /var/rkhunter/tmp >/dev/null 2>&1 || : |
92 |
%{__cp} -p /etc/group /var/rkhunter/tmp >/dev/null 2>&1 || : |
93 |
fi |
94 |
|
95 |
|
96 |
%preun |
97 |
# Only do this when removing the RPM |
98 |
if [ $1 -eq 0 ]; then |
99 |
%{__rm} -f /var/log/rkhunter.log /var/log/rkhunter.log.old >/dev/null 2>&1 |
100 |
%{__rm} -rf /var/rkhunter/* >/dev/null 2>&1 |
101 |
fi |
102 |
|
103 |
|
104 |
%clean |
105 |
if [ "$RPM_BUILD_ROOT" = "/" ]; then |
106 |
echo Invalid Build root \'"$RPM_BUILD_ROOT"\' |
107 |
exit 1 |
108 |
else |
109 |
rm -rf $RPM_BUILD_ROOT |
110 |
fi |
111 |
|
112 |
|
113 |
%define docdir %{_prefix}/share/doc/%{name}-%{version} |
114 |
%files |
115 |
%defattr(-,root,root) |
116 |
%attr(640,root,root) %config(noreplace) %{_sysconfdir}/%{name}.conf |
117 |
%attr(750,root,root) %{_prefix}/bin/%{name} |
118 |
%attr(750,root,root) %dir %{_libdir}/%{name} |
119 |
%attr(750,root,root) %dir %{_libdir}/%{name}/scripts |
120 |
%attr(750,root,root) %{_libdir}/%{name}/scripts/*.pl |
121 |
%attr(750,root,root) %{_libdir}/%{name}/scripts/*.sh |
122 |
%attr(644,root,root) %doc %{_prefix}/share/man/man8/%{name}.8.gz |
123 |
%attr(755,root,root) %dir %{docdir} |
124 |
%attr(644,root,root) %doc %{docdir}/* |
125 |
%attr(750,root,root) %dir %{_var}/%{name} |
126 |
%attr(750,root,root) %dir %{_var}/%{name}/db |
127 |
%attr(640,root,root) %{_var}/%{name}/db/*.dat |
128 |
%attr(750,root,root) %dir %{_var}/%{name}/db/i18n |
129 |
%attr(640,root,root) %{_var}/%{name}/db/i18n/* |
130 |
%attr(750,root,root) %dir %{_var}/%{name}/tmp |
131 |
%{_sysconfdir}/cron.daily/01-rkhunter |
132 |
|
133 |
|
134 |
%changelog |
135 |
* Sun Mar 2 2008 Shad L. Lords <slords@mail.com> 1.3.2-2 |
136 |
- Allow freshclam to use deleted files. [SME: 3876] |
137 |
|
138 |
* Fri Feb 29 2008 Shad L. Lords <slords@mail.com> 1.3.2-1 |
139 |
- Update to rkhunter v1.3.2 [SME: 4000] |
140 |
|
141 |
* Wed Jan 30 2008 Shad L. Lords <slords@mail.com> 1.3.0-6 |
142 |
- Fix asterisk to allow deleted files. [SME: 3795] |
143 |
|
144 |
* Tue Jan 29 2008 Shad L. Lords <slords@mail.com> 1.3.0-5 |
145 |
- Correct pppoe binary location. |
146 |
- Add asterisk binary to allow deleted files. [SME: 3795] |
147 |
|
148 |
* Mon Jan 7 2008 Shad L. Lords <slords@mail.com> 1.3.0-4 |
149 |
- Disable scan for suspicious files until fixed [SME: 3713] |
150 |
|
151 |
* Mon Dec 17 2007 Shad L. Lords <slords@mail.com> 1.3.0-3 |
152 |
- Change /var/lib to /var to be consistent with previous versions |
153 |
|
154 |
* Mon Dec 17 2007 Shad L. Lords <slords@mail.com> 1.3.0-2 |
155 |
- Add a few more services for sme tests |
156 |
|
157 |
* Mon Dec 17 2007 Shad L. Lords <slords@mail.com> 1.3.0-1 |
158 |
- Fix installer to not install in local |
159 |
- Set parameters for sme specific tests |
160 |
|
161 |
* Sun Feb 11 2007 unSpawn - pre-1.3.0 |
162 |
- Sync spec with fixes, installer and CVS |
163 |
|
164 |
* Sun Nov 12 2006 unSpawn - 1.2.9 |
165 |
- Re-spec, new installer |
166 |
|
167 |
* Fri Sep 29 2006 unSpawn - 1.2.9 |
168 |
- Updated for release 1.2.9 |
169 |
|
170 |
* Tue Aug 10 2004 Michael Boelen - 1.1.5 |
171 |
- Added update script |
172 |
- Extended description |
173 |
|
174 |
* Sun Aug 08 2004 Greg Houlette - 1.1.5 |
175 |
- Changed the install procedure eliminating the specification of |
176 |
destination filenames (only needed if you are renaming during install) |
177 |
- Changed the permissions for documentation files (root only overkill) |
178 |
- Added the installation of the rkhunter Man Page |
179 |
- Added the installation of the programs_{bad, good}.dat database files |
180 |
- Added the installation of the LICENSE documentation file |
181 |
- Added the chmod for root only to the /var/rkhunter/db directory |
182 |
|
183 |
* Sun May 23 2004 Craig Orsinger (cjo) <cjorsinger@earthlink.net> |
184 |
- version 1.1.0-1.cjo |
185 |
- changed installation in accordance with new rootkit installation |
186 |
procedure |
187 |
- changed installation root to conform to LSB. Use standard macros. |
188 |
- added recursive remove of old build root as prep for install phase |
189 |
|
190 |
* Wed Apr 28 2004 Doncho N. Gunchev - 1.0.9-0.mr700 |
191 |
- dropped Requires: perl - rkhunter works without it |
192 |
- dropped the bash alignpatch (check the source or contact me) |
193 |
- various file mode fixes (.../tmp/, *.db) |
194 |
- optimized the %%files section - any new files in the |
195 |
current dirs will be fine - just %%{__install} them. |
196 |
|
197 |
* Mon Apr 26 2004 Michael Boelen - 1.0.8-0 |
198 |
- Fixed missing md5blacklist.dat |
199 |
|
200 |
* Mon Apr 19 2004 Doncho N. Gunchev - 1.0.6-1.mr700 |
201 |
- added missing /usr/local/rkhunter/db/md5blacklist.dat |
202 |
- patched to align results in --cronjob, I think rpm based |
203 |
distros have symlink /bin/sh -> /bin/bash |
204 |
- added --with/--without alignpatch for conditional builds |
205 |
(in case previous patch breaks something) |
206 |
|
207 |
* Sat Apr 03 2004 Michael Boelen / Joe Klemmer - 1.0.6-0 |
208 |
- Update to 1.0.6 |
209 |
|
210 |
* Mon Mar 29 2004 Doncho N. Gunchev - 1.0.0-0 |
211 |
- initial .spec file |
212 |
|
213 |
|