[phrel/f18] Initial SETUP

Christopher Meng cicku at fedoraproject.org
Wed May 29 04:37:52 UTC 2013


commit a4a4c5d2b6ef97a100541d0033599a8d3da9d290
Author: Christopher Meng <rpm at cicku.me>
Date:   Wed May 29 12:35:58 2013 +0800

    Initial SETUP

 .gitignore     |    1 +
 phrel.spec     |   76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 phreld.service |   11 ++++++++
 sources        |    1 +
 4 files changed, 89 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..862a504 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/phrel-1.0.1.tar.bz2
diff --git a/phrel.spec b/phrel.spec
new file mode 100644
index 0000000..6370e6e
--- /dev/null
+++ b/phrel.spec
@@ -0,0 +1,76 @@
+%global  dname phreld
+%global _hardened_build 1
+
+Name:              phrel
+Version:           1.0.1
+Release:           1%{?dist}
+Summary:           Per Host RatE Limiter
+License:           GPLv2
+URL:               http://www.digitalgenesis.com/software/phrel
+Source0:           ftp://ftp.digitalgenesis.com/pub/%{name}/%{name}-%{version}.tar.bz2
+Source1:           %{dname}.service
+
+Buildrequires:     libpcap-devel
+Buildrequires:     mysql-devel
+Buildrequires:     net-snmp-devel
+BuildRequires:     systemd
+Requires:          iptables
+Requires(post):    systemd
+Requires(preun):   systemd
+Requires(postun):  systemd
+
+%description
+PHREL is a Per Host RatE Limiter written in C to efficiently track the rate 
+of incoming traffic on a per host basis and insert a chain into iptables when 
+a configured threshold is crossed. The inserted chain may either rate limit 
+or completely block the offending host for a period of time and will be 
+automatically removed when the offending host's traffic levels return to 
+normal. PHREL can be used with any type of traffic, but it is particularly 
+well suited to protecting name servers from random hosts that flood DNS 
+requests and preventing SSH brute force login attempts.
+ 
+PHREL now supports IPv6 and syncronization between instances of PHREL via a 
+MySQL database. The syncronization feature is designed to work in load 
+balanced server farm environments or to simply provide database access to the 
+hosts that PHREL is currently monitoring.
+
+%prep
+%setup -q
+
+%build
+export LDFLAGS="$LDFLAGS -pie -Wl,-z,relro"
+%configure --with-snmp --with-mysql
+make CFLAGS="%{optflags}" %{?_smp_mflags}
+
+%install
+make install DESTDIR=%{buildroot}
+install -p -D -m 644 contrib/%{dname}.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/%{dname}
+install -p -D -m 644 %{dname}.conf %{buildroot}%{_sysconfdir}/%{dname}.conf
+install -d %{buildroot}%{_localstatedir}/%{dname}
+install -p -D -m 644 %{S:1} %{buildroot}%{_unitdir}/%{dname}.service
+find %{buildroot} -name '*.a' -exec rm -f {} ';'
+
+%post
+%systemd_post %{S:1}
+
+%preun
+%systemd_preun %{S:1}
+
+%postun
+%systemd_postun_with_restart %{S:1}
+
+%files
+%doc AUTHORS ChangeLog COPYING README 
+%doc docs/phrel-dns-article.html docs/%{name}.*
+%doc docs/mysql-phrel.sql
+%{_sbindir}/%{dname}
+%config(noreplace) %{_sysconfdir}/%{dname}.conf
+%config(noreplace) %{_sysconfdir}/sysconfig/%{dname}
+%{_mandir}/man1/*.1*
+%{_mandir}/man5/*.conf.5*
+%{_localstatedir}/%{dname}
+%{_unitdir}/%{dname}.service
+
+%changelog
+* Wed May 08 2013 Christopher Meng <rpm at cicku.me> - 1.0.1-1
+- Initial Package.
diff --git a/phreld.service b/phreld.service
new file mode 100644
index 0000000..630d360
--- /dev/null
+++ b/phreld.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Per Host RatE Limiter daemon
+Documentation=man:phreld(1)
+
+[Service]
+EnvironmentFile=-/etc/sysconfig/phreld
+ExecStart=/usr/bin/phreld $EXTRAOPTIONS
+Type=forking
+
+[Install]
+WantedBy=multi-user.target
diff --git a/sources b/sources
index e69de29..c20036c 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+f95481794bc0e043f30c32e7cf8e8502  phrel-1.0.1.tar.bz2


More information about the scm-commits mailing list