# Python module %define _disable_ld_no_undefined 1 %define libsepolver 3.4-1 %define libselinuxver 3.4-1 %define major 2 %define libname %mklibname semanage %{major} %define devname %mklibname semanage -d %define devstaticname %mklibname semanage -d -s Summary: SELinux binary policy manipulation library Name: libsemanage Version: 3.4 Release: %mkrel 4 License: LGPLv2+ Group: System/Libraries Source0: https://github.com/SELinuxProject/selinux/releases/download/%{version}/libsemanage-%{version}.tar.gz # fedora-selinux/selinux: git format-patch -N 3.4 -- libsemanage # i=1; for j in 00*patch; do printf "Patch%04d: %s\n" $i $j; i=$((i+1));done # Patch list start Patch0001: 0001-libsemanage-always-write-kernel-policy-when-check_ex.patch # Patch list end URL: https://github.com/SELinuxProject/selinux/wiki Source1: semanage.conf BuildRequires: gcc make BuildRequires: libselinux-devel >= %{libselinuxver} swig BuildRequires: libsepol-devel >= %{libsepolver} BuildRequires: audit-libs-devel BuildRequires: bison flex bzip2-devel BuildRequires: python3 BuildRequires: python3-devel Obsoletes: libsemanage-compat = 3.1-4 # file moved Conflicts: %{_lib}semanage2 < 3.4-3 %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. 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. %package -n %{libname} Summary: SELinux binary policy manipulation library Group: System/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} Provides: semanage = %{version}-%{release} # ease upgrade mga8 -> mga9 Conflicts: %{_lib}semanage1 < 2.5-12 %description -n %{libname} 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. %package -n %{devname} Summary: Header files and libraries used to build policy manipulation tools Group: Development/C Requires: %{libname} = %{version}-%{release} Provides: semanage-devel = %{version}-%{release} Obsoletes: %{mklibname semanage 1 -d} %description -n %{devname} The libsemanage-devel package contains the libraries and header files needed for developing applications that manipulate binary policies. %package -n %{devstaticname} Summary: Static libraries used to build policy manipulation tools Group: Development/C Requires: %{devname} = %{version}-%{release} Provides: semanage-static-devel = %{version}-%{release} Obsoletes: %{mklibname semanage 1 -d -s} %description -n %{devstaticname} The libsemanage-devel package contains the static libraries needed for developing applications that manipulate binary policies. %package -n python3-libsemanage Summary: semanage python 3 bindings for libsemanage Requires: %{name}%{?_isa} = %{version}-%{release} Requires: libselinux-python3 %{?python_provide:%python_provide python3-libsemanage} # Remove before F30 Provides: %{name}-python3 = %{version}-%{release} Provides: %{name}-python3%{?_isa} = %{version}-%{release} Obsoletes: %{name}-python3 < %{version}-%{release} %description -n python3-libsemanage The libsemanage-python3 package contains the python 3 bindings for developing SELinux management applications. %prep %autosetup -n libsemanage-%{version} -p 2 %build %set_build_flags CFLAGS="$CFLAGS -fno-semantic-interposition" # 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 \ PYTHON=$BinaryName \ LIBDIR="%{_libdir}" SHLIBDIR="%{_lib}" \ pywrap } make clean make swigify %make_build LIBDIR="%{_libdir}" SHLIBDIR="%{_lib}" all BuildPythonWrapper \ %{__python3} %install InstallPythonWrapper() { BinaryName=$1 make \ PYTHON=$BinaryName \ DESTDIR="${RPM_BUILD_ROOT}" LIBDIR="%{_libdir}" SHLIBDIR="%{_libdir}" \ install-pywrap } mkdir -p ${RPM_BUILD_ROOT}%{_libdir} mkdir -p ${RPM_BUILD_ROOT}%{_includedir} mkdir -p ${RPM_BUILD_ROOT}%{_sharedstatedir}/selinux mkdir -p ${RPM_BUILD_ROOT}%{_sharedstatedir}/selinux/tmp %make_install LIBDIR="%{_libdir}" SHLIBDIR="%{_libdir}" InstallPythonWrapper \ %{__python3} \ $(python3-config --extension-suffix) cp %{SOURCE1} ${RPM_BUILD_ROOT}%{_sysconfdir}/selinux/semanage.conf %files %license COPYING %dir %{_sysconfdir}/selinux %config(noreplace) %{_sysconfdir}/selinux/semanage.conf %{_mandir}/man5/* %{_mandir}/ru/man5/* %dir %{_libexecdir}/selinux %dir %{_sharedstatedir}/selinux %dir %{_sharedstatedir}/selinux/tmp %files -n %{libname} %{_libdir}/libsemanage.so.%{major}{,.*} %files -n %{devstaticname} %{_libdir}/libsemanage.a %files -n %{devname} %{_libdir}/libsemanage.so %{_libdir}/pkgconfig/libsemanage.pc %dir %{_includedir}/semanage %{_includedir}/semanage/*.h %{_mandir}/man3/* %files -n python3-libsemanage %{python3_sitearch}/*.so %{python3_sitearch}/semanage.py* %{python3_sitearch}/__pycache__/semanage* %{_libexecdir}/selinux/semanage_migrate_store %changelog * Sun May 07 2023 daviddavid <daviddavid> 3.4-4.mga9 + Revision: 1956062 - remove unneeded harcoded dependencies in main pkg (mga#31873#c9) * Tue May 02 2023 daviddavid <daviddavid> 3.4-3.mga9 + Revision: 1955636 - add conflicts to ease upgrade mga8 -> mga9 - keep "/etc/selinux/semanage.conf" only in one pkg (the main) * Tue Apr 25 2023 daviddavid <daviddavid> 3.4-2.mga9 + Revision: 1954969 - fix dependencies * Tue Apr 25 2023 neoclust <neoclust> 3.4-1.mga9 + Revision: 1954964 - New version 3.4 * Wed Mar 09 2022 mrambo3501 <mrambo3501> 3.2-0.rc1.2.mga9 + Revision: 1790069 - rebuild for python-3.10 * Fri Jan 29 2021 neoclust <neoclust> 3.2-0.rc1.1.mga9 + Revision: 1673976 - New version 3.2-rc1 * Thu Apr 23 2020 joequant <joequant> 2.5-11.mga8 + Revision: 1571402 - rebuild without python2 + umeabot <umeabot> - Mageia 8 Mass Rebuild * Wed Jan 09 2019 daviddavid <daviddavid> 2.5-9.mga7 + Revision: 1353104 - rebuild for new Python 3.7 * Thu Oct 04 2018 umeabot <umeabot> 2.5-8.mga7 + Revision: 1317670 - Mageia 7 Mass Rebuild * Sat Aug 05 2017 pterjan <pterjan> 2.5-7.mga7 + Revision: 1135260 - Rebuild for python 3.6 * Fri Mar 04 2016 spuhler <spuhler> 2.5-6.mga6 + Revision: 985710 - added Provides * Fri Mar 04 2016 spuhler <spuhler> 2.5-5.mga6 + Revision: 985658 - bumped rel for rebuild * Thu Mar 03 2016 spuhler <spuhler> 2.5-4.mga6 + Revision: 985232 - fixed Require name on the python packages * Thu Mar 03 2016 spuhler <spuhler> 2.5-3.mga6 + Revision: 985059 - obsoletet orphan packages (that are in cauldron only) * Wed Mar 02 2016 spuhler <spuhler> 2.5-2.mga6 + Revision: 983469 - renamed python packages * Mon Feb 29 2016 spuhler <spuhler> 2.5-1.mga6 + Revision: 980907 - missing Buildrequires - added python3 * synced spec with Fedora - upgrade to vers 2.5 + umeabot <umeabot> - Mageia 6 Mass Rebuild + tv <tv> - bump needed libsepol version - new release - fix source URL - new release * Wed Oct 15 2014 umeabot <umeabot> 2.3-4.mga5 + Revision: 744089 - Second Mageia 5 Mass Rebuild * Sat Sep 27 2014 tv <tv> 2.3-3.mga5 + Revision: 726874 - rebuild for missing pythoneggs deps * Tue Sep 16 2014 umeabot <umeabot> 2.3-2.mga5 + Revision: 681775 - Mageia 5 Mass Rebuild * Mon Jun 16 2014 spuhler <spuhler> 2.3-1.mga5 + Revision: 636880 + rebuild (emptylog) * Sat May 31 2014 pterjan <pterjan> 2.2-2.mga5 + Revision: 628309 - Rebuild for new Python * Thu Feb 06 2014 spuhler <spuhler> 2.2-1.mga5 + Revision: 584097 - added BuildRequires: audit-devel - upgrade to ver 2.2 * Sat Oct 19 2013 umeabot <umeabot> 2.1.10-2.mga4 + Revision: 522499 - Mageia 4 Mass Rebuild * Wed Mar 06 2013 spuhler <spuhler> 2.1.10-1.mga3 + Revision: 401552 - update to 2.1.10 * Add sefcontext_compile to compile regex everytime policy is rebuilt * Cleanup/fix enable/disable/remove module. * redo genhomedircon minuid * fixes from coverity * semanage_store: do not leak memory in semanage_exec_prog * genhomedircon: remove useless conditional in get_home_dirs * genhomedircon: double free in get_home_dirs * fcontext_record: do not leak on error in semanage_fcontext_key_create * genhomedircon: do not leak on failure in write_gen_home_dir_context * semanage_store: do not leak fd * genhomedircon: do not leak shells list * semanage_store: do not leak on strdup failure * semanage_store: rewrite for readability - updated to new Fedora patch * Sat Jan 12 2013 umeabot <umeabot> 2.1.9-2.mga3 + Revision: 358138 - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild * Sun Dec 02 2012 spuhler <spuhler> 2.1.9-1.mga3 + Revision: 325064 - upgrade to 2.1.9 - added semannage.conf * Mon Sep 03 2012 spuhler <spuhler> 2.1.8-2.mga3 + Revision: 287751 - rebuild due to a missing pkgs * Sun Sep 02 2012 spuhler <spuhler> 2.1.8-1.mga3 + Revision: 287380 - added BuildRequires: swig - upgrade to 2.1.8 * Fri Feb 11 2011 dmorgan <dmorgan> 2.0.31-3.mga1 + Revision: 50030 - Remove mdv macros - imported package libsemanage * Sat Nov 06 2010 Funda Wang <fwang@mandriva.org> 2.0.31-3mdv2011.0 + Revision: 593901 - rebuild for py2.7 * Sun Sep 13 2009 Thierry Vignaud <tv@mandriva.org> 2.0.31-2mdv2010.0 + Revision: 438738 - rebuild * Fri Jan 23 2009 Jérôme Soyer <saispo@mandriva.org> 2.0.31-1mdv2009.1 + Revision: 332745 - New upstream release - New upstream release * Mon Jan 05 2009 Jérôme Soyer <saispo@mandriva.org> 2.0.30-1mdv2009.1 + Revision: 325054 - New upstream release * Sun Jan 04 2009 Funda Wang <fwang@mandriva.org> 2.0.29-2mdv2009.1 + Revision: 324119 - rebuild * Sun Nov 30 2008 David Walluck <walluck@mandriva.org> 2.0.29-1mdv2009.1 + Revision: 308329 - 2.0.29 * Mon Nov 24 2008 David Walluck <walluck@mandriva.org> 2.0.28-1mdv2009.1 + Revision: 306133 - 2.0.28 * Sun Aug 17 2008 David Walluck <walluck@mandriva.org> 2.0.27-2mdv2009.0 + Revision: 273019 - Provides: semanage = %%{version}-%%{release} * Sun Aug 17 2008 David Walluck <walluck@mandriva.org> 2.0.27-1mdv2009.0 + Revision: 272849 - 2.0.27 * Sat Aug 16 2008 David Walluck <walluck@mandriva.org> 2.0.25-1mdv2009.0 + Revision: 272747 - 2.0.25 * Sun Jul 27 2008 Thierry Vignaud <tv@mandriva.org> 2.0.9-4mdv2009.0 + Revision: 250480 - rebuild + Pixel <pixel@mandriva.com> - do not call ldconfig in %%post/%%postun, it is now handled by filetriggers * Wed Jan 02 2008 David Walluck <walluck@mandriva.org> 2.0.9-2mdv2008.1 + Revision: 140336 - add proper python package * Wed Jan 02 2008 David Walluck <walluck@mandriva.org> 2.0.9-1mdv2008.1 + Revision: 140313 - add python requires - BuildRequires: flex - BuildRequires: bison - import libsemanage