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
20 include $(INCLUDE_DIR
)/host-build.mk
22 define Package
/libselinux
24 DEPENDS
:=+libsepol
+libpcre
+musl-fts
26 TITLE
:=Runtime SELinux library
27 URL
:=http
://selinuxproject.org
/page
/Main_Page
30 define Package
/libselinux
/description
31 libselinux is the runtime SELinux library that provides
32 interfaces
(e.g. library functions for the SELinux kernel
33 APIs like getcon
(), other support functions like
34 getseuserbyname
()) to SELinux-aware applications. libselinux
35 may use the shared libsepol to manipulate the binary policy
36 if necessary
(e.g. to downgrade the policy format to an
37 older version supported by the kernel
) when loading policy.
40 define Package
/libselinux-utils
44 TITLE
:=Runtime SELinux utilities
45 URL
:=http
://selinuxproject.org
/page
/Main_Page
48 # Needed to link libselinux utilities, which link against
49 # libselinux.so, which indirectly depends on libpcre.so, installed in
50 # $(STAGING_DIR_HOSTPKG).
51 HOST_LDFLAGS
+= -Wl
,-rpath
="$(STAGING_DIR_HOSTPKG)/lib"
54 PREFIX
=$(STAGING_DIR_HOSTPKG
) \
55 SHLIBDIR
=$(STAGING_DIR_HOSTPKG
)/lib
63 $(call Build
/Compile
/Default
,all)
67 $(call Build
/Install
/Default
,install)
70 define Build
/InstallDev
71 $(INSTALL_DIR
) $(1)/usr
/include
72 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/* $(1)/usr
/include/
73 $(INSTALL_DIR
) $(1)/usr
/lib
74 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/* $(1)/usr
/lib
/
75 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
76 $(INSTALL_DATA
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libselinux.
pc $(1)/usr
/lib
/pkgconfig
/
77 $(SED
) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr
/lib
/pkgconfig
/libselinux.
pc
78 $(SED
) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr
/lib
/pkgconfig
/libselinux.
pc
81 define Package
/libselinux
/install
82 $(INSTALL_DIR
) $(1)/usr
/lib
83 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libselinux.so.
* $(1)/usr
/lib
/
86 define Package
/libselinux-utils
/install
87 $(INSTALL_DIR
) $(1)/usr
/sbin
88 $(CP
) $(PKG_INSTALL_DIR
)/usr
/sbin
/* $(1)/usr
/sbin
91 $(eval
$(call HostBuild
))
92 $(eval
$(call BuildPackage
,libselinux
))
93 $(eval
$(call BuildPackage
,libselinux-utils
))