configs: mx53loco: Bump U-Boot version to 2016.07
[buildroot-gz.git] / package / libselinux / libselinux.mk
blob6f9417321afe4ac2dddccc2db27ba393035e6aa1
1 ################################################################################
3 # libselinux
5 ################################################################################
7 LIBSELINUX_VERSION = 2.5
8 LIBSELINUX_SITE = https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20160223
9 LIBSELINUX_LICENSE = Public Domain
10 LIBSELINUX_LICENSE_FILES = LICENSE
12 LIBSELINUX_DEPENDENCIES = libsepol pcre
14 LIBSELINUX_INSTALL_STAGING = YES
16 # Filter out D_FILE_OFFSET_BITS=64. This fixes errors caused by glibc 2.22.
17 LIBSELINUX_MAKE_OPTS = \
18 $(TARGET_CONFIGURE_OPTS) \
19 CFLAGS="$(filter-out -D_FILE_OFFSET_BITS=64,$(TARGET_CFLAGS))" \
20 LDFLAGS="$(TARGET_LDFLAGS) -lpcre -lpthread" \
21 ARCH=$(KERNEL_ARCH)
23 define LIBSELINUX_BUILD_CMDS
24 # DESTDIR is needed during the compile to compute library and
25 # header paths.
26 $(MAKE) -C $(@D) $(LIBSELINUX_MAKE_OPTS) DESTDIR=$(STAGING_DIR) all
27 endef
29 define LIBSELINUX_INSTALL_STAGING_CMDS
30 $(MAKE) -C $(@D) $(LIBSELINUX_MAKE_OPTS) DESTDIR=$(STAGING_DIR) install
31 endef
33 define LIBSELINUX_INSTALL_TARGET_CMDS
34 $(MAKE) -C $(@D) $(LIBSELINUX_MAKE_OPTS) DESTDIR=$(TARGET_DIR) install
35 # Create the selinuxfs mount point
36 if [ ! -d "$(TARGET_DIR)/selinux" ]; then mkdir $(TARGET_DIR)/selinux; fi
37 if ! grep -q "selinuxfs" $(TARGET_DIR)/etc/fstab; then \
38 echo "none /selinux selinuxfs noauto 0 0" >> $(TARGET_DIR)/etc/fstab ; fi
39 endef
41 HOST_LIBSELINUX_DEPENDENCIES = \
42 host-libsepol host-pcre host-swig
44 ifeq ($(BR2_PACKAGE_PYTHON3),y)
45 HOST_LIBSELINUX_DEPENDENCIES += host-python3
46 HOST_LIBSELINUX_PYTHONLIBDIR = -L$(HOST_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/
47 HOST_LIBSELINUX_PYINC = -I$(HOST_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR)m/
48 HOST_LIBSELINUX_PYLIBVER = python$(PYTHON3_VERSION_MAJOR)
49 else
50 HOST_LIBSELINUX_DEPENDENCIES += host-python
51 HOST_LIBSELINUX_PYTHONLIBDIR = -L$(HOST_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/
52 HOST_LIBSELINUX_PYINC = -I$(HOST_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR)/
53 HOST_LIBSELINUX_PYLIBVER = python$(PYTHON_VERSION_MAJOR)
54 endif
56 HOST_LIBSELINUX_MAKE_OPTS = \
57 $(HOST_CONFIGURE_OPTS) \
58 LDFLAGS="$(HOST_LDFLAGS) -lpcre -lpthread" \
59 PYINC="$(HOST_LIBSELINUX_PYINC)" \
60 PYTHONLIBDIR="$(HOST_LIBSELINUX_PYTHONLIBDIR)" \
61 PYLIBVER="$(HOST_LIBSELINUX_PYLIBVER)" \
62 SWIG_LIB="$(HOST_DIR)/usr/share/swig/$(SWIG_VERSION)/"
64 define HOST_LIBSELINUX_BUILD_CMDS
65 # DESTDIR is needed during the compile to compute library and
66 # header paths.
67 $(MAKE1) -C $(@D) $(HOST_LIBSELINUX_MAKE_OPTS) DESTDIR=$(HOST_DIR) \
68 SHLIBDIR=$(HOST_DIR)/usr/lib all
69 # Generate python interface wrapper
70 $(MAKE1) -C $(@D) $(HOST_LIBSELINUX_MAKE_OPTS) DESTDIR=$(HOST_DIR) swigify pywrap
71 endef
73 define HOST_LIBSELINUX_INSTALL_CMDS
74 $(MAKE) -C $(@D) $(HOST_LIBSELINUX_MAKE_OPTS) DESTDIR=$(HOST_DIR) \
75 SHLIBDIR=$(HOST_DIR)/usr/lib SBINDIR=$(HOST_DIR)/usr/sbin install
76 (cd $(HOST_DIR)/usr/lib; $(HOSTLN) -sf libselinux.so.1 libselinux.so)
77 # Install python interface wrapper
78 $(MAKE) -C $(@D) $(HOST_LIBSELINUX_MAKE_OPTS) DESTDIR=$(HOST_DIR) install-pywrap
79 endef
81 $(eval $(generic-package))
82 $(eval $(host-generic-package))