## START: Set by rpmautospec ## (rpmautospec version 0.8.1) ## RPMAUTOSPEC: autorelease %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # # spec file for package libapparmor, based on the one in openSUSE # # Copyright (c) 2025 Canonical Inc. # Copyright (c) 2025 SUSE LLC # Copyright (c) 2011-2024 Christian Boltz # # 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. # The version conventions for betas, etc. don't always line up, so define these # variables separately %global tarversion v4.1.2 %global pyeggversion 4.1.2 %bcond python3 1 Name: libapparmor Version: 4.1.2 Release: %autorelease Summary: Utility library for AppArmor License: LGPL-2.1-or-later Group: Development/Libraries/C and C++ URL: https://gitlab.com/apparmor/apparmor/ Source0: https://gitlab.com/apparmor/apparmor/-/archive/%{tarversion}/apparmor-%{tarversion}.tar.gz Source1: https://gitlab.com/api/v4/projects/4484878/packages/generic/signatures/4.1.2/apparmor-%{tarversion}.tar.gz.asc # GPG key 3ecdcba5fb34d254961cc53f6689e64e3d3664bb from keyserver.ubuntu.com Source2: apparmor.keyring BuildRequires: autoconf BuildRequires: autoconf-archive BuildRequires: automake BuildRequires: bison BuildRequires: dejagnu BuildRequires: flex BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: gpgverify BuildRequires: libtool # Needed because we ship a libapparmor.pc for pkg-config, not for deps BuildRequires: pkg-config %if %{with python3} BuildRequires: python BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: swig %endif # podchecker, pod2html BuildRequires: perl(Pod::Checker) BuildRequires: perl(Pod::Html) %description This package provides a libapparmor library one can compile programs against in order to use various AppArmor functionality, such as transitioning to a different AppArmor profile or hat. %package -n libapparmor1 Summary: Utility library for AppArmor Group: System/Libraries Provides: libapparmor = %{version} %description -n libapparmor1 This package provides a shared libapparmor library one can compile programs against in order to use various AppArmor functionality, such as transitioning to a different AppArmor profile or hat. %package -n libapparmor-devel Summary: Development headers and libraries for libapparmor Group: Development/Libraries/C and C++ Requires: libapparmor1 = %{version} Provides: libapparmor1:/usr/include/sys/apparmor.h %description -n libapparmor-devel These libraries are needed for developing software that makes use of the AppArmor API. %if %{with python3} %package -n python3-apparmor Summary: Python 3 interface for libapparmor functions License: GPL-2.0-only AND LGPL-2.1-or-later Group: Development/Libraries/Python Requires: libapparmor1 = %{version} Requires: python3 %description -n python3-apparmor This package provides a Python interface to libapparmor, autogenerated via SWIG. %endif %prep %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' %setup -q -n apparmor-%{tarversion} %build # The test suite statically links to the libapparmor library, and switching # it to use the .la files instead results in unresolved symbols. As such, we # need to build the static library and then delete it after running tests. ( cd ./libraries/libapparmor sh ./autogen.sh && %configure \ --without-perl \ %if %{with python3} --with-python \ %else --without-python \ %endif --without-ruby \ %make_build ) %check # The testsuite does not get parallelized by make's jobserver %make_build -j1 check -C libraries/libapparmor %install %make_install -C libraries/libapparmor # remove *.la and *.a files rm -fv %{buildroot}%{_libdir}/libapparmor.la rm -fv %{buildroot}%{_libdir}/libapparmor.a %files -n libapparmor1 %defattr(-,root,root) %{_libdir}/libapparmor.so.* %files -n libapparmor-devel %defattr(-,root,root) %{_libdir}/libapparmor.so %{_libdir}/pkgconfig/libapparmor.pc %doc %{_mandir}/man2/aa_change_hat.2.gz %doc %{_mandir}/man2/aa_change_profile.2.gz %doc %{_mandir}/man2/aa_stack_profile.2.gz %doc %{_mandir}/man2/aa_find_mountpoint.2.gz %doc %{_mandir}/man2/aa_getcon.2.gz %doc %{_mandir}/man2/aa_query_label.2.gz %doc %{_mandir}/man3/aa_features.3.gz %doc %{_mandir}/man3/aa_kernel_interface.3.gz %doc %{_mandir}/man3/aa_policy_cache.3.gz %doc %{_mandir}/man3/aa_splitcon.3.gz %dir %{_includedir}/aalogparse %{_includedir}/sys/apparmor.h %{_includedir}/sys/apparmor_private.h %{_includedir}/aalogparse/* %if %{with python3} %files -n python3-apparmor %defattr(-,root,root) %ghost %dir %{python3_sitearch}/LibAppArmor-%{pyeggversion}-py%{python3_version}.egg-info %dir %{python3_sitearch}/LibAppArmor %dir %{python3_sitearch}/LibAppArmor/__pycache__ %{python3_sitearch}/LibAppArmor/_LibAppArmor.cpython-*.so %{python3_sitearch}/LibAppArmor/__pycache__/__init__.cpython-*.pyc %{python3_sitearch}/LibAppArmor/__pycache__/LibAppArmor.cpython-*.pyc %{python3_sitearch}/LibAppArmor/__init__.py %{python3_sitearch}/LibAppArmor/LibAppArmor.py %ghost %{python3_sitearch}/LibAppArmor-%{pyeggversion}-py%{python3_version}.egg-info/* %endif %changelog * Thu Oct 23 2025 Ryan Lee 4.1.2-1 - Initial port of libapparmor OpenSUSE packaging (4.1.1-160000.2.2) to Fedora - Bump to upstream 4.1.2