2024-06-27 14:48:27 +00:00
|
|
|
%define libsepolver 3.7-1
|
|
|
|
%define libselinuxver 3.7-1
|
2010-05-06 15:50:55 +00:00
|
|
|
|
2020-07-10 18:10:01 +00:00
|
|
|
Summary: SELinux binary policy manipulation library
|
2005-09-06 20:16:22 +00:00
|
|
|
Name: libsemanage
|
2024-06-27 14:48:27 +00:00
|
|
|
Version: 3.7
|
|
|
|
Release: 1%{?dist}
|
2022-11-09 16:19:48 +00:00
|
|
|
License: LGPL-2.1-or-later
|
2024-06-27 14:48:27 +00:00
|
|
|
Source0: https://github.com/SELinuxProject/selinux/releases/download/3.7/libsemanage-3.7.tar.gz
|
2024-06-27 14:51:22 +00:00
|
|
|
Source1: https://github.com/SELinuxProject/selinux/releases/download/3.7/libsemanage-3.7.tar.gz.asc
|
|
|
|
Source2: https://github.com/bachradsusi.gpg
|
2024-06-27 14:48:27 +00:00
|
|
|
# git format-patch -N 3.7 -- libsemanage
|
2019-08-13 19:11:13 +00:00
|
|
|
# i=1; for j in 00*patch; do printf "Patch%04d: %s\n" $i $j; i=$((i+1));done
|
2019-10-15 15:16:19 +00:00
|
|
|
# Patch list start
|
|
|
|
# Patch list end
|
2015-04-13 11:31:52 +00:00
|
|
|
URL: https://github.com/SELinuxProject/selinux/wiki
|
2024-06-27 14:51:22 +00:00
|
|
|
Source3: semanage.conf
|
2006-01-02 12:56:28 +00:00
|
|
|
|
2020-11-04 19:27:29 +00:00
|
|
|
BuildRequires: gcc make
|
2018-09-17 21:58:40 +00:00
|
|
|
BuildRequires: libselinux-devel >= %{libselinuxver} swig
|
2006-06-16 17:38:35 +00:00
|
|
|
BuildRequires: libsepol-devel >= %{libsepolver}
|
2013-07-26 21:49:13 +00:00
|
|
|
BuildRequires: audit-libs-devel
|
2019-08-13 19:28:52 +00:00
|
|
|
BuildRequires: bison flex bzip2-devel
|
2024-06-27 14:51:22 +00:00
|
|
|
BuildRequires: gnupg2
|
2010-05-06 15:50:55 +00:00
|
|
|
|
2017-08-12 12:31:05 +00:00
|
|
|
BuildRequires: python3
|
|
|
|
BuildRequires: python3-devel
|
2022-11-21 12:50:53 +00:00
|
|
|
BuildRequires: python3-setuptools
|
2010-05-06 15:50:55 +00:00
|
|
|
|
2013-07-26 21:49:13 +00:00
|
|
|
Requires: bzip2-libs audit-libs
|
2018-03-13 11:58:59 +00:00
|
|
|
Requires: libselinux%{?_isa} >= %{libselinuxver}
|
2020-11-20 09:33:23 +00:00
|
|
|
Obsoletes: libsemanage-compat = 3.1-4
|
2005-07-28 18:05:59 +00:00
|
|
|
|
|
|
|
%description
|
2005-09-29 01:13:28 +00:00
|
|
|
Security-enhanced Linux is a feature of the Linux® kernel and a number
|
2005-07-28 18:05:59 +00:00
|
|
|
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.
|
|
|
|
|
|
|
|
libsemanage 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.
|
|
|
|
|
2010-01-18 21:45:33 +00:00
|
|
|
%package static
|
|
|
|
Summary: Static library used to build policy manipulation tools
|
2016-02-28 18:58:49 +00:00
|
|
|
Requires: libsemanage-devel%{_isa} = %{version}-%{release}
|
2010-01-18 21:45:33 +00:00
|
|
|
|
|
|
|
%description static
|
|
|
|
The semanage-static package contains the static libraries
|
|
|
|
needed for developing applications that manipulate binary policies.
|
|
|
|
|
2005-09-06 20:16:22 +00:00
|
|
|
%package devel
|
|
|
|
Summary: Header files and libraries used to build policy manipulation tools
|
2018-09-17 21:58:40 +00:00
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
2005-09-06 20:16:22 +00:00
|
|
|
|
|
|
|
%description devel
|
2010-01-18 21:45:33 +00:00
|
|
|
The semanage-devel package contains the libraries and header files
|
2005-07-28 18:05:59 +00:00
|
|
|
needed for developing applications that manipulate binary policies.
|
|
|
|
|
2017-08-12 12:31:05 +00:00
|
|
|
%package -n python3-libsemanage
|
2010-05-06 15:50:55 +00:00
|
|
|
Summary: semanage python 3 bindings for libsemanage
|
2016-02-28 18:58:49 +00:00
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
2015-07-30 16:17:39 +00:00
|
|
|
Requires: libselinux-python3
|
2017-08-12 12:31:05 +00:00
|
|
|
%{?python_provide:%python_provide python3-libsemanage}
|
|
|
|
# Remove before F30
|
2017-08-20 13:37:30 +00:00
|
|
|
Provides: %{name}-python3 = %{version}-%{release}
|
2017-08-12 12:31:05 +00:00
|
|
|
Provides: %{name}-python3%{?_isa} = %{version}-%{release}
|
|
|
|
Obsoletes: %{name}-python3 < %{version}-%{release}
|
2010-05-06 15:50:55 +00:00
|
|
|
|
2017-08-12 12:31:05 +00:00
|
|
|
%description -n python3-libsemanage
|
2010-05-06 15:50:55 +00:00
|
|
|
The libsemanage-python3 package contains the python 3 bindings for developing
|
|
|
|
SELinux management applications.
|
|
|
|
|
2005-07-28 18:05:59 +00:00
|
|
|
%prep
|
2024-06-27 14:51:22 +00:00
|
|
|
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
|
2023-12-14 09:25:08 +00:00
|
|
|
%autosetup -p 2 -n libsemanage-%{version}
|
2016-02-21 11:36:19 +00:00
|
|
|
|
2005-07-28 18:05:59 +00:00
|
|
|
|
|
|
|
%build
|
2019-08-13 19:14:00 +00:00
|
|
|
%set_build_flags
|
2020-07-21 18:29:09 +00:00
|
|
|
CFLAGS="$CFLAGS -fno-semantic-interposition"
|
2015-08-14 18:55:39 +00:00
|
|
|
|
2010-05-06 15:50:55 +00:00
|
|
|
# To support building the Python wrapper against multiple Python runtimes
|
|
|
|
# Define a function, for how to perform a "build" of the python wrapper against
|
|
|
|
# a specific runtime:
|
|
|
|
BuildPythonWrapper() {
|
|
|
|
BinaryName=$1
|
|
|
|
|
|
|
|
# Perform the build from the upstream Makefile:
|
|
|
|
make \
|
2010-12-30 15:50:53 +00:00
|
|
|
PYTHON=$BinaryName \
|
2019-08-13 19:14:00 +00:00
|
|
|
LIBDIR="%{_libdir}" SHLIBDIR="%{_lib}" \
|
2010-05-06 15:50:55 +00:00
|
|
|
pywrap
|
|
|
|
}
|
|
|
|
|
2005-12-13 16:22:20 +00:00
|
|
|
make clean
|
2019-08-13 19:14:00 +00:00
|
|
|
make swigify
|
2020-07-21 18:29:09 +00:00
|
|
|
%make_build LIBDIR="%{_libdir}" SHLIBDIR="%{_lib}" all
|
2010-05-06 15:50:55 +00:00
|
|
|
|
2010-12-30 15:50:53 +00:00
|
|
|
BuildPythonWrapper \
|
2011-08-22 14:55:59 +00:00
|
|
|
%{__python3}
|
2005-07-28 18:05:59 +00:00
|
|
|
|
|
|
|
%install
|
2010-05-06 15:50:55 +00:00
|
|
|
InstallPythonWrapper() {
|
|
|
|
BinaryName=$1
|
|
|
|
|
|
|
|
make \
|
2010-12-30 15:50:53 +00:00
|
|
|
PYTHON=$BinaryName \
|
2018-03-13 11:58:59 +00:00
|
|
|
DESTDIR="${RPM_BUILD_ROOT}" LIBDIR="%{_libdir}" SHLIBDIR="%{_libdir}" \
|
2010-05-06 15:50:55 +00:00
|
|
|
install-pywrap
|
|
|
|
}
|
|
|
|
|
2015-04-13 11:31:52 +00:00
|
|
|
mkdir -p ${RPM_BUILD_ROOT}%{_libdir}
|
2005-07-28 18:05:59 +00:00
|
|
|
mkdir -p ${RPM_BUILD_ROOT}%{_includedir}
|
2015-04-13 11:31:52 +00:00
|
|
|
mkdir -p ${RPM_BUILD_ROOT}%{_sharedstatedir}/selinux
|
2015-06-16 14:19:16 +00:00
|
|
|
mkdir -p ${RPM_BUILD_ROOT}%{_sharedstatedir}/selinux/tmp
|
2020-07-13 22:31:52 +00:00
|
|
|
%make_install LIBDIR="%{_libdir}" SHLIBDIR="%{_libdir}"
|
2010-05-06 15:50:55 +00:00
|
|
|
|
2010-12-30 15:50:53 +00:00
|
|
|
InstallPythonWrapper \
|
|
|
|
%{__python3} \
|
2011-08-22 14:55:59 +00:00
|
|
|
$(python3-config --extension-suffix)
|
2010-12-30 15:50:53 +00:00
|
|
|
|
2024-06-27 14:51:22 +00:00
|
|
|
cp %{SOURCE3} ${RPM_BUILD_ROOT}%{_sysconfdir}/selinux/semanage.conf
|
2020-10-30 12:27:17 +00:00
|
|
|
|
2005-08-30 14:22:49 +00:00
|
|
|
%files
|
2022-11-21 12:50:53 +00:00
|
|
|
%license LICENSE
|
2013-07-09 15:12:34 +00:00
|
|
|
%dir %{_sysconfdir}/selinux
|
2013-01-16 14:37:32 +00:00
|
|
|
%config(noreplace) %{_sysconfdir}/selinux/semanage.conf
|
2020-10-30 12:27:17 +00:00
|
|
|
%{_libdir}/libsemanage.so.2
|
2014-02-11 14:30:21 +00:00
|
|
|
%{_mandir}/man5/*
|
2015-04-13 11:31:52 +00:00
|
|
|
%dir %{_libexecdir}/selinux
|
|
|
|
%dir %{_sharedstatedir}/selinux
|
2015-06-16 14:19:16 +00:00
|
|
|
%dir %{_sharedstatedir}/selinux/tmp
|
2005-09-06 20:16:22 +00:00
|
|
|
|
2018-02-03 17:22:37 +00:00
|
|
|
%ldconfig_scriptlets
|
2005-09-06 20:16:22 +00:00
|
|
|
|
2010-01-18 21:45:33 +00:00
|
|
|
%files static
|
2005-07-28 18:05:59 +00:00
|
|
|
%{_libdir}/libsemanage.a
|
2010-01-18 21:45:33 +00:00
|
|
|
|
|
|
|
%files devel
|
2007-08-20 23:30:14 +00:00
|
|
|
%{_libdir}/libsemanage.so
|
2009-11-02 18:11:54 +00:00
|
|
|
%{_libdir}/pkgconfig/libsemanage.pc
|
2006-05-22 13:34:46 +00:00
|
|
|
%dir %{_includedir}/semanage
|
2005-07-28 18:05:59 +00:00
|
|
|
%{_includedir}/semanage/*.h
|
2006-01-05 16:21:25 +00:00
|
|
|
%{_mandir}/man3/*
|
2005-07-28 18:05:59 +00:00
|
|
|
|
2017-08-12 12:31:05 +00:00
|
|
|
%files -n python3-libsemanage
|
2011-08-22 14:55:59 +00:00
|
|
|
%{python3_sitearch}/*.so
|
2010-05-06 15:50:55 +00:00
|
|
|
%{python3_sitearch}/semanage.py*
|
2010-08-25 16:10:25 +00:00
|
|
|
%{python3_sitearch}/__pycache__/semanage*
|
2015-07-30 16:17:39 +00:00
|
|
|
%{_libexecdir}/selinux/semanage_migrate_store
|
2010-05-06 15:50:55 +00:00
|
|
|
|
2005-07-28 18:05:59 +00:00
|
|
|
%changelog
|
2024-06-27 14:53:40 +00:00
|
|
|
%autochangelog
|