8ceb7164a71d4fa46f9c20901727e7f9ee23c293
[openwrt/openwrt.git] / package / libs / libsepol / Makefile
1 #
2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
4 #
5
6 include $(TOPDIR)/rules.mk
7
8 PKG_NAME:=libsepol
9 PKG_VERSION:=3.1
10 PKG_RELEASE:=1
11
12 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
13 PKG_SOURCE_URL:=https://github.com/SELinuxProject/selinux/releases/download/20200710
14 PKG_HASH:=ae6778d01443fdd38cd30eeee846494e19f4d407b09872580372f4aa4bf8a3cc
15
16 PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
17
18 include $(INCLUDE_DIR)/package.mk
19 include $(INCLUDE_DIR)/host-build.mk
20
21 define Package/libsepol
22 SECTION:=libs
23 CATEGORY:=Libraries
24 TITLE:=SELinux binary policy manipulation library
25 URL:=http://selinuxproject.org/page/Main_Page
26 endef
27
28 define Package/libsepol/description
29 Libsepol is the binary policy manipulation library. It doesn't
30 depend upon or use any of the other SELinux components.
31 endef
32
33 define Package/chkcon
34 SECTION:=utils
35 CATEGORY:=Utilities
36 DEPENDS:=+libsepol
37 TITLE:=libsepol chkcon security context validation tool
38 URL:=http://selinuxproject.org/page/Main_Page
39 endef
40
41 define Package/chkcon/description
42 chkcon - determine if a security context is valid for a given binary policy
43 endef
44
45 HOST_MAKE_FLAGS += \
46 PREFIX=$(STAGING_DIR_HOSTPKG) \
47 SHLIBDIR=$(STAGING_DIR_HOSTPKG)/lib
48
49 MAKE_FLAGS += \
50 SHLIBDIR=/usr/lib \
51 OS=Linux
52
53 define Build/Compile
54 $(call Build/Compile/Default,all)
55 endef
56
57 define Build/Install
58 $(call Build/Install/Default,install)
59 endef
60
61 define Build/InstallDev
62 $(INSTALL_DIR) $(1)/usr/include
63 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
64 $(INSTALL_DIR) $(1)/usr/lib
65 $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
66 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
67 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsepol.pc $(1)/usr/lib/pkgconfig/
68 $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libsepol.pc
69 $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libsepol.pc
70 endef
71
72 define Package/libsepol/install
73 $(INSTALL_DIR) $(1)/usr/lib
74 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsepol.so.* $(1)/usr/lib/
75 endef
76
77 define Package/chkcon/install
78 $(INSTALL_DIR) $(1)/usr/bin
79 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/chkcon $(1)/usr/bin/
80 endef
81
82 $(eval $(call HostBuild))
83 $(eval $(call BuildPackage,libsepol))
84 $(eval $(call BuildPackage,chkcon))