/[packages]/updates/3/denyhosts/current/SPECS/denyhosts.spec
ViewVC logotype

Annotation of /updates/3/denyhosts/current/SPECS/denyhosts.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 567524 - (hide annotations) (download)
Thu Jan 23 01:09:44 2014 UTC (10 years, 2 months ago) by solbu
File size: 5294 byte(s)
- Rediff and actually implement patch12
1 solbu 567524 %define subrel 3
2 solbu 271706 Name: denyhosts
3     Version: 2.6
4 umeabot 348723 Release: %mkrel 4
5 solbu 271706 Summary: A script to help thwart ssh server attacks
6    
7     Group: Networking/Other
8     License: GPLv2
9     URL: http://denyhosts.sourceforge.net/
10     Source0: http://dl.sourceforge.net/denyhosts/DenyHosts-%{version}.tar.gz
11     Source1: denyhosts.cron
12     Source2: denyhosts.init
13     Source3: denyhosts-allowed-hosts
14     Source4: denyhosts.sysconfig
15     Source5: denyhosts.logrotate
16     Source6: README.fedora
17     Patch0: denyhosts-2.6-mdv-config.patch
18     Patch1: denyhosts-2.4-mdv-setup.patch
19     Patch2: denyhosts-2.6-mdv-daemon-control.patch
20     # Patch10 is a security fix
21     Patch10: denyhosts-2.6-mdv-regex.patch
22 solbu 567524 Patch12: denyhosts-2.6-deb-mga-CVE-2013-6890-fix-dos.patch
23 solbu 271706
24     BuildArch: noarch
25     BuildRequires: python-devel
26     Requires: openssh-server
27 solbu 453501 Requires: rsyslog
28 solbu 271706 Requires(post): rpm-helper
29     Requires(preun): rpm-helper
30    
31     %description
32     DenyHosts is a Python script that analyzes the sshd server log
33     messages to determine which hosts are attempting to hack into your
34     system. It also determines what user accounts are being targeted. It
35     keeps track of the frequency of attempts from each host and, upon
36     discovering a repeated attack host, updates the /etc/hosts.deny file
37     to prevent future break-in attempts from that host. Email reports can
38     be sent to a system admin.
39    
40    
41     %prep
42     %setup -q -n DenyHosts-%{version}
43     %patch0 -p0 -b .config
44     %patch1 -p0 -b .setup
45     %patch2 -p0 -b .daemon-control
46     %patch10 -p1 -b .regex
47 solbu 567524 %patch12 -p1 -b .dos
48 solbu 271706
49     cp %{SOURCE6} .
50    
51     # Fix up non-utf8-ness
52     for i in CHANGELOG.txt; do
53     iconv -f iso-8859-1 -t utf-8 < $i > $i. && touch -r $i $i. && mv -f $i. $i
54     done
55    
56     # This must be moved before the Python build process runs so that we
57     # can include it as documentation.
58     mv plugins/README.contrib .
59    
60     # And the permissions are off as well
61     chmod +x plugins/*
62    
63     %build
64     python setup.py build
65    
66     %install
67     rm -rf %{buildroot}
68    
69     python setup.py install -O1 --skip-build --root=%{buildroot}
70    
71     install -d %{buildroot}/%{_bindir}
72     install -d %{buildroot}/%{_initrddir}
73     install -d %{buildroot}/%{_sysconfdir}/cron.d
74     install -d %{buildroot}/%{_sysconfdir}/logrotate.d
75     install -d %{buildroot}/%{_sysconfdir}/sysconfig
76    
77     install -d -m 700 %{buildroot}/%{_localstatedir}/lib/denyhosts
78     install -d %{buildroot}/%{_localstatedir}/log
79    
80     install -p -m 600 denyhosts.cfg-dist %{buildroot}/%{_sysconfdir}/denyhosts.conf
81     install -p -m 755 daemon-control-dist %{buildroot}/%{_bindir}/denyhosts-control
82     install -p -m 644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/cron.d/denyhosts
83     install -p -m 755 %{SOURCE2} %{buildroot}/%{_initrddir}/denyhosts
84     install -p -m 644 %{SOURCE3} %{buildroot}/%{_localstatedir}/lib/denyhosts/allowed-hosts
85     install -p -m 644 %{SOURCE4} %{buildroot}/%{_sysconfdir}/sysconfig/denyhosts
86     install -p -m 644 %{SOURCE5} %{buildroot}/%{_sysconfdir}/logrotate.d/denyhosts
87    
88     touch %{buildroot}/%{_localstatedir}/log/denyhosts
89    
90     for i in allowed-warned-hosts hosts hosts-restricted hosts-root \
91     hosts-valid offset suspicious-logins sync-hosts \
92     users-hosts users-invalid users-valid; do
93     touch %{buildroot}/%{_localstatedir}/lib/denyhosts/$i
94     done
95    
96     %preun
97     %_preun_service %name
98    
99     %post
100     # Note that we do not automaticaly run --migrate, because we can't be
101     # sure that all of the hosts.deny entries were created by denyhosts
102     %_post_service %name
103    
104     touch %{_localstatedir}/log/denyhosts
105     touch %{_localstatedir}/lib/denyhosts/allowed-warned-hosts
106     touch %{_localstatedir}/lib/denyhosts/hosts
107     touch %{_localstatedir}/lib/denyhosts/hosts-restricted
108     touch %{_localstatedir}/lib/denyhosts/hosts-root
109     touch %{_localstatedir}/lib/denyhosts/hosts-valid
110     touch %{_localstatedir}/lib/denyhosts/offset
111     touch %{_localstatedir}/lib/denyhosts/suspicious-logins
112     touch %{_localstatedir}/lib/denyhosts/sync-hosts
113     touch %{_localstatedir}/lib/denyhosts/users-hosts
114     touch %{_localstatedir}/lib/denyhosts/users-invalid
115     touch %{_localstatedir}/lib/denyhosts/users-valid
116    
117     %postun
118     if [ $1 -ge 1 ] ; then
119     service %name condrestart >/dev/null 2>&1
120     fi
121    
122    
123     %files
124     %doc CHANGELOG.txt denyhosts.cfg-dist
125     %doc README.fedora README.txt setup.py README.contrib
126    
127     %{_bindir}/denyhosts.py
128     %{_bindir}/denyhosts-control
129     %{_datadir}/denyhosts
130     %{py_puresitedir}/*
131    
132     %config(noreplace) %{_sysconfdir}/denyhosts.conf
133     %config(noreplace) %{_sysconfdir}/cron.d/denyhosts
134     %config(noreplace) %{_sysconfdir}/logrotate.d/denyhosts
135     %config(noreplace) %{_sysconfdir}/sysconfig/denyhosts
136     %config(noreplace) %{_localstatedir}/lib/denyhosts/allowed-hosts
137    
138     %ghost %{_localstatedir}/log/denyhosts
139     %ghost %{_localstatedir}/lib/denyhosts/allowed-warned-hosts
140     %ghost %{_localstatedir}/lib/denyhosts/hosts
141     %ghost %{_localstatedir}/lib/denyhosts/hosts-restricted
142     %ghost %{_localstatedir}/lib/denyhosts/hosts-root
143     %ghost %{_localstatedir}/lib/denyhosts/hosts-valid
144     %ghost %{_localstatedir}/lib/denyhosts/offset
145     %ghost %{_localstatedir}/lib/denyhosts/suspicious-logins
146     %ghost %{_localstatedir}/lib/denyhosts/sync-hosts
147     %ghost %{_localstatedir}/lib/denyhosts/users-hosts
148     %ghost %{_localstatedir}/lib/denyhosts/users-invalid
149     %ghost %{_localstatedir}/lib/denyhosts/users-valid
150    
151     %dir %{_localstatedir}/lib/denyhosts
152    
153     %{_initrddir}/denyhosts
154    
155    

  ViewVC Help
Powered by ViewVC 1.1.30