Skip to content

Commit

Permalink
spec: added uthash bundilng for EL builds
Browse files Browse the repository at this point in the history
  • Loading branch information
sopos committed Jun 8, 2023
1 parent cbd9a2a commit 4ddab4a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
38 changes: 38 additions & 0 deletions fapolicyd-uthash-bundle.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
diff --color -ru a/configure.ac b/configure.ac
--- a/configure.ac 2021-11-12 20:21:54.000000000 +0100
+++ b/configure.ac 2021-12-14 13:47:11.890649552 +0100
@@ -67,10 +67,6 @@
["Couldn't find sys/fanotify.h...your kernel might not be new enough"] )])
AC_CHECK_FUNCS(fexecve, [], [])

-AC_CHECK_HEADER(uthash.h, , [AC_MSG_ERROR(
-["Couldn't find uthash.h...uthash-devel is missing"] )])
-
-
echo .
echo Checking for required libraries
AC_CHECK_LIB(udev, udev_device_get_devnode, , [AC_MSG_ERROR([libudev not found])], -ludev)
diff --color -ru a/src/library/rpm-backend.c b/src/library/rpm-backend.c
--- a/src/library/rpm-backend.c 2021-11-12 20:21:54.000000000 +0100
+++ b/src/library/rpm-backend.c 2021-12-14 13:47:26.833926203 +0100
@@ -32,7 +32,7 @@
#include <rpm/rpmpgp.h>
#include <fnmatch.h>

-#include <uthash.h>
+#include "uthash.h"

#include "message.h"
#include "gcc-attributes.h"
diff --color -ru a/src/Makefile.am b/src/Makefile.am
--- a/src/Makefile.am 2021-11-12 20:21:54.000000000 +0100
+++ b/src/Makefile.am 2021-12-14 13:48:03.218599808 +0100
@@ -5,6 +5,9 @@
-I${top_srcdir} \
-I${top_srcdir}/src/library

+AM_CPPFLAGS += \
+ -I${top_srcdir}/uthash-2.3.0/include
+
sbin_PROGRAMS = fapolicyd fapolicyd-cli
lib_LTLIBRARIES= libfapolicyd.la
10 changes: 10 additions & 0 deletions fapolicyd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ Source0: https://people.redhat.com/sgrubb/fapolicyd/%{name}-%{version}.tar.gz
#ELN %global moduletype contrib
#ELN %define semodule_version 0.6
#ELN Source1: https://github.com/linux-application-whitelisting/%{name}-selinux/archive/refs/tags/v%{semodule_version}.tar.gz#/%{name}-selinux-%{semodule_version}.tar.gz
#ELN # we bundle uthash for rhel9
#ELN Source2: https://github.com/troydhanson/uthash/archive/refs/tags/v2.3.0.tar.gz#/uthash-2.3.0.tar.gz
BuildRequires: gcc
BuildRequires: kernel-headers
BuildRequires: autoconf automake make gcc libtool
BuildRequires: systemd systemd-devel openssl-devel rpm-devel file-devel file
BuildRequires: libcap-ng-devel libseccomp-devel lmdb-devel
BuildRequires: python3-devel
#ELN %if 0%{?rhel} == 0
BuildRequires: uthash-devel
#ELN %endif
#ELN Recommends: %{name}-selinux
Requires(pre): shadow-utils
Requires(post): systemd-units
Expand Down Expand Up @@ -56,6 +60,12 @@ makes use of the kernel's fanotify interface to determine file access rights.
#ELN # selinux
#ELN %setup -q -D -T -a 1

#ELN %if 0%{?rhel} != 0
#ELN # uthash
#ELN %setup -q -D -T -a 2
#ELN %patch1 -p1 -b .uthash
#ELN %endif

# generate rules for python
sed -i "s|%python2_path%|`readlink -f %{__python2}`|g" rules.d/*.rules
sed -i "s|%python3_path%|`readlink -f %{__python3}`|g" rules.d/*.rules
Expand Down

0 comments on commit 4ddab4a

Please sign in to comment.