From eb80b375bc2cbfd00d4f60948712229df91f680d Mon Sep 17 00:00:00 2001 From: Hubbitus Date: Apr 25 2014 15:02:13 +0000 Subject: Initial import darkstat into Fedora/epel --- diff --git a/.gitignore b/.gitignore index e69de29..3494fd0 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/darkstat-3.0.718.tar.bz2 diff --git a/darkstat.service b/darkstat.service new file mode 100644 index 0000000..049fe62 --- /dev/null +++ b/darkstat.service @@ -0,0 +1,11 @@ +[Unit] +Description=Network traffic analyzer +After=syslog.target network.target + +[Service] +Type=forking +EnvironmentFile=-/etc/sysconfig/darkstat +ExecStart=/usr/sbin/darkstat $OPTIONS + +[Install] +WantedBy=multi-user.target diff --git a/darkstat.spec b/darkstat.spec new file mode 100644 index 0000000..5e21a3e --- /dev/null +++ b/darkstat.spec @@ -0,0 +1,73 @@ +Name: darkstat +Summary: Network traffic analyzer +Version: 3.0.718 +Release: 3%{?dist} +License: GPLv2 +Group: Applications/Internet +URL: http://unix4lyfe.org/darkstat/ +Source: http://unix4lyfe.org/%{name}/%{name}-%{version}.tar.bz2 +# My own systemd files +Source1: %{name}.service +Source2: %{name}.sysconfig +BuildRequires: libpcap-devel, zlib-devel + +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd +BuildRequires: systemd + +%description +darkstat is a network traffic analyzer. It's basically a packet sniffer +which runs as a background process on a cable/DSL router and gathers +all sorts of useless but interesting statistics. + +%prep +%setup -q + +%build +%configure --disable-silent-rules +make %{?_smp_mflags} + +%install +make install DESTDIR="%{buildroot}" + +install -Dp -m 0644 %{SOURCE1} %{buildroot}/%{_unitdir}/%{name}.service +install -Dp -m 0644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/sysconfig/%{name} + +%pre +getent passwd %{name} >/dev/null || useradd -r -s /sbin/nologin -c "Network traffic analyzer" %{name} +exit 0 + +%post +%systemd_post %{name}.service + +%preun +%systemd_preun %{name}.service + +%postun +%systemd_postun_with_restart %{name}.service + +%files +%doc AUTHORS COPYING* LICENSE NEWS README *.txt +%{_mandir}/man8/darkstat.8* +%attr(755,-,-) %{_sbindir}/darkstat +%attr(0600,%{name},root) %config(noreplace) %{_sysconfdir}/sysconfig/%{name} +%{_unitdir}/%{name}.service + +%changelog +* Fri Apr 25 2014 Pavel Alexeev - 3.0.718-3 +- Add --disable-silent-rules to configure call. + +* Thu Apr 24 2014 Pavel Alexeev - 3.0.718-2 +- Do not mark man ad %%doc. +- Add systemd stuff. +- Provide separate user for service. + +* Fri Mar 14 2014 Pavel Alexeev - 3.0.718-1 +- Imported from http://pkgs.repoforge.org/darkstat/darkstat-3.0.717-1.rf.src.rpm and rework to prepare for Fedora. +- Update to 3.0.718. +- Cleanup. +- Update URLs. +- Remove INSTALL file from docs (install-file-in-docs rpmlint warning). +- darkstat.x86_64: E: missing-call-to-setgroups /usr/sbin/darkstat, darkstat.x86_64: E: incorrect-fsf-address /usr/share/doc/darkstat/COPYING.GPL issues mailed to author. +- Add BR zlib-devel \ No newline at end of file diff --git a/darkstat.sysconfig b/darkstat.sysconfig new file mode 100644 index 0000000..395bad5 --- /dev/null +++ b/darkstat.sysconfig @@ -0,0 +1,3 @@ +# As base only specify network interface is mandatory. +# For more options see man darkstat +OPTIONS="-i p10p1" diff --git a/sources b/sources index e69de29..0fa04ee 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +1fb31ac01d4689493c917fa622a002e7 darkstat-3.0.718.tar.bz2