2008-08-05 04:42:57 +02:00
|
|
|
#
|
2011-02-23 11:02:51 +01:00
|
|
|
# spec file for package libsemanage
|
2008-08-05 04:42:57 +02:00
|
|
|
#
|
2024-06-03 15:58:07 +02:00
|
|
|
# Copyright (c) 2024 SUSE LLC
|
2008-08-05 04:42:57 +02:00
|
|
|
#
|
2008-09-02 12:29:51 +02:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2019-05-06 09:47:20 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2008-08-05 04:42:57 +02:00
|
|
|
#
|
|
|
|
|
2011-05-24 13:33:19 +02:00
|
|
|
|
2021-03-18 11:06:40 +01:00
|
|
|
%define soversion 2
|
|
|
|
%define libname libsemanage%{soversion}
|
2021-03-12 08:59:15 +01:00
|
|
|
|
2016-07-13 09:19:36 +02:00
|
|
|
Name: libsemanage
|
2023-12-20 14:57:06 +01:00
|
|
|
Version: 3.6
|
2016-07-13 09:19:36 +02:00
|
|
|
Release: 0
|
2016-07-26 14:14:00 +02:00
|
|
|
Summary: SELinux policy management library
|
2018-03-09 08:25:24 +01:00
|
|
|
License: LGPL-2.1-or-later
|
2016-07-26 14:14:00 +02:00
|
|
|
Group: Development/Libraries/C and C++
|
2020-03-05 11:11:12 +01:00
|
|
|
URL: https://github.com/SELinuxProject/selinux/wiki/Releases
|
2022-05-20 16:53:32 +02:00
|
|
|
Source0: https://github.com/SELinuxProject/selinux/releases/download/%{version}/%{name}-%{version}.tar.gz
|
|
|
|
Source1: https://github.com/SELinuxProject/selinux/releases/download/%{version}/%{name}-%{version}.tar.gz.asc
|
|
|
|
Source2: libsemanage.keyring
|
|
|
|
Source3: baselibs.conf
|
|
|
|
Source4: semanage.conf
|
2020-06-15 09:22:03 +02:00
|
|
|
# PATCH-FIX-UPSTREAM bsc#1133102 LTO: Update map file to include new symbols and remove wildcards
|
2020-06-16 11:26:34 +02:00
|
|
|
# For now we need to disable this. This breaks e.g. shadow and also other packages in security:SELinux
|
|
|
|
#Patch0: libsemanage-update-map-file.patch
|
2013-11-07 11:20:19 +01:00
|
|
|
BuildRequires: audit-devel
|
2011-05-23 16:20:28 +02:00
|
|
|
BuildRequires: bison
|
2013-11-07 11:20:19 +01:00
|
|
|
BuildRequires: fdupes
|
2011-05-23 16:20:28 +02:00
|
|
|
BuildRequires: flex
|
2011-09-22 13:24:33 +02:00
|
|
|
BuildRequires: libbz2-devel
|
2012-08-01 09:57:49 +02:00
|
|
|
BuildRequires: libselinux-devel
|
|
|
|
BuildRequires: libsepol-devel
|
2021-03-18 11:06:40 +01:00
|
|
|
BuildRequires: pkgconfig
|
2023-11-28 09:34:20 +01:00
|
|
|
BuildRequires: python-rpm-macros
|
2008-08-05 04:42:57 +02:00
|
|
|
|
|
|
|
%description
|
2016-07-26 14:14:00 +02:00
|
|
|
libsemanage is the policy management library. Using libsepol and
|
|
|
|
libselinux to interact with the SELinux system, it also calls helper
|
|
|
|
programs for loading policy and for checking whether the
|
|
|
|
file_contexts configuration is valid.
|
2008-08-05 04:42:57 +02:00
|
|
|
|
2021-03-12 08:59:15 +01:00
|
|
|
%package -n %{libname}
|
2016-07-26 14:14:00 +02:00
|
|
|
Summary: SELinux policy management library
|
2011-05-23 16:20:28 +02:00
|
|
|
Group: System/Libraries
|
2016-12-12 16:12:21 +01:00
|
|
|
Suggests: %{name}-migrate-store
|
2021-03-17 16:35:23 +01:00
|
|
|
Requires: %{name}-conf >= %{version}
|
2008-08-05 04:42:57 +02:00
|
|
|
|
2021-03-12 08:59:15 +01:00
|
|
|
%description -n %{libname}
|
2016-07-26 14:14:00 +02:00
|
|
|
libsemanage is the policy management library. Using libsepol and
|
|
|
|
libselinux to interact with the SELinux system, it also calls helper
|
|
|
|
programs for loading policy and for checking whether the
|
|
|
|
file_contexts configuration is valid.
|
|
|
|
|
|
|
|
(Security-enhanced Linux is a feature of the kernel and some
|
|
|
|
utilities that implement mandatory access control policies, such as
|
|
|
|
Type Enforcement, Role-based Access Control and Multi-Level
|
|
|
|
Security.)
|
2008-08-05 04:42:57 +02:00
|
|
|
|
2021-03-17 16:35:23 +01:00
|
|
|
%package conf
|
|
|
|
Summary: Configuration for the SELinux policy management library
|
|
|
|
# before 3.1 the config file wasn't separated, so no parallel install is possible
|
|
|
|
Group: System/Libraries
|
|
|
|
Conflicts: %{name}1 <= 3.1
|
|
|
|
|
|
|
|
%description conf
|
|
|
|
Configuration file for libsemanage. Moved to a separate package to allow
|
|
|
|
parallel installation
|
|
|
|
|
2008-08-05 04:42:57 +02:00
|
|
|
%package devel
|
2016-07-26 14:14:00 +02:00
|
|
|
Summary: Header files and libraries for SELinux's policy management libary
|
|
|
|
Group: Development/Libraries/C and C++
|
2021-03-12 08:59:15 +01:00
|
|
|
Requires: %{libname} = %{version}
|
2008-08-05 04:42:57 +02:00
|
|
|
|
|
|
|
%description devel
|
2016-07-26 14:14:00 +02:00
|
|
|
The libsemanage-devel package contains the libraries and header files
|
|
|
|
needed for developing applications that manipulate SELinux policies.
|
2008-08-05 04:42:57 +02:00
|
|
|
|
2010-03-09 15:46:15 +01:00
|
|
|
%package devel-static
|
2016-07-26 14:14:00 +02:00
|
|
|
Summary: Static archives for SELinux's policy management library
|
|
|
|
Group: Development/Libraries/C and C++
|
2010-03-09 15:46:15 +01:00
|
|
|
Requires: libsemanage-devel
|
2008-08-05 04:42:57 +02:00
|
|
|
|
2010-03-09 15:46:15 +01:00
|
|
|
%description devel-static
|
2016-07-26 14:14:00 +02:00
|
|
|
The libsemanage-devel-static package contains the static libraries
|
2010-03-09 15:46:15 +01:00
|
|
|
needed for developing applications that manipulate binary policies.
|
2008-08-05 04:42:57 +02:00
|
|
|
|
2016-12-12 16:12:21 +01:00
|
|
|
%package migrate-store
|
|
|
|
Summary: SELinux Policy Store Migration
|
|
|
|
Group: Productivity/Security
|
|
|
|
|
|
|
|
%description migrate-store
|
|
|
|
In version 2.4 of libsemanage, libsepol, and policycoreutils, the policy
|
|
|
|
module store was moved from /etc/selinux/<store>/modules/ to
|
|
|
|
/var/lib/selinux/<store>/. Once the libraries are upgraded, all policy
|
|
|
|
stores must be migrated before any commands that modify or use the store
|
|
|
|
(e.g. semodule, semanage) can be executed.
|
|
|
|
|
2008-08-05 04:42:57 +02:00
|
|
|
%prep
|
|
|
|
%setup -q
|
2020-06-04 12:54:18 +02:00
|
|
|
# Replace /usr/libexec with whatever the distro defines as libexecdir - across all files
|
|
|
|
grep /usr/libexec . -rl | xargs sed -i "s|/usr/libexec|%{_libexecdir}|g"
|
2008-08-05 04:42:57 +02:00
|
|
|
|
|
|
|
%build
|
2021-03-18 11:06:40 +01:00
|
|
|
%make_build clean
|
2023-03-24 15:08:46 +01:00
|
|
|
%make_build CFLAGS="%{optflags} -fno-semantic-interposition -ffat-lto-objects" CC="gcc"
|
|
|
|
%make_build CFLAGS="%{optflags} -fno-semantic-interposition -ffat-lto-objects" LIBDIR="%{_libdir}" LIBEXECDIR="%{_libexecdir}" SHLIBDIR="%{_lib}" CC="gcc" all
|
2008-08-05 04:42:57 +02:00
|
|
|
|
|
|
|
%install
|
2011-05-23 16:20:28 +02:00
|
|
|
mkdir -p %{buildroot}/%{_lib}
|
|
|
|
mkdir -p %{buildroot}%{_libdir}
|
|
|
|
mkdir -p %{buildroot}%{_includedir}
|
2020-07-30 14:20:11 +02:00
|
|
|
mkdir -p %{buildroot}%{_localstatedir}/lib/selinux
|
2018-11-08 12:21:37 +01:00
|
|
|
%make_install LIBDIR="%{_libdir}" LIBEXECDIR="%{_libexecdir}" SHLIBDIR="%{_libdir}"
|
2021-03-18 11:06:40 +01:00
|
|
|
ln -sf %{_libdir}/libsemanage.so.%{soversion} %{buildroot}/%{_libdir}/libsemanage.so
|
2022-05-20 16:53:32 +02:00
|
|
|
cp %{SOURCE4} %{buildroot}%{_sysconfdir}/selinux/semanage.conf
|
2023-11-28 09:34:20 +01:00
|
|
|
|
|
|
|
# Fix shebang in scripts
|
|
|
|
for f in %{buildroot}%{_libexecdir}/selinux/*
|
|
|
|
do
|
|
|
|
[ -f $f ] && sed -i "1s@#!.*python.*@#!$(realpath %__python3)@" $f
|
|
|
|
done
|
2013-11-07 11:20:19 +01:00
|
|
|
# Remove duplicate files
|
|
|
|
%fdupes -s %{buildroot}%{_mandir}
|
2008-08-05 04:42:57 +02:00
|
|
|
|
2021-03-12 08:59:15 +01:00
|
|
|
%post -n %{libname} -p /sbin/ldconfig
|
|
|
|
%postun -n %{libname} -p /sbin/ldconfig
|
2008-08-05 04:42:57 +02:00
|
|
|
|
2021-03-12 08:59:15 +01:00
|
|
|
%files -n %{libname}
|
2016-07-13 09:19:36 +02:00
|
|
|
%{_libdir}/libsemanage.so.*
|
2020-07-30 14:20:11 +02:00
|
|
|
%dir %{_localstatedir}/lib/selinux
|
2008-08-05 04:42:57 +02:00
|
|
|
|
2021-03-17 16:35:23 +01:00
|
|
|
%files conf
|
|
|
|
%dir %{_sysconfdir}/selinux
|
|
|
|
%config(noreplace) %{_sysconfdir}/selinux/semanage.conf
|
|
|
|
|
2008-08-05 04:42:57 +02:00
|
|
|
%files devel
|
|
|
|
%{_libdir}/libsemanage.so
|
2010-03-09 15:46:15 +01:00
|
|
|
%{_libdir}/pkgconfig/libsemanage.pc
|
2016-07-26 14:14:00 +02:00
|
|
|
%{_includedir}/semanage/
|
2008-08-05 04:42:57 +02:00
|
|
|
%{_mandir}/man3/*
|
2012-08-01 14:02:55 +02:00
|
|
|
%{_mandir}/man5/*
|
2008-08-05 04:42:57 +02:00
|
|
|
|
2016-12-12 16:12:21 +01:00
|
|
|
%files migrate-store
|
Accepting request 638795 from home:pmonrealgonzalez:branches:security:SELinux
- update to version 2.8
* semanage fcontext -l now also lists home directory entries from
file_contexts.homedirs.
* libsemanage no longer deletes the tmp directory if there is an error
while committing the policy transaction, so that any temporary files
can be further inspected for debugging purposes (e.g. to examine a
particular line of the generated CIL module). The tmp directory will
be deleted upon the next transaction, so no manual removal is needed.
* When overriding PREFIX, BINDIR, SBINDIR, SHLIBDIR, LIBEXECDIR, etc.,
DESTDIR has to be removed from the definition. For example on Arch
Linux, SBINDIR="${pkgdir}/usr/bin" was changed to SBINDIR="/usr/bin".
* PYSITEDIR has been renamed PYTHONLIBDIR (and its definition changed).
- Clened with spec-cleaner
- update to version 2.8
* semanage fcontext -l now also lists home directory entries from
file_contexts.homedirs.
* libsemanage no longer deletes the tmp directory if there is an error
while committing the policy transaction, so that any temporary files
can be further inspected for debugging purposes (e.g. to examine a
particular line of the generated CIL module). The tmp directory will
be deleted upon the next transaction, so no manual removal is needed.
* When overriding PREFIX, BINDIR, SBINDIR, SHLIBDIR, LIBEXECDIR, etc.,
DESTDIR has to be removed from the definition. For example on Arch
Linux, SBINDIR="${pkgdir}/usr/bin" was changed to SBINDIR="/usr/bin".
* PYSITEDIR has been renamed PYTHONLIBDIR (and its definition changed).
- Clened with spec-cleaner
OBS-URL: https://build.opensuse.org/request/show/638795
OBS-URL: https://build.opensuse.org/package/show/security:SELinux/libsemanage?expand=0&rev=66
2018-10-01 09:40:16 +02:00
|
|
|
%dir %{_libexecdir}/selinux
|
2016-12-12 16:12:21 +01:00
|
|
|
%{_libexecdir}/selinux/
|
|
|
|
|
2010-03-09 15:46:15 +01:00
|
|
|
%files devel-static
|
|
|
|
%{_libdir}/libsemanage.a
|
|
|
|
|
2008-08-05 04:42:57 +02:00
|
|
|
%changelog
|