You are not logged in.

#1 2019-02-04 06:58:01

anshulsg
Member
Registered: 2018-11-15
Posts: 6

Rebuilding Audit for E4Rat Installation

Hi!
I haven't used arch extensively and I am stuck at installing E4Rat.
The Installation page says:
"In order to build it, you must first rebuild audit from the ABS with staticlibs option explicitly enabled. Simply installing the default audit package will result in a build error."
Can anyone simplify this for me with the exact commands I need to use?


Thanks!

Edit:
I have tried installing it (and failed) using these steps:

1. Getting the PKGBUILD

asp checkout audit
asp export audit

2. Add 'staticlibs' option to the PKGBUILD
3. Build the package

makepkg
makepkg -i

The error I get is:

error: failed to commit transaction (conflicting files)
/usr/lib/golang/src/pkg/redhat.com/audit/audit.go exists in both 'audit' and 'python2-audit'
/usr/lib/golang/src/pkg/redhat.com/audit/audit.go exists in both 'audit' and 'python-audit'
/usr/lib/golang/src/pkg/redhat.com/audit/audit.go exists in both 'python2-audit' and 'python-audit'
Errors occurred, no packages were upgraded.
==> WARNING: Failed to install built package(s).

Last edited by anshulsg (2019-02-04 07:24:23)

Offline

#2 2019-02-04 07:05:24

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Rebuilding Audit for E4Rat Installation

options=(emptydirs staticlibs)

and https://wiki.archlinux.org/index.php/Arch_Build_System


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2019-02-04 07:19:26

anshulsg
Member
Registered: 2018-11-15
Posts: 6

Re: Rebuilding Audit for E4Rat Installation

jasonwryan wrote:

I have tried doing this.
While running the makepkg installation however, I see the following error:

error: failed to commit transaction (conflicting files)
/usr/lib/golang/src/pkg/redhat.com/audit/audit.go exists in both 'audit' and 'python2-audit'
/usr/lib/golang/src/pkg/redhat.com/audit/audit.go exists in both 'audit' and 'python-audit'
/usr/lib/golang/src/pkg/redhat.com/audit/audit.go exists in both 'python2-audit' and 'python-audit'
Errors occurred, no packages were upgraded.
==> WARNING: Failed to install built package(s).

My PKGBUILD header looks like:

pkgbase=audit
pkgname=('audit' 'python2-audit' 'python-audit')
pkgver=2.8.4
pkgrel=3
pkgdesc='Userspace components of the audit framework'
url='https://people.redhat.com/sgrubb/audit'
arch=('x86_64')
makedepends=('krb5' 'libcap-ng' 'libldap' 'swig' 'linux-headers' 'python' 'python2')
license=('GPL')
options=('emptydirs' 'staticlibs')
source=(${pkgbase}-${pkgver}.tar.gz::https://people.redhat.com/sgrubb/audit/${pkgbase}-${pkgver}.tar.gz)

Offline

#4 2019-02-04 14:33:31

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: Rebuilding Audit for E4Rat Installation

You already had a topic for this. Do not cross post. I will leave this open because it has replies and more information (and close the older topic), but future cross-posted topics will be closed.

Offline

#5 2019-02-04 16:04:05

loqs
Member
Registered: 2014-03-06
Posts: 19,104

Re: Rebuilding Audit for E4Rat Installation

Please install devtools and use extra-x86_64-build instead of makepkg -si the resulting packages should then not contain /usr/lib/golang/src/pkg/redhat.com/audit/audit.go

Offline

#6 2019-02-05 08:39:13

anshulsg
Member
Registered: 2018-11-15
Posts: 6

Re: Rebuilding Audit for E4Rat Installation

loqs wrote:

Please install devtools and use extra-x86_64-build instead of makepkg -si the resulting packages should then not contain /usr/lib/golang/src/pkg/redhat.com/audit/audit.go

This seemed to have solved the error. However, does extra-x86_64-build install audit into a chroot or into my environment?
Because I still get a build error on trying to install e4rat (which is probably because audit in my environment hasn't been built with staticlibs option.)
The error I get on building e4rat is:

[ 23%] Building CXX object src/CMakeFiles/e4rat-core.dir/device.cc.o
/home/anshulsg/.cache/yay/e4rat/src/e4rat-0.2.3/src/device.cc: In member function ‘int Device::getDevNameFromMajorMinor()’:
/home/anshulsg/.cache/yay/e4rat/src/e4rat-0.2.3/src/device.cc:219:35: error: ‘major’ cannot be used as a function
     int major = major(get()->devno);
                                   ^
/home/anshulsg/.cache/yay/e4rat/src/e4rat-0.2.3/src/device.cc:220:35: error: ‘minor’ cannot be used as a function
     int minor = minor(get()->devno);
                                   ^
make[2]: *** [src/CMakeFiles/e4rat-core.dir/build.make:115: src/CMakeFiles/e4rat-core.dir/device.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:240: src/CMakeFiles/e4rat-core.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
Error making: e4rat

Last edited by anshulsg (2019-02-05 08:40:22)

Offline

#7 2019-02-05 13:04:12

loqs
Member
Registered: 2014-03-06
Posts: 19,104

Re: Rebuilding Audit for E4Rat Installation

If audit has not been built with static libs the following output is produced

-- The C compiler identification is GNU 8.2.1
-- The CXX compiler identification is GNU 8.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Boost version: 1.69.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   regex
-- Found ext2fs: /usr/lib/libext2fs.so
CMake Error at src/cmake/Findaudit.cmake:17 (MESSAGE):
  Could not find audit
Call Stack (most recent call first):
  src/CMakeLists.txt:83 (find_package)


-- Configuring incomplete, errors occurred!
See also "/build/e4rat/src/e4rat-0.2.3/CMakeFiles/CMakeOutput.log".

https://sourceforge.net/p/e4rat/tickets/5/

diff --git a/src/device.cc b/src/device.cc
index bba5d12..c75559e 100644
--- a/src/device.cc
+++ b/src/device.cc
@@ -28,6 +28,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
+#include <sys/sysmacros.h>
 #include <mntent.h>
 
 #include <boost/lexical_cast.hpp>
diff --git a/src/e4rat-collect.cc b/src/e4rat-collect.cc
index 455057c..ec41355 100644
--- a/src/e4rat-collect.cc
+++ b/src/e4rat-collect.cc
@@ -27,6 +27,7 @@
 #include <iostream>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/sysmacros.h>
 #include <getopt.h>
 #include <unistd.h>
 #include <fcntl.h>
diff --git a/src/listener.cc b/src/listener.cc
index f7f0fa1..53a0aa0 100644
--- a/src/listener.cc
+++ b/src/listener.cc
@@ -28,6 +28,7 @@
 #include <errno.h>
 #include <unistd.h>
 #include <sys/stat.h>
+#include <sys/sysmacros.h>
 #include <cstring>
 #include <linux/limits.h>
 #include <fcntl.h>

The build will then fail with the issue noted from the latest comment on the AUR package page.
Then after resolving that issue it fails to link due to libcap-ng not being built with staticlibs.

Offline

#8 2019-02-07 19:58:37

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Rebuilding Audit for E4Rat Installation

anshulsg wrote:
loqs wrote:

Please install devtools and use extra-x86_64-build instead of makepkg -si the resulting packages should then not contain /usr/lib/golang/src/pkg/redhat.com/audit/audit.go

This seemed to have solved the error. However, does extra-x86_64-build install audit into a chroot or into my environment?
Because I still get a build error on trying to install e4rat (which is probably because audit in my environment hasn't been built with staticlibs option.)

It doesn't install it. It builds it. You need to install it yourself afterward.

$ pacman -Qi audit
[...]
Packager        : Jelle van der Waa <jelle@archlinux.org>
Build Date      : Sat 02 Feb 2019 12:26:08 PM EST
Install Date    : Sat 02 Feb 2019 08:10:15 PM EST
[...]

When and by whom was your audit package created? If it looks like the above output, then you did not install the new version of audit on your system.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB