]> git.pld-linux.org Git - SPECS.git/blob - samhain.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / samhain.spec
1 #
2 # Conditional build:
3 %bcond_with     prelude         # enables samhain working as a prelude sensor
4 #
5 Summary:        Samhain data integrity / intrusion detection system
6 Summary(pl.UTF-8):      System kontroli integralności danych i wykrywania intruzów Samhain
7 Name:           samhain
8 Version:        2.8.3a
9 Release:        1
10 License:        GPL v2+
11 Group:          Applications/System
12 Source0:        http://www.la-samhna.de/samhain/%{name}-current.tar.gz
13 # Source0-md5:  9885c093ab7e8d63be9ed6aaedf28138
14 Source1:        %{name}.init
15 Source2:        %{name}rc
16 Patch0:         %{name}-configure.patch
17 URL:            http://www.la-samhna.de/samhain/
18 BuildRequires:  automake
19 %{!?with_prelude:BuildRequires: libprelude-devel >= 0.9.6}
20 BuildRequires:  procps
21 Requires(post,preun):   /sbin/chkconfig
22 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24 %description
25 Samhain works by creating a "snapshot" of your system, i.e. a database
26 of cryptographic checksums of all critical files, and comparing these
27 files regularly against this database.
28
29 %description -l pl.UTF-8
30 Samhain działa tworząc "obraz" twojego systemu, tj. bazę danych sum
31 kontrolnych wszystkich krytycznych plików, a następnie regularnie
32 porównuje te pliki z bazą.
33
34 %prep
35 %setup -qc
36 tar zxf %{name}-%{version}.tar.gz -C ..
37 %patch0 -p1
38
39 %build
40 cp -f /usr/share/automake/config.sub .
41 %configure \
42         --enable-login-watch \
43         --enable-mounts-check \
44         --enable-ptrace \
45         --enable-suidcheck \
46         --with%{!?with_prelude:out}-prelude \
47
48 %{__make}
49
50 # sstrip breaks ELFs
51 echo ':' > sstrip
52
53 %install
54 rm -rf $RPM_BUILD_ROOT
55 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
56         $RPM_BUILD_ROOT%{_var}/lib/%{name} \
57         $RPM_BUILD_ROOT%{_localstatedir}/log
58
59 %{__make} install \
60         DESTDIR=$RPM_BUILD_ROOT
61 %{__make} install-man \
62         DESTDIR=$RPM_BUILD_ROOT
63
64 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
65 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}
66
67 touch $RPM_BUILD_ROOT%{_localstatedir}/log/samhain_log
68
69 %clean
70 rm -rf $RPM_BUILD_ROOT
71
72 %post
73 /sbin/chkconfig --add %{name}
74 if [ -f /var/lock/subsys/%{name} ]; then
75         /etc/rc.d/init.d/%{name} restart 1>&2
76 else
77 %banner -e %{name} <<EOF
78 %if %{with samhain}
79 Register samhain sensor before first run:
80 prelude-adduser register <profile> "imdef:w" <manager host> --uid 0 --gid 0
81 and then
82 %endif
83 Run %{_sbindir}/samhain -t init\ to initialize database
84 %if %{without samhain}
85 if not initialized.
86 %endif
87 EOF
88 fi
89 %service samhain restart "Samhain"
90
91 %preun
92 if [ "$1" = "0" ]; then
93         if [ -f /var/lock/subsys/%{name} ]; then
94                 /etc/rc.d/init.d/%{name} stop 1>&2
95         fi
96         /sbin/chkconfig --del %{name}
97 fi
98
99 %files
100 %defattr(644,root,root,755)
101 %doc README docs/{BUGS,Changelog,FAQ.html,HOWTO-*,README.UPGRADE,MANUAL-2_3.pdf}
102 %attr(750,root,bin) %{_sbindir}/samhain
103 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/samhainrc
104 %attr(700,root,root) %dir %{_var}/lib/%{name}
105 %attr(754,root,root) /etc/rc.d/init.d/%{name}
106 %attr(640,root,root) %ghost %{_localstatedir}/log/samhain_log
107 %{_mandir}/man[58]/*
This page took 0.15692 seconds and 3 git commands to generate.