From 6f5053d58fdee30c59282ddec03a250e7df7cba7 Mon Sep 17 00:00:00 2001 From: aquarius Date: Sun, 6 Jan 2008 11:06:07 +0000 Subject: [PATCH] added patch needed to run on redhat platforms and added sample config files git-svn-id: https://dev.arachne.cz/repos/prometheus/trunk@39 251d49ef-1d17-4917-a970-b30cf55b089b --- Makefile | 3 +++ prometheus-conf-rh.patch | 36 ++++++++++++++++++++++++++++++++++++ prometheus.spec | 13 +++++++++++-- 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 prometheus-conf-rh.patch diff --git a/Makefile b/Makefile index 31be395..9c73178 100644 --- a/Makefile +++ b/Makefile @@ -14,10 +14,13 @@ install: main install -d $(mandir)/man1 install -d $(mandir)/man5 install -d $(sysconfdir)/cron.d + install -d $(sysconfdir)/prometheus install -m 755 prometheus $(sbindir) install -m 644 prometheus.1 $(mandir)/man1 install -m 644 prometheus.conf.5 $(mandir)/man5 install -m 755 sample-configuration/prometheus.cron $(sysconfdir)/cron.d/prometheus + install -m 600 sample-configuration/prometheus.conf $(sysconfdir)/prometheus + install -m 600 sample-configuration/hosts $(sysconfdir)/prometheus clean: rm -f prometheus diff --git a/prometheus-conf-rh.patch b/prometheus-conf-rh.patch new file mode 100644 index 0000000..913d0bc --- /dev/null +++ b/prometheus-conf-rh.patch @@ -0,0 +1,36 @@ +--- prometheus.c 2008-01-06 11:54:28.000000000 +0100 ++++ prometheus-rh.c 2008-01-06 11:54:09.000000000 +0100 +@@ -57,17 +57,17 @@ + char *mark="MARK"; + char *mark_iptables="MARK --set-mark "; + int dry_run=0; /* preview - use puts() instead of system() */ +-char *config="/etc/prometheus.conf"; /* main configuration file */ +-char *hosts="/etc/hosts"; /* line bandwidth definition file */ ++char *config="/etc/prometheus/prometheus.conf"; /* main configuration file */ ++char *hosts="/etc/prometheus/hosts"; /* line bandwidth definition file */ + char *tc="/sbin/tc"; /* requires tc with HTB support */ +-char *iptables="/usr/sbin/iptables"; /* requires iptables utility */ +-char *iptablessave="/usr/sbin/iptables-save"; /* new */ +-char *iptablesrestore="/usr/sbin/iptables-restore"; /* new */ ++char *iptables="/sbin/iptables"; /* requires iptables utility */ ++char *iptablessave="/sbin/iptables-save"; /* new */ ++char *iptablesrestore="/sbin/iptables-restore"; /* new */ + char *iptablesfile="/var/spool/prometheus.iptables"; /* new; file for iptables-restore*/ + char *iptablespreamble="*mangle\n:PREROUTING ACCEPT [0:0]\n:POSTROUTING ACCEPT [0:0]\n:INPUT ACCEPT [0:0]\n:OUTPUT ACCEPT [0:0]\n:FORWARD ACCEPT [0:0]"; + FILE *iptables_file=NULL; +-char *html="/var/www/traffic.html"; /* hall of fame filename */ +-char *preview="/var/www/preview.html"; /* hall of fame preview */ ++char *html="/var/www/html/traffic.html"; /* hall of fame filename */ ++char *preview="/var/www/html/preview.html"; /* hall of fame preview */ + char *cmdlog="/var/log/prometheus"; /* command log filename */ + char *credit="/var/run/prometheus.credit"; /* credit log file */ + int enable_credit=1; /* enable credit file */ +@@ -93,7 +93,7 @@ + int qos_free_delay=0; /* seconds to sleep before applying new QoS rules */ + int digital_divide=2; /* controls digital divide weirdness ratio, 1...3 */ + int max_nesting=3; /* maximum nesting of HTB clases, built-in maximum seems to be 4 */ +-int htb_r2q=1; ++int htb_r2q=1; + int burst=8; /* HTB burst (in kbits) */ + int burst_main=64; + int burst_group=32; diff --git a/prometheus.spec b/prometheus.spec index 8aebe88..eea812f 100644 --- a/prometheus.spec +++ b/prometheus.spec @@ -1,12 +1,13 @@ Summary: Traffic shaper replacement for Internet Service Providers (ISP). Name: prometheus Version: 0.7.7 -Release: 3 +Release: 4 License: GPL Vendor: Arachne Labs http://www.arachne.cz Packager: Tomas Lastovicka Group: Applications/System Source0: http://gpl.arachne.cz/download/%name-%version.tar.gz +Patch0: prometheus-conf-rh.patch URL: http://gpl.arachne.cz Requires: iptables, iproute BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -29,6 +30,7 @@ of CZFree.Net broadband community network. %prep %setup -q +%patch0 -p0 %build make %{_smp_mflags} @@ -38,7 +40,8 @@ rm -rf %{buildroot} mkdir -p %{buildroot}%{_sbindir} mkdir -p %{buildroot}%{_mandir}/man1 mkdir -p %{buildroot}%{_mandir}/man5 -mkdir -p %{buildroot}%{_sysconfdir}/cron.d/ +mkdir -p %{buildroot}%{_sysconfdir}/cron.d +mkdir -p %{buildroot}%{_sysconfdir}/prometheus %makeinstall @@ -51,8 +54,14 @@ rm -rf %{buildroot} %{_mandir}/man1/prometheus.1* %{_mandir}/man5/prometheus.conf.5* %config(noreplace) %{_sysconfdir}/cron.d/prometheus +%config(noreplace) %{_sysconfdir}/prometheus/prometheus.conf +%config(noreplace) %{_sysconfdir}/prometheus/hosts %changelog +* Sun Jan 6 2008 Tomas Lastovicka 0.7.7-4 +- added sample configuration files +- added patch which reflects different locations of some files in redhat-like distros + * Sat Jan 5 2008 Tomas Lastovicka 0.7.7-3 - removed screen from dependencies - cleaned up cron file -- 2.30.2