1 ################################################################################
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" \
23 define LIBSELINUX_BUILD_CMDS
24 # DESTDIR is needed during the compile to compute library and
26 $(MAKE
) -C
$(@D
) $(LIBSELINUX_MAKE_OPTS
) DESTDIR
=$(STAGING_DIR
) all
29 define LIBSELINUX_INSTALL_STAGING_CMDS
30 $(MAKE
) -C
$(@D
) $(LIBSELINUX_MAKE_OPTS
) DESTDIR
=$(STAGING_DIR
) install
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
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
)
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
)
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
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
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
81 $(eval
$(generic-package
))
82 $(eval
$(host-generic-package
))