libsepol: add PKG_CPE_ID
[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.3
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/$(PKG_VERSION)
14 PKG_HASH:=2d97df3eb8466169b389c3660acbb90c54200ac96e452eca9f41a9639f4f238b
15
16 PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
17 PKG_CPE_ID:=cpe:/a:selinuxproject:libsepol
18
19 include $(INCLUDE_DIR)/package.mk
20 include $(INCLUDE_DIR)/host-build.mk
21
22 define Package/libsepol
23 SECTION:=libs
24 CATEGORY:=Libraries
25 TITLE:=SELinux binary policy manipulation library
26 URL:=http://selinuxproject.org/page/Main_Page
27 endef
28
29 define Package/libsepol/description
30 Libsepol is the binary policy manipulation library. It doesn't
31 depend upon or use any of the other SELinux components.
32 endef
33
34 define Package/chkcon
35 SECTION:=utils
36 CATEGORY:=Utilities
37 DEPENDS:=+libsepol
38 TITLE:=libsepol chkcon security context validation tool
39 URL:=http://selinuxproject.org/page/Main_Page
40 endef
41
42 define Package/chkcon/description
43 chkcon - determine if a security context is valid for a given binary policy
44 endef
45
46 HOST_MAKE_FLAGS += \
47 PREFIX=$(STAGING_DIR_HOSTPKG) \
48 SHLIBDIR=$(STAGING_DIR_HOSTPKG)/lib
49
50 MAKE_FLAGS += \
51 SHLIBDIR=/usr/lib \
52 OS=Linux
53
54 define Build/Compile
55 $(call Build/Compile/Default,all)
56 endef
57
58 define Build/Install
59 $(call Build/Install/Default,install)
60 endef
61
62 define Build/InstallDev
63 $(INSTALL_DIR) $(1)/usr/include
64 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
65 $(INSTALL_DIR) $(1)/usr/lib
66 $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
67 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
68 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsepol.pc $(1)/usr/lib/pkgconfig/
69 $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libsepol.pc
70 $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libsepol.pc
71 endef
72
73 define Package/libsepol/install
74 $(INSTALL_DIR) $(1)/usr/lib
75 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsepol.so.* $(1)/usr/lib/
76 endef
77
78 define Package/chkcon/install
79 $(INSTALL_DIR) $(1)/usr/bin
80 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/chkcon $(1)/usr/bin/
81 endef
82
83 $(eval $(call HostBuild))
84 $(eval $(call BuildPackage,libsepol))
85 $(eval $(call BuildPackage,chkcon))