34c186e62e9f901d1211dcb0bd2e04615eb306f1
[openwrt/staging/ynezz.git] / package / utils / policycoreutils / 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:=policycoreutils
9 PKG_VERSION:=3.1
10 PKG_RELEASE:=2
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:=c889f62ee80f8b6a369469a9b8af51f5b797975aeaa291f5c5960cc12eed1934
15 PKG_INSTALL:=1
16 HOST_BUILD_DEPENDS:=libsemanage/host
17 PKG_BUILD_DEPENDS:=BUSYBOX_CONFIG_PAM:libpam
18
19 PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
20 PKG_CPE_ID:=cpe:/a:selinuxproject:policycoreutils
21 PKG_LICENSE:=GPL-2.0-or-later
22 PKG_LICENSE_FILES:=COPYING
23
24 include $(INCLUDE_DIR)/package.mk
25 include $(INCLUDE_DIR)/nls.mk
26
27 define Package/policycoreutils
28 SECTION:=utils
29 CATEGORY:=Utilities
30 DEPENDS:= +libsemanage +libcap-ng +BUSYBOX_CONFIG_PAM:libpam $(INTL_DEPENDS)
31 TITLE:=SELinux policy utilities
32 URL:=http://selinuxproject.org/page/Main_Page
33 ALTERNATIVES:=\
34 300:/sbin/restorecon:policycoreutils-restorecon \
35 300:/sbin/setfiles:policycoreutils-setfiles \
36 300:/usr/sbin/load_policy:policycoreutils-load_policy \
37 300:/usr/sbin/sestatus:policycoreutils-sestatus \
38 300:/usr/sbin/setsebool:policycoreutils-setsebool
39 endef
40
41 define Package/policycoreutils/description
42 Policycoreutils is a collection of policy utilities
43 (originally the "core" set of utilities needed to use
44 SELinux, although it has grown a bit over time), which have
45 different dependencies. sestatus, secon, run_init, and
46 newrole only use libselinux. load_policy and setfiles only
47 use libselinux and libsepol. semodule and semanage use
48 libsemanage (and thus bring in dependencies on libsepol and
49 libselinux as well). setsebool uses libselinux to make
50 non-persistent boolean changes (via the kernel interface)
51 and uses libsemanage to make persistent boolean changes.
52 endef
53
54 include $(INCLUDE_DIR)/host-build.mk
55
56 HOST_MAKE_FLAGS += \
57 PAMH=$(CONFIG_BUSYBOX_CONFIG_PAM) \
58 PREFIX=$(STAGING_DIR_HOSTPKG) \
59 SBINDIR=$(STAGING_DIR_HOSTPKG)/sbin \
60 ETCDIR=$(STAGING_DIR_HOSTPKG)/etc
61
62 MAKE_FLAGS += \
63 PAMH=$(CONFIG_BUSYBOX_CONFIG_PAM)
64
65 define Package/policycoreutils/install
66 $(INSTALL_DIR) $(1)/sbin
67 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/restorecon_xattr $(1)/sbin/restorecon_xattr
68 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/restorecon $(1)/sbin/policycoreutils-restorecon
69 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/setfiles $(1)/sbin/policycoreutils-setfiles
70 $(INSTALL_DIR) $(1)/usr/sbin
71 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fixfiles $(1)/usr/sbin/
72 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/genhomedircon $(1)/usr/sbin/
73 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/open_init_pty $(1)/usr/sbin/
74 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/run_init $(1)/usr/sbin/
75 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/semodule $(1)/usr/sbin/
76 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/load_policy $(1)/usr/sbin/policycoreutils-load_policy
77 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/sestatus $(1)/usr/sbin/policycoreutils-sestatus
78 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/setsebool $(1)/usr/sbin/policycoreutils-setsebool
79 $(INSTALL_DIR) $(1)/usr/bin
80 $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
81 endef
82
83 $(eval $(call HostBuild))
84 $(eval $(call BuildPackage,policycoreutils))