2a6bd46ad0a10b2cc9f7995c67216eb2ef64ef78
[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 HOST_MAKE_FLAGS += \
34 PREFIX=$(STAGING_DIR_HOSTPKG) \
35 SHLIBDIR=$(STAGING_DIR_HOSTPKG)/lib
36
37 MAKE_FLAGS += \
38 SHLIBDIR=/usr/lib \
39 OS=Linux
40
41 define Build/Compile
42 $(call Build/Compile/Default,all)
43 endef
44
45 define Build/Install
46 $(call Build/Install/Default,install)
47 endef
48
49 define Build/InstallDev
50 $(INSTALL_DIR) $(1)/usr/include
51 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
52 $(INSTALL_DIR) $(1)/usr/lib
53 $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
54 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
55 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsepol.pc $(1)/usr/lib/pkgconfig/
56 $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libsepol.pc
57 $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libsepol.pc
58 endef
59
60 define Package/libsepol/install
61 $(INSTALL_DIR) $(1)/usr/lib
62 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsepol.so.* $(1)/usr/lib/
63 endef
64
65 $(eval $(call HostBuild))
66 $(eval $(call BuildPackage,libsepol))