package/libapparmor: new package
The layout of the package is not amenable to building both the library
and the utilities at once, so this package will only install the
library.
The other apparmor-related tools however will almost all want to always
link with the static library (it's hard-coded in their Makefiles, like:
AALIB = -Wl,-Bstatic -lapparmor -Wl,-Bdynamic -lpthread), so we also
force the build of the static library.
The kernel headers 3.16 at least are required, for CAP_AUDIT_READ.
We need to force the C standard to gnu99, otherwise:
- autoconf uses wchar_t in C99 test, so considers it to be missing
on toolchains without wchar, but wchar is not otherwise needed for
libapparmor;
- c99 is not enough, otherwise the build fails with errors like:
kernel.c:503:15: error: expected declaration specifiers or ‘...’ before ‘(’ token
extern typeof((__change_hat)) __old_change_hat __attribute__((alias ("__change_hat")));
^
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
[yann.morin.1998@free.fr: strip down the patch to only build the lib]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Tested-by: Angelo Compagnucci <angelo@amarulasolutions.com>
2020-03-27 10:29:05 +01:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# libapparmor
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
package/apparmor: new package
The various AppArmor utilities are spread in a few sub-directories of
the apparmor source tree. For now, we build only the parser, but we'll
soon introduce support for a few other utilities, so we prepare the
package to be able to build more than just the parser, hence the
slightly convoluted build and install commands, and the use of the
APPARMOR_TOOLS and APPARMOR_MAKE_OPTS variables, which will come handy
in the following commits.
We must ensure the version matches that of libapparmor, but there is not
much we can do to enforce that, so as we do for various other packages,
we just add a comment to that effect.
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
[yann.morin.1998@free.fr:
- make it a separate package
- split into its own patch, write a commit log
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Tested-by: Angelo Compagnucci <angelo@amarulasolutions.com>
2020-03-27 21:38:37 +01:00
|
|
|
# When updating the version here, please also update the apparmor package
|
2020-10-11 18:11:53 +02:00
|
|
|
LIBAPPARMOR_VERSION_MAJOR = 3.0
|
2021-08-10 00:31:47 +02:00
|
|
|
LIBAPPARMOR_VERSION = $(LIBAPPARMOR_VERSION_MAJOR).3
|
package/libapparmor: new package
The layout of the package is not amenable to building both the library
and the utilities at once, so this package will only install the
library.
The other apparmor-related tools however will almost all want to always
link with the static library (it's hard-coded in their Makefiles, like:
AALIB = -Wl,-Bstatic -lapparmor -Wl,-Bdynamic -lpthread), so we also
force the build of the static library.
The kernel headers 3.16 at least are required, for CAP_AUDIT_READ.
We need to force the C standard to gnu99, otherwise:
- autoconf uses wchar_t in C99 test, so considers it to be missing
on toolchains without wchar, but wchar is not otherwise needed for
libapparmor;
- c99 is not enough, otherwise the build fails with errors like:
kernel.c:503:15: error: expected declaration specifiers or ‘...’ before ‘(’ token
extern typeof((__change_hat)) __old_change_hat __attribute__((alias ("__change_hat")));
^
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
[yann.morin.1998@free.fr: strip down the patch to only build the lib]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Tested-by: Angelo Compagnucci <angelo@amarulasolutions.com>
2020-03-27 10:29:05 +01:00
|
|
|
LIBAPPARMOR_SOURCE = apparmor-$(LIBAPPARMOR_VERSION).tar.gz
|
2021-02-06 19:54:09 +01:00
|
|
|
LIBAPPARMOR_SITE = https://launchpad.net/apparmor/$(LIBAPPARMOR_VERSION_MAJOR)/$(LIBAPPARMOR_VERSION)/+download
|
package/libapparmor: new package
The layout of the package is not amenable to building both the library
and the utilities at once, so this package will only install the
library.
The other apparmor-related tools however will almost all want to always
link with the static library (it's hard-coded in their Makefiles, like:
AALIB = -Wl,-Bstatic -lapparmor -Wl,-Bdynamic -lpthread), so we also
force the build of the static library.
The kernel headers 3.16 at least are required, for CAP_AUDIT_READ.
We need to force the C standard to gnu99, otherwise:
- autoconf uses wchar_t in C99 test, so considers it to be missing
on toolchains without wchar, but wchar is not otherwise needed for
libapparmor;
- c99 is not enough, otherwise the build fails with errors like:
kernel.c:503:15: error: expected declaration specifiers or ‘...’ before ‘(’ token
extern typeof((__change_hat)) __old_change_hat __attribute__((alias ("__change_hat")));
^
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
[yann.morin.1998@free.fr: strip down the patch to only build the lib]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Tested-by: Angelo Compagnucci <angelo@amarulasolutions.com>
2020-03-27 10:29:05 +01:00
|
|
|
LIBAPPARMOR_LICENSE = LGPL-2.1
|
|
|
|
LIBAPPARMOR_LICENSE_FILES = LICENSE libraries/libapparmor/COPYING.LGPL
|
|
|
|
|
|
|
|
LIBAPPARMOR_DEPENDENCIES = host-bison host-flex host-pkgconf
|
|
|
|
LIBAPPARMOR_SUBDIR = libraries/libapparmor
|
|
|
|
LIBAPPARMOR_INSTALL_STAGING = YES
|
|
|
|
|
2020-03-28 19:50:09 +01:00
|
|
|
# Patches 0001 and 0002 touch Makefile.am and an m4 file
|
|
|
|
LIBAPPARMOR_AUTORECONF = YES
|
|
|
|
|
package/libapparmor: new package
The layout of the package is not amenable to building both the library
and the utilities at once, so this package will only install the
library.
The other apparmor-related tools however will almost all want to always
link with the static library (it's hard-coded in their Makefiles, like:
AALIB = -Wl,-Bstatic -lapparmor -Wl,-Bdynamic -lpthread), so we also
force the build of the static library.
The kernel headers 3.16 at least are required, for CAP_AUDIT_READ.
We need to force the C standard to gnu99, otherwise:
- autoconf uses wchar_t in C99 test, so considers it to be missing
on toolchains without wchar, but wchar is not otherwise needed for
libapparmor;
- c99 is not enough, otherwise the build fails with errors like:
kernel.c:503:15: error: expected declaration specifiers or ‘...’ before ‘(’ token
extern typeof((__change_hat)) __old_change_hat __attribute__((alias ("__change_hat")));
^
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
[yann.morin.1998@free.fr: strip down the patch to only build the lib]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Tested-by: Angelo Compagnucci <angelo@amarulasolutions.com>
2020-03-27 10:29:05 +01:00
|
|
|
# Most AppArmor tools will want to link to the static lib.
|
|
|
|
# ac_cv_prog_cc_c99 is required for BR2_USE_WCHAR=n because the C99 test
|
|
|
|
# provided by autoconf relies on wchar_t.
|
|
|
|
LIBAPPARMOR_CONF_OPTS = \
|
|
|
|
ac_cv_prog_cc_c99=-std=gnu99 \
|
|
|
|
--enable-static \
|
2020-03-28 19:50:09 +01:00
|
|
|
--disable-man-pages
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_PYTHON3),y)
|
|
|
|
LIBAPPARMOR_DEPENDENCIES += host-python3 host-swig python3
|
|
|
|
LIBAPPARMOR_CONF_OPTS += \
|
|
|
|
--with-python \
|
|
|
|
PYTHON=$(HOST_DIR)/usr/bin/python3 \
|
|
|
|
PYTHON_CONFIG=$(STAGING_DIR)/usr/bin/python3-config \
|
|
|
|
SWIG=$(SWIG)
|
|
|
|
else
|
|
|
|
LIBAPPARMOR_CONF_OPTS += --without-python
|
|
|
|
endif
|
package/libapparmor: new package
The layout of the package is not amenable to building both the library
and the utilities at once, so this package will only install the
library.
The other apparmor-related tools however will almost all want to always
link with the static library (it's hard-coded in their Makefiles, like:
AALIB = -Wl,-Bstatic -lapparmor -Wl,-Bdynamic -lpthread), so we also
force the build of the static library.
The kernel headers 3.16 at least are required, for CAP_AUDIT_READ.
We need to force the C standard to gnu99, otherwise:
- autoconf uses wchar_t in C99 test, so considers it to be missing
on toolchains without wchar, but wchar is not otherwise needed for
libapparmor;
- c99 is not enough, otherwise the build fails with errors like:
kernel.c:503:15: error: expected declaration specifiers or ‘...’ before ‘(’ token
extern typeof((__change_hat)) __old_change_hat __attribute__((alias ("__change_hat")));
^
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
[yann.morin.1998@free.fr: strip down the patch to only build the lib]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Tested-by: Angelo Compagnucci <angelo@amarulasolutions.com>
2020-03-27 10:29:05 +01:00
|
|
|
|
2020-05-01 15:46:58 +02:00
|
|
|
define LIBAPPARMOR_LINUX_CONFIG_FIXUPS
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_AUDIT)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_SECURITY_APPARMOR)
|
|
|
|
$(call KCONFIG_ENABLE_OPT,CONFIG_DEFAULT_SECURITY_APPARMOR)
|
|
|
|
endef
|
|
|
|
|
package/libapparmor: new package
The layout of the package is not amenable to building both the library
and the utilities at once, so this package will only install the
library.
The other apparmor-related tools however will almost all want to always
link with the static library (it's hard-coded in their Makefiles, like:
AALIB = -Wl,-Bstatic -lapparmor -Wl,-Bdynamic -lpthread), so we also
force the build of the static library.
The kernel headers 3.16 at least are required, for CAP_AUDIT_READ.
We need to force the C standard to gnu99, otherwise:
- autoconf uses wchar_t in C99 test, so considers it to be missing
on toolchains without wchar, but wchar is not otherwise needed for
libapparmor;
- c99 is not enough, otherwise the build fails with errors like:
kernel.c:503:15: error: expected declaration specifiers or ‘...’ before ‘(’ token
extern typeof((__change_hat)) __old_change_hat __attribute__((alias ("__change_hat")));
^
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
[yann.morin.1998@free.fr: strip down the patch to only build the lib]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Tested-by: Angelo Compagnucci <angelo@amarulasolutions.com>
2020-03-27 10:29:05 +01:00
|
|
|
$(eval $(autotools-package))
|