restorecond.mk 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. ################################################################################
  2. #
  3. # restorecond
  4. #
  5. ################################################################################
  6. RESTORECOND_VERSION = 3.1
  7. RESTORECOND_SITE = https://github.com/SELinuxProject/selinux/releases/download/20200710
  8. RESTORECOND_LICENSE = GPL-2.0
  9. RESTORECOND_LICENSE_FILES = COPYING
  10. RESTORECOND_DEPENDENCIES = libglib2 libsepol libselinux dbus-glib
  11. # Undefining _FILE_OFFSET_BITS here because of a "bug" with glibc fts.h
  12. # large file support.
  13. # See https://bugzilla.redhat.com/show_bug.cgi?id=574992 for more information
  14. RESTORECOND_MAKE_OPTS += \
  15. $(TARGET_CONFIGURE_OPTS) \
  16. CFLAGS="$(TARGET_CFLAGS) -U_FILE_OFFSET_BITS" \
  17. CPPFLAGS="$(TARGET_CPPFLAGS) -U_FILE_OFFSET_BITS" \
  18. ARCH="$(BR2_ARCH)"
  19. # We need to pass DESTDIR at build time because it's used by
  20. # restorecond build system to find headers and libraries.
  21. define RESTORECOND_BUILD_CMDS
  22. $(MAKE) -C $(@D) $(RESTORECOND_MAKE_OPTS) DESTDIR=$(STAGING_DIR) all
  23. endef
  24. define RESTORECOND_INSTALL_INIT_SYSV
  25. $(INSTALL) -m 0755 -D $(@D)/restorecond.init \
  26. $(TARGET_DIR)/etc/init.d/S20restorecond
  27. endef
  28. define RESTORECOND_INSTALL_INIT_SYSTEMD
  29. $(INSTALL) -m 0644 -D $(@D)/restorecond.service \
  30. $(TARGET_DIR)/usr/lib/systemd/system/restorecond.service
  31. mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
  32. ln -fs ../../../../usr/lib/systemd/system/restorecond.service \
  33. $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/restorecond.service
  34. $(INSTALL) -m 0600 -D $(@D)/org.selinux.Restorecond.service \
  35. $(TARGET_DIR)/etc/systemd/system/org.selinux.Restorecond.service
  36. endef
  37. define RESTORECOND_INSTALL_TARGET_CMDS
  38. $(INSTALL) -m 0644 -D $(@D)/restorecond.conf $(TARGET_DIR)/etc/selinux/restorecond.conf
  39. $(INSTALL) -m 0644 -D $(@D)/restorecond_user.conf $(TARGET_DIR)/etc/selinux/restorecond_user.conf
  40. $(INSTALL) -m 0755 -D $(@D)/restorecond $(TARGET_DIR)/usr/sbin/restorecond
  41. endef
  42. $(eval $(generic-package))