restorecond.mk 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ################################################################################
  2. #
  3. # restorecond
  4. #
  5. ################################################################################
  6. RESTORECOND_VERSION = 3.5
  7. RESTORECOND_SITE = https://github.com/SELinuxProject/selinux/releases/download/$(RESTORECOND_VERSION)
  8. RESTORECOND_LICENSE = GPL-2.0
  9. RESTORECOND_LICENSE_FILES = LICENSE
  10. RESTORECOND_DEPENDENCIES = libglib2 libsepol libselinux dbus-glib
  11. RESTORECOND_MAKE_OPTS += \
  12. $(TARGET_CONFIGURE_OPTS) \
  13. ARCH="$(BR2_ARCH)"
  14. # We need to pass DESTDIR at build time because it's used by
  15. # restorecond build system to find headers and libraries.
  16. define RESTORECOND_BUILD_CMDS
  17. $(MAKE) -C $(@D) $(RESTORECOND_MAKE_OPTS) DESTDIR=$(STAGING_DIR) all
  18. endef
  19. define RESTORECOND_INSTALL_INIT_SYSV
  20. $(INSTALL) -m 0755 -D package/restorecond/S02restorecond \
  21. $(TARGET_DIR)/etc/init.d/S02restorecond
  22. endef
  23. define RESTORECOND_INSTALL_INIT_SYSTEMD
  24. $(INSTALL) -m 0644 -D $(@D)/restorecond.service \
  25. $(TARGET_DIR)/usr/lib/systemd/system/restorecond.service
  26. mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
  27. ln -fs ../../../../usr/lib/systemd/system/restorecond.service \
  28. $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/restorecond.service
  29. $(INSTALL) -m 0600 -D $(@D)/org.selinux.Restorecond.service \
  30. $(TARGET_DIR)/etc/systemd/system/org.selinux.Restorecond.service
  31. endef
  32. define RESTORECOND_INSTALL_TARGET_CMDS
  33. $(INSTALL) -m 0644 -D $(@D)/restorecond.conf $(TARGET_DIR)/etc/selinux/restorecond.conf
  34. $(INSTALL) -m 0644 -D $(@D)/restorecond_user.conf $(TARGET_DIR)/etc/selinux/restorecond_user.conf
  35. $(INSTALL) -m 0755 -D $(@D)/restorecond $(TARGET_DIR)/usr/sbin/restorecond
  36. endef
  37. $(eval $(generic-package))