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
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# apparmor
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
# When updating the version here, please also update the libapparmor package
|
2020-10-11 18:11:53 +02:00
|
|
|
APPARMOR_VERSION_MAJOR = 3.0
|
2021-08-10 00:31:47 +02:00
|
|
|
APPARMOR_VERSION = $(APPARMOR_VERSION_MAJOR).3
|
2021-02-06 19:54:09 +01:00
|
|
|
APPARMOR_SITE = https://launchpad.net/apparmor/$(APPARMOR_VERSION_MAJOR)/$(APPARMOR_VERSION)/+download
|
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
|
|
|
APPARMOR_DL_SUBDIR = libapparmor
|
|
|
|
APPARMOR_LICENSE = GPL-2.0
|
|
|
|
APPARMOR_LICENSE_FILES = LICENSE parser/COPYING.GPL
|
2021-01-21 14:36:50 +01:00
|
|
|
APPARMOR_CPE_ID_VENDOR = canonical
|
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
|
|
|
|
|
|
|
APPARMOR_DEPENDENCIES = libapparmor
|
|
|
|
|
|
|
|
APPARMOR_TOOLS = parser
|
2020-04-29 23:18:40 +02:00
|
|
|
APPARMOR_MAKE_OPTS = USE_SYSTEM=1 DISTRO=unknown POD2MAN=true POD2HTML=true
|
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
|
|
|
|
2020-04-25 16:03:56 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_GETTEXT_PROVIDES_LIBINTL),y)
|
|
|
|
APPARMOR_DEPENDENCIES += gettext
|
|
|
|
APPARMOR_MAKE_OPTS += WITH_LIBINTL=1
|
|
|
|
endif
|
|
|
|
|
2020-03-27 22:13:14 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_APPARMOR_BINUTILS),y)
|
|
|
|
APPARMOR_TOOLS += binutils
|
|
|
|
endif
|
|
|
|
|
package/apparmor: add options to install utils
Most utilities are written in python3, except a few that are written in
a mixture of POSIX shell, bash, perl and awk.
The Makefile does not allow installing parts of it, but requiring all of
python3, bash, and perl to install the utils is too much of a
requirement.
Instead, we split the set in two, on one hand the python ones, which we
install when python3 is enabled, and on the other hand, the rest of the
script which we call 'extras', and which we install when all the extra
requirements (bash, perl, and busybox or gawk) are met; if not, then we
remove these extras utils as a post-install hook.
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
[yann.morin.1998@free.fr:
- split into its own patch
- re-arrange the conditions
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Tested-by: Angelo Compagnucci <angelo@amarulasolutions.com>
2020-03-29 09:55:01 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_APPARMOR_UTILS),y)
|
|
|
|
APPARMOR_DEPENDENCIES += host-python3 python3
|
|
|
|
APPARMOR_TOOLS += utils
|
|
|
|
APPARMOR_MAKE_OPTS += PYTHON=$(HOST_DIR)/bin/python3
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_APPARMOR_UTILS_EXTRA),)
|
|
|
|
define APPARMOR_UTILS_NO_EXTRA
|
|
|
|
$(Q)rm -f $(addprefix $(TARGET_DIR)/usr/sbin/,aa-decode aa-notify aa-remove-unknown)
|
|
|
|
endef
|
|
|
|
APPARMOR_POST_INSTALL_TARGET_HOOKS += APPARMOR_UTILS_NO_EXTRA
|
|
|
|
endif # BR2_PACKAGE_APPARMOR_UTILS_EXTRA
|
|
|
|
|
|
|
|
endif # BR2_PACKAGE_APPARMOR_UTILS
|
|
|
|
|
2020-03-28 09:28:08 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_APPARMOR_PROFILES),y)
|
|
|
|
APPARMOR_TOOLS += profiles
|
|
|
|
endif
|
|
|
|
|
2020-03-29 12:35:22 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
|
|
|
|
APPARMOR_DEPENDENCIES += linux-pam
|
|
|
|
APPARMOR_TOOLS += changehat/pam_apparmor
|
|
|
|
endif
|
|
|
|
|
2020-03-29 12:39:28 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_APACHE),y)
|
|
|
|
APPARMOR_DEPENDENCIES += apache
|
|
|
|
APPARMOR_TOOLS += changehat/mod_apparmor
|
|
|
|
APPARMOR_MAKE_OPTS += APXS=$(STAGING_DIR)/usr/bin/apxs
|
2020-09-05 23:47:36 +02:00
|
|
|
|
|
|
|
ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
|
|
|
|
define APPARMOR_FIXUP_APXS
|
|
|
|
$(SED) "s@$(PER_PACKAGE_DIR)/[^/]\+/@$(PER_PACKAGE_DIR)/apparmor/@g" \
|
|
|
|
$(STAGING_DIR)/usr/bin/apxs \
|
2021-11-17 18:31:52 +01:00
|
|
|
$(STAGING_DIR)/usr/build/config_vars.mk \
|
|
|
|
$(STAGING_DIR)/usr/build-1/libtool
|
2020-09-05 23:47:36 +02:00
|
|
|
endef
|
|
|
|
APPARMOR_POST_CONFIGURE_HOOKS += APPARMOR_FIXUP_APXS
|
|
|
|
endif
|
2020-03-29 12:39:28 +02:00
|
|
|
endif
|
|
|
|
|
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
|
|
|
define APPARMOR_BUILD_CMDS
|
|
|
|
$(foreach tool,$(APPARMOR_TOOLS),\
|
|
|
|
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
|
|
|
|
$(MAKE) -C $(@D)/$(tool) $(APPARMOR_MAKE_OPTS)
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define APPARMOR_INSTALL_TARGET_CMDS
|
|
|
|
$(foreach tool,$(APPARMOR_TOOLS),\
|
|
|
|
$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
|
|
|
|
$(MAKE) -C $(@D)/$(tool) $(APPARMOR_MAKE_OPTS) \
|
|
|
|
DESTDIR=$(TARGET_DIR) install
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
|
|
|
# Despite its name, apparmor.systemd is a sysv-init compatible startup script
|
|
|
|
define APPARMOR_INSTALL_INIT_SYSV
|
|
|
|
$(INSTALL) -D -m 0755 $(@D)/parser/apparmor.systemd \
|
|
|
|
$(TARGET_DIR)/etc/init.d/S00apparmor
|
|
|
|
endef
|
|
|
|
|
|
|
|
define APPARMOR_INSTALL_INIT_SYSTEMD
|
|
|
|
$(INSTALL) -D -m 0755 $(@D)/parser/apparmor.systemd \
|
|
|
|
$(TARGET_DIR)/lib/apparmor/apparmor.systemd
|
2020-11-12 21:21:34 +01:00
|
|
|
$(INSTALL) -D -m 0644 $(@D)/parser/apparmor.service \
|
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
|
|
|
$(TARGET_DIR)/usr/lib/systemd/system/apparmor.service
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(generic-package))
|