From: Ladislav Michl <[email protected]>

This partially reverts commit a7faf563f3149944b772a0e7c9540c03867d29dd.

Signed-off-by: Ladislav Michl <[email protected]>
---
 rules/policycoreutils.in   | 111 ++++++++++++++++++++++++++
 rules/policycoreutils.make | 159 +++++++++++++++++++++++++++++++++++++
 2 files changed, 270 insertions(+)
 create mode 100644 rules/policycoreutils.in
 create mode 100644 rules/policycoreutils.make

diff --git a/rules/policycoreutils.in b/rules/policycoreutils.in
new file mode 100644
index 000000000..fce42b002
--- /dev/null
+++ b/rules/policycoreutils.in
@@ -0,0 +1,111 @@
+## SECTION=staging
+## old section:
+### SECTION=selinux
+
+menuconfig POLICYCOREUTILS
+       tristate
+       prompt "policycoreutils               "
+       select LIBCAP_NG
+       select LIBCGROUP
+       select LIBSELINUX
+       select LIBSEMANAGE
+       select LIBSEPOL
+       select DBUS_GLIB        if POLICYCOREUTILS_RESTORECOND
+       select BUSYBOX_FEATURE_FIND_DEPTH       if BUSYBOX_FIND
+       select BUSYBOX_FEATURE_FIND_DELETE      if BUSYBOX_FIND
+       select BUSYBOX_SELINUX                  if BUSYBOX_FIND
+       select BUSYBOX_FEATURE_FIND_CONTEXT     if BUSYBOX_FIND
+       help
+         This package contains the core policy utilities that are required
+         for basic operation of an SELinux system.  These utilities include
+         load_policy to load policies, setfiles to label filesystems, newrole
+         to switch roles, and run_init to run /etc/init.d scripts in the proper
+         context.
+
+         STAGING: remove in ptxdist-2020.12.0
+         Old version that need to be updated. Moved to staging with libselinux.
+
+if POLICYCOREUTILS
+
+menuconfig POLICYCOREUTILS_PYTHON
+       # needs sepolgen
+       depends on BROKEN
+       bool "python based tools"
+
+if POLICYCOREUTILS_PYTHON
+
+config POLICYCOREUTILS_AUDIT2ALLOW
+       bool "audit2allow"
+
+config POLICYCOREUTILS_SEPOLGEN_IFGEN
+       select POLICYCOREUTILS_AUDIT2ALLOW
+       bool "sepolgen-ifgen"
+
+config POLICYCOREUTILS_AUDIT2WHY
+       select POLICYCOREUTILS_AUDIT2ALLOW
+       bool "audit2why"
+
+config POLICYCOREUTILS_SANDBOX
+       bool "sandbox"
+       depends on BROKEN
+
+config POLICYCOREUTILS_CHCAT
+       select LIBSEMANAGE_PYTHON
+       depends on BROKEN
+       bool "chcat"
+
+config POLICYCOREUTILS_SEMANAGE
+       select LIBSEMANAGE_PYTHON
+       depends on BROKEN
+       bool "semanage"
+
+endif
+
+config POLICYCOREUTILS_LOAD_POLICY
+       bool "load_policy"
+
+config POLICYCOREUTILS_NEWROLE
+       bool "newrole"
+
+config POLICYCOREUTILS_RESTORECOND
+       bool "restorecond"
+       depends on BROKEN
+
+config POLICYCOREUTILS_RUN_INIT
+       bool "run_init/open_init_pty"
+
+config POLICYCOREUTILS_FIXFILES
+       bool "fixfiles"
+
+config POLICYCOREUTILS_GENHOMEDIRCON
+       select POLICYCOREUTILS_SEMODULE
+       bool "genhomedircon"
+
+config POLICYCOREUTILS_SECON
+       bool "secon"
+
+config POLICYCOREUTILS_SEMODULE
+       bool "semodule"
+
+config POLICYCOREUTILS_SEMODULE_DEPS
+       bool "semodule_deps"
+
+config POLICYCOREUTILS_SEMODULE_EXPAND
+       bool "semodule_expand"
+
+config POLICYCOREUTILS_SEMODULE_LINK
+       bool "semodule_link"
+
+config POLICYCOREUTILS_SEMODULE_PACKAGE
+       bool "semodule_package"
+
+config POLICYCOREUTILS_SESTATUS
+       bool "sestatus"
+
+config POLICYCOREUTILS_SETFILES
+       bool "setfiles/restorecon"
+
+config POLICYCOREUTILS_SETSEBOOL
+       bool "setsebool"
+
+endif
diff --git a/rules/policycoreutils.make b/rules/policycoreutils.make
new file mode 100644
index 000000000..07baaebe8
--- /dev/null
+++ b/rules/policycoreutils.make
@@ -0,0 +1,159 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2012 by Wolfram Sang <[email protected]>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_POLICYCOREUTILS) += policycoreutils
+
+#
+# Paths and names
+#
+POLICYCOREUTILS_VERSION        := 2.1.13
+POLICYCOREUTILS_MD5    := 97c0b828599fe608f37894989820d71d
+POLICYCOREUTILS                := policycoreutils-$(POLICYCOREUTILS_VERSION)
+POLICYCOREUTILS_SUFFIX := tar.gz
+POLICYCOREUTILS_URL    := 
https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases/20120924/$(POLICYCOREUTILS).$(POLICYCOREUTILS_SUFFIX)
+POLICYCOREUTILS_SOURCE := 
$(SRCDIR)/$(POLICYCOREUTILS).$(POLICYCOREUTILS_SUFFIX)
+POLICYCOREUTILS_DIR    := $(BUILDDIR)/$(POLICYCOREUTILS)
+POLICYCOREUTILS_LICENSE        := GPL-2.0-or-later
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+POLICYCOREUTILS_SUBDIRS_y := \
+       man \
+       po \
+       scripts
+
+POLICYCOREUTILS_PROGS_y :=
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_AUDIT2ALLOW)         += 
audit2allow
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_AUDIT2ALLOW)           += 
/usr/bin/audit2allow
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_SEPOLGEN_IFGEN)      += 
sepolgen-ifgen
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_SEPOLGEN_IFGEN)                
+= /usr/bin/sepolgen-ifgen
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_SEPOLGEN_IFGEN)                
+= /usr/bin/sepolgen-ifgen-attr-helper
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_AUDIT2WHY)           += 
audit2why
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_AUDIT2WHY)             += 
/usr/bin/audit2why
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_LOAD_POLICY)         += 
load_policy
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_LOAD_POLICY)           += 
/usr/sbin/load_policy
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_NEWROLE)             += 
newrole
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_NEWROLE)               += 
/usr/bin/newrole
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_RESTORECOND)         += 
restorecond
+#POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_RESTORECOND)          +=
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_RUN_INIT)            += 
run_init
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_RUN_INIT)              += 
/usr/sbin/run_init
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_RUN_INIT)              += 
/usr/sbin/open_init_pty
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_SANDBOX)             += 
sandbox
+#POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_SANDBOX)              +=
+
+# no SUBDIRS needed for scripts
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_CHCAT)                 += 
/usr/bin/chcat
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_FIXFILES)              += 
/usr/sbin/fixfiles
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_GENHOMEDIRCON)         += 
/usr/sbin/genhomedircon
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_SECON)               += secon
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_SECON)                 += 
/usr/bin/secon
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_SEMANAGE)            += 
semanage
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_SEMANAGE)              += 
/usr/sbin/semanage
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_SEMODULE)            += 
semodule
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_SEMODULE)              += 
/usr/sbin/semodule
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_SEMODULE_DEPS)       += 
semodule_deps
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_SEMODULE_DEPS)         += 
/usr/bin/semodule_deps
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_SEMODULE_EXPAND)     += 
semodule_expand
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_SEMODULE_EXPAND)       += 
/usr/bin/semodule_expand
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_SEMODULE_LINK)       += 
semodule_link
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_SEMODULE_LINK)         += 
/usr/bin/semodule_link
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_SEMODULE_PACKAGE)    += 
semodule_package
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_SEMODULE_PACKAGE)      += 
/usr/bin/semodule_package
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_SEMODULE_PACKAGE)      += 
/usr/bin/semodule_unpackage
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_SESTATUS)            += 
sestatus
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_SESTATUS)              += 
/usr/sbin/sestatus
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_SETFILES)            += 
setfiles
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_SETFILES)              += 
/usr/sbin/setfiles
+
+POLICYCOREUTILS_SUBDIRS_$(PTXCONF_POLICYCOREUTILS_SETSEBOOL)           += 
setsebool
+POLICYCOREUTILS_PROGS_$(PTXCONF_POLICYCOREUTILS_SETSEBOOL)             += 
/usr/sbin/setsebool
+
+POLICYCOREUTILS_CONF_TOOL := NO
+
+# no ':=' because of $(PYTHON_SITEPACKAGES)
+POLICYCOREUTILS_MAKE_ENV = \
+       $(CROSS_ENV) \
+       SBINDIR=$(POLICYCOREUTILS_PKGDIR)/usr/sbin \
+       PYTHONLIBDIR=$(POLICYCOREUTILS_PKGDIR)$(PYTHON_SITEPACKAGES)/.. \
+       CFLAGS="-O2 -Wall" \
+       INOTIFYH="/usr/include/sys/inotify.h" \
+       PAMH="" \
+       AUDITH=""
+#
+# We don't have PAM or AUDIT, so turn off.
+#
+# Use the following to turn on:
+# (Use these paths, as of version 2.1.13)
+#
+# PAMH=/usr/include/security/pam_appl.h
+# AUDITH=/usr/include/libaudit.h
+#
+
+POLICYCOREUTILS_MAKE_OPT := \
+       SUBDIRS="$(POLICYCOREUTILS_SUBDIRS_y)" \
+       LIBDIR=$(PTXDIST_SYSROOT_TARGET)/usr/lib
+POLICYCOREUTILS_INSTALL_OPT := \
+       SUBDIRS="$(POLICYCOREUTILS_SUBDIRS_y)" \
+       install
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/policycoreutils.targetinstall:
+       @$(call targetinfo)
+
+       @$(call install_init, policycoreutils)
+       @$(call install_fixup, policycoreutils,PRIORITY,optional)
+       @$(call install_fixup, policycoreutils,SECTION,base)
+       @$(call install_fixup, policycoreutils,AUTHOR,"Wolfram Sang 
<[email protected]>")
+       @$(call install_fixup, policycoreutils,DESCRIPTION,missing)
+
+       @$(foreach prog, $(POLICYCOREUTILS_PROGS_y), \
+               $(call install_copy, policycoreutils, 0, 0, 0755, -, $(prog));)
+
+ifdef PTXCONF_POLICYCOREUTILS_SETFILES
+       @$(call install_link, policycoreutils, setfiles, /usr/sbin/restorecon)
+endif
+
+ifdef PTXCONF_POLICYCOREUTILS_SEMANAGE
+       @$(call install_copy, policycoreutils, 0, 0, 0644, -, 
$(PYTHON_SITEPACKAGES)/seobject.py)
+endif
+
+ifdef PTXCONF_POLICYCOREUTILS_SESTATUS
+       @$(call install_alternative, policycoreutils, 0, 0, 0644, 
/etc/sestatus.conf)
+endif
+
+       @$(call install_finish, policycoreutils)
+
+       @$(call touch)
+
+# vim: syntax=make
-- 
2.47.3


Reply via email to