2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
6 include $(TOPDIR
)/rules.mk
12 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
13 PKG_SOURCE_URL
:=https
://github.com
/SELinuxProject
/selinux
/releases
/download
/$(PKG_VERSION
)
14 PKG_HASH
:=acfdee27633d2496508c28727c3d41d3748076f66d42fccde2e6b9f3463a7057
15 HOST_BUILD_DEPENDS
:=libsepol
/host pcre
/host
17 PKG_LICENSE
:=libselinux-1.0
18 PKG_LICENSE_FILES
:=LICENSE
19 PKG_MAINTAINER
:=Thomas Petazzoni
<thomas.petazzoni@bootlin.com
>
21 include $(INCLUDE_DIR
)/package.mk
22 include $(INCLUDE_DIR
)/host-build.mk
41 selabel_get_digests_all_partial_matches \
43 selabel_lookup_best_match \
44 selabel_partial_match \
45 selinux_check_access \
46 selinux_check_securetty_context \
61 $(eval
$(foreach a
,$(LIBSELINUX_ALTS
),ALTS_
$(a
):=300:/usr
/sbin
/$(a
):/usr
/sbin
/libselinux-
$(a
)$(newline
)))
63 define Package
/libselinux
/Default
64 TITLE
:=Runtime SELinux library
65 URL
:=http
://selinuxproject.org
/page
/Main_Page
68 define Package
/libselinux
69 $(call Package
/libselinux
/Default
)
72 DEPENDS
:=+libsepol
+libpcre
+USE_MUSL
:musl-fts
75 define Package
/libselinux
/description
76 libselinux is the runtime SELinux library that provides
77 interfaces
(e.g. library functions for the SELinux kernel
78 APIs like getcon
(), other support functions like
79 getseuserbyname
()) to SELinux-aware applications. libselinux
80 may use the shared libsepol to manipulate the binary policy
81 if necessary
(e.g. to downgrade the policy format to an
82 older version supported by the kernel
) when loading policy.
87 $(call Package
/libselinux
/Default
)
92 SUBMENU
:=libselinux tools
93 ALTERNATIVES
:=$(ALTS_
$(2))
96 define Package
/$(1)/description
97 libselinux version of the
$(2) utility.
101 $(foreach a
,$(LIBSELINUX_UTILS
),$(eval
$(call GenUtilPkg
,libselinux-
$(a
),$(a
))))
103 # Needed to link libselinux utilities, which link against
104 # libselinux.so, which indirectly depends on libpcre.so, installed in
105 # $(STAGING_DIR_HOSTPKG).
106 HOST_LDFLAGS
+= -Wl
,-rpath
="$(STAGING_DIR_HOSTPKG)/lib"
109 PREFIX
=$(STAGING_DIR_HOSTPKG
) \
110 SHLIBDIR
=$(STAGING_DIR_HOSTPKG
)/lib
112 ifeq ($(CONFIG_USE_MUSL
),y
)
113 MAKE_FLAGS
+= FTS_LDLIBS
=-lfts
121 $(call Build
/Compile
/Default
,all)
125 $(call Build
/Install
/Default
,install)
128 define Build
/InstallDev
129 $(INSTALL_DIR
) $(1)/usr
/include
130 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/* $(1)/usr
/include/
131 $(INSTALL_DIR
) $(1)/usr
/lib
132 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/* $(1)/usr
/lib
/
133 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
134 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libselinux.
pc $(1)/usr
/lib
/pkgconfig
/
135 $(SED
) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr
/lib
/pkgconfig
/libselinux.
pc
136 $(SED
) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr
/lib
/pkgconfig
/libselinux.
pc
139 define Package
/libselinux
/install
140 $(INSTALL_DIR
) $(1)/usr
/lib
141 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libselinux.so.
* $(1)/usr
/lib
/
145 define Package
/$(1)/install
146 $(INSTALL_DIR
) $$(1)/usr
/sbin
147 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/sbin
/$(2) $$(1)/usr
/sbin
/$(if
$(ALTS_
$(2)),libselinux-
$(2),$(2))
150 $$(eval
$$(call BuildPackage
,$(1)))
153 $(eval
$(call HostBuild
))
154 $(eval
$(call BuildPackage
,libselinux
))
155 $(foreach a
,$(LIBSELINUX_UTILS
),$(eval
$(call BuildUtil
,libselinux-
$(a
),$(a
))))