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
/20200710
14 PKG_HASH
:=ea5dcbb4d859e3f999c26a13c630da2f16dff9462e3cc8cb7b458ac157d112e7
15 HOST_BUILD_DEPENDS
:=libsepol
/host pcre
/host
17 PKG_MAINTAINER
:=Thomas Petazzoni
<thomas.petazzoni@bootlin.com
>
19 include $(INCLUDE_DIR
)/package.mk
21 define Package
/libselinux
23 DEPENDS
:=+libsepol
+libpcre
+musl-fts
25 TITLE
:=Runtime SELinux library
26 URL
:=http
://selinuxproject.org
/page
/Main_Page
29 define Package
/libselinux
/description
30 libselinux is the runtime SELinux library that provides
31 interfaces
(e.g. library functions for the SELinux kernel
32 APIs like getcon
(), other support functions like
33 getseuserbyname
()) to SELinux-aware applications. libselinux
34 may use the shared libsepol to manipulate the binary policy
35 if necessary
(e.g. to downgrade the policy format to an
36 older version supported by the kernel
) when loading policy.
39 include $(INCLUDE_DIR
)/host-build.mk
41 # Needed to link libselinux utilities, which link against
42 # libselinux.so, which indirectly depends on libpcre.so, installed in
43 # $(STAGING_DIR_HOSTPKG).
44 HOST_LDFLAGS
+= -Wl
,-rpath
="$(STAGING_DIR_HOSTPKG)/lib"
47 PREFIX
=$(STAGING_DIR_HOSTPKG
) \
48 SHLIBDIR
=$(STAGING_DIR_HOSTPKG
)/lib
56 $(call Build
/Compile
/Default
,all)
60 $(call Build
/Install
/Default
,install)
63 define Build
/InstallDev
64 $(INSTALL_DIR
) $(1)/usr
/include
65 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/* $(1)/usr
/include/
66 $(INSTALL_DIR
) $(1)/usr
/lib
67 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/* $(1)/usr
/lib
/
68 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
69 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libselinux.
pc $(1)/usr
/lib
/pkgconfig
/
70 $(SED
) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr
/lib
/pkgconfig
/libselinux.
pc
71 $(SED
) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr
/lib
/pkgconfig
/libselinux.
pc
74 define Package
/libselinux
/install
75 $(INSTALL_DIR
) $(1)/usr
/lib
76 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libselinux.so.
* $(1)/usr
/lib
/
79 $(eval
$(call HostBuild
))
80 $(eval
$(call BuildPackage
,libselinux
))