!1 package init

From: @wu-leilei
Reviewed-by: @small_leek
Signed-off-by: @small_leek
This commit is contained in:
openeuler-ci-bot 2021-09-11 07:04:46 +00:00 committed by Gitee
commit 25d553763a
7 changed files with 154 additions and 0 deletions

BIN
argus-3.0.8.2.tar.gz Normal file

Binary file not shown.

Binary file not shown.

11
argus-tirpc.patch Normal file
View File

@ -0,0 +1,11 @@
--- common/Makefile.in~ 2015-04-14 09:32:33.000000000 -0500
+++ common/Makefile.in 2018-03-16 11:32:06.395595496 -0500
@@ -35,7 +35,7 @@
CC = @CC@
CCOPT = @V_CCOPT@
-INCLS = -I$(srcdir) @V_INCLS@ -I$(srcdir)/../include -I$(srcdir)/../argus
+INCLS = -I$(srcdir) @V_INCLS@ -I$(srcdir)/../include -I$(srcdir)/../argus -I/usr/include/tirpc
DEFS = @DEFS@
# Standard CFLAGS

8
argus.logrotate Normal file
View File

@ -0,0 +1,8 @@
# logrotate configuration file for package argus
/var/lib/argus/argus.out {
daily
rotate 366
missingok
olddir /var/lib/argus/archive
compress
}

11
argus.service Normal file
View File

@ -0,0 +1,11 @@
[Unit]
Description=Argus generates network transaction audit records
After=syslog.target network.target
[Service]
PIDFile=/var/run/argus.pid
ExecStart=/usr/sbin/argus -d
[Install]
WantedBy=multi-user.target

113
argus.spec Normal file
View File

@ -0,0 +1,113 @@
%define _hardened_build 1
%global clientversion 3.0.8.2
Name: argus
Version: 3.0.8.2
Release: 1
Summary: Network transaction audit tool
License: GPLv2+
Url: http://qosient.com/argus
Source0: http://qosient.com/argus/src/%{name}-%{version}.tar.gz
Source1: http://qosient.com/argus/src/%{name}-clients-%{clientversion}.tar.gz
Source2: argus.service
Source3: argus.logrotate
Patch0: argus-tirpc.patch
Patch1: common.patch
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
Requires: logrotate
BuildRequires: gcc autoconf automake cyrus-sasl-devel perl-generators flex bison ncurses-devel
BuildRequires: libpcap-devel zlib-devel libtirpc-devel readline-devel systemd-units make
%package clients
Summary: Client tools for argus network audit
%description
Argus (Audit Record Generation and Utilization System) is an IP network
transaction audit tool. The data generated by argus can be used for a
wide range of tasks such as network operations, security and performance
management.
%description clients
Clients to the argus probe which process and display information.
%package devel
Summary: Header files for argus network audit
%description devel
Header files for argus.
%prep
%setup -a0 -q
%setup -a1 -q
%patch0 -p0
%patch1 -p0
%build
autoreconf -if
export CPPFLAGS="$CPPFLAGS -I/usr/include/tirpc -fcommon"
export CXXFLAGS="$CXXFLAGS -fcommon"
%configure --with-sasl=yes --prefix=%{_prefix}
find . -type f -name 'Makefile' | xargs sed -i s/fcf-protection/fcf-protection\ -fcommon/g
pushd %{name}-clients-%{clientversion}
%configure --with-sasl=yes --prefix=%{_prefix}
%{__make} %{?_smp_mflags}
popd
%install
%{__make} DESTDIR=%{buildroot} install
pushd %{name}-clients-%{clientversion}
%{__make} DESTDIR=%{buildroot} install
find support -type f -exec chmod a-x '{}' \;
popd
%{__rm} -rf %{buildroot}/%{_libdir}
%{__install} -d -m 0755 %{buildroot}/%{_localstatedir}/lib/argus/archive
%{__install} -D -m 0644 support/Config/argus.conf %{buildroot}/%{_sysconfdir}/argus.conf
%{__install} -D -m 0644 %{SOURCE2} %{buildroot}/%{_unitdir}/argus.service
%{__sed} -i 's|var/log/argus|var/lib/argus|' %{buildroot}/%{_sysconfdir}/argus.conf
%{__sed} -i 's|#ARGUS_BIND_IP|ARGUS_BIND_IP|' %{buildroot}/%{_sysconfdir}/argus.conf
%{__sed} -i 's|#ARGUS_ACCESS_PORT|ARGUS_ACCESS_PORT|' %{buildroot}/%{_sysconfdir}/argus.conf
find support -type f -exec chmod a-x '{}' \;
rm -rf %{buildroot}/usr/share/doc/argus-clients-3.0/
mv %{buildroot}/usr/argus %{buildroot}%{_datadir}/argus
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
%{__install} -p -D -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/argus
%post
%systemd_post argus.service
%preun
%systemd_preun argus.service
%postun
%systemd_postun_with_restart argus.service
%files
%doc support bin/argusbug
%doc CREDITS INSTALL README VERSION
%license COPYING
%config(noreplace) %{_sysconfdir}/argus.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/argus
%{_unitdir}/argus.service
%{_bindir}/argus*
%{_sbindir}/argus
%{_mandir}/man5/argus*
%{_mandir}/man8/argus*
%dir %{_localstatedir}/lib/argus
%dir %{_localstatedir}/lib/argus/archive
%files clients
%doc %{name}-clients-%{clientversion}/ChangeLog %{name}-clients-%{clientversion}/COPYING
%doc %{name}-clients-%{clientversion}/CREDITS %{name}-clients-%{clientversion}/INSTALL
%doc %{name}-clients-%{clientversion}/README %{name}-clients-%{clientversion}/VERSION
%doc %{name}-clients-%{clientversion}/support
%{_bindir}/ra*
%{_sbindir}/ra*
%{_mandir}/man1/ra*
%{_mandir}/man5/ra*
%{_mandir}/man8/ra*
%{_datadir}/argus/
%files devel
%{_includedir}/argus/
%changelog
* Mon Sep 6 2021 wulei <wulei80@huawei.com> - 3.0.8.2-1
- package init

11
common.patch Normal file
View File

@ -0,0 +1,11 @@
--- argus/ArgusUdt.c~ 2015-06-29 15:17:25.000000000 -0500
+++ argus/ArgusUdt.c 2020-02-19 10:45:00.768211138 -0600
@@ -41,7 +41,7 @@
#include <ArgusModeler.h>
#include <argus/bootp.h>
-struct bootp *bp;
+extern struct bootp *bp;
struct ArgusSystemFlow *
ArgusCreateUDTFlow (struct ArgusModelerStruct *model, struct udt_header *udt)