diff --git a/libsepol-3.3.tar.gz b/libsepol-3.3.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..5066cade101e94feea3594b7e9078885bbff622f Binary files /dev/null and b/libsepol-3.3.tar.gz differ diff --git a/libsepol.spec b/libsepol.spec new file mode 100644 index 0000000000000000000000000000000000000000..1457762711b57d6d7b56f5310754dfda888eeeca --- /dev/null +++ b/libsepol.spec @@ -0,0 +1,91 @@ +%define anolis_release 1 + +Summary: SELinux binary policy manipulation library +Name: libsepol +Version: 3.3 +Release: %{anolis_release}%{?dist} +License: LGPLv2+ +Source0: https://github.com/SELinuxProject/selinux/releases/download/3.3/libsepol-3.3.tar.gz +URL: https://github.com/SELinuxProject/selinux/wiki + +BuildRequires: make +BuildRequires: gcc +BuildRequires: flex +Obsoletes: %{name}-compat = 3.1-4 + +%description +Security-enhanced Linux is a feature of the Linux® kernel and a number +of utilities with enhanced security functionality designed to add +mandatory access controls to Linux. The Security-enhanced Linux +kernel contains new architectural components originally developed to +improve the security of the Flask operating system. These +architectural components provide general support for the enforcement +of many kinds of mandatory access control policies, including those +based on the concepts of Type Enforcement®, Role-based Access +Control, and Multi-level Security. + +libsepol provides an API for the manipulation of SELinux binary policies. +It is used by checkpolicy (the policy compiler) and similar tools, as well +as by programs like load_policy that need to perform specific transformations +on binary policies such as customizing policy boolean settings. + +%package devel +Summary: Header files and libraries used to build policy manipulation tools +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +The libsepol-devel package contains the libraries and header files +needed for developing applications that manipulate binary policies. + +%package static +Summary: static libraries used to build policy manipulation tools +Requires: %{name}-devel%{?_isa} = %{version}-%{release} + +%description static +The libsepol-static package contains the static libraries and header files +needed for developing applications that manipulate binary policies. + +%prep +%autosetup -p 2 -n libsepol-%{version} + + +%build +%set_build_flags +CFLAGS="$CFLAGS -fno-semantic-interposition" +%make_build + +%install +mkdir -p ${RPM_BUILD_ROOT}%{_libdir} +mkdir -p ${RPM_BUILD_ROOT}%{_includedir} +mkdir -p ${RPM_BUILD_ROOT}%{_bindir} +mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man3 +mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man8 +%make_install LIBDIR="%{_libdir}" SHLIBDIR="%{_libdir}" +rm -f ${RPM_BUILD_ROOT}%{_bindir}/genpolbools +rm -f ${RPM_BUILD_ROOT}%{_bindir}/genpolusers +rm -f ${RPM_BUILD_ROOT}%{_bindir}/chkcon +rm -rf ${RPM_BUILD_ROOT}%{_mandir}/man8 +rm -rf ${RPM_BUILD_ROOT}%{_mandir}/ru/man8 + +%files static +%{_libdir}/libsepol.a + +%files devel +%{_libdir}/libsepol.so +%{_libdir}/pkgconfig/libsepol.pc +%{_includedir}/sepol/*.h +%{_mandir}/man3/*.3.gz +%dir %{_includedir}/sepol +%dir %{_includedir}/sepol/policydb +%{_includedir}/sepol/policydb/*.h +%dir %{_includedir}/sepol/cil +%{_includedir}/sepol/cil/*.h + +%files +%license COPYING +%{_libdir}/libsepol.so.2 + +%changelog +* Tue Mar 08 2022 Hongwei Qin - 3.3-1 +- SELinux userspace 3.3 release +- Init for Anolis OS 23