4da1f5
# % global setools_pre_ver rc
4da1f5
# % global gitver f1e5b20
4da1f5
4da1f5
%global sepol_ver 2.9-1
4da1f5
%global selinux_ver 2.9-1
4da1f5
e0325d
%bcond_without     networkx
4da1f5
4da1f5
Name:           setools
591d66
Version:        4.3.0
26bda7
Release:        3%{?setools_pre_ver:.%{setools_pre_ver}}%{?dist}
4da1f5
Summary:        Policy analysis tools for SELinux
4da1f5
4da1f5
License:        GPLv2
4da1f5
URL:            https://github.com/SELinuxProject/setools/wiki
4da1f5
Source0:        https://github.com/SELinuxProject/setools/archive/%{version}%{?setools_pre_ver:-%{setools_pre_ver}}.tar.gz
4da1f5
Source1:        setools.pam
4da1f5
Source2:        apol.desktop
fd14c0
Patch0001:      0001-Support-old-boolean-names-in-policy-queries.patch
26bda7
Patch0002:      0002-Make-seinfo-output-predictable.patch
4da1f5
Patch1001:      1001-Do-not-use-Werror-during-build.patch
4da1f5
Patch1002:      1002-Do-not-export-use-setools.InfoFlowAnalysis-and-setoo.patch
591d66
Patch1003:      1003-Require-networkx-on-package-level.patch
591d66
Patch1004:      1004-Do-not-use-NoteNotFound-as-it-s-not-implemented-in-n.patch
4da1f5
4da1f5
Obsoletes:      setools < 4.0.0, setools-devel < 4.0.0
4da1f5
BuildRequires:  flex,  bison
4da1f5
BuildRequires:  glibc-devel, gcc, git
4da1f5
BuildRequires:  libsepol-devel >= %{sepol_ver}, libsepol-static >= %{sepol_ver}
4da1f5
BuildRequires:  qt5-qtbase-devel
4da1f5
BuildRequires:  swig
4da1f5
BuildRequires:  python3-Cython
4da1f5
BuildRequires:  python3-devel
4da1f5
BuildRequires:  python3-setuptools
4da1f5
BuildRequires:  libselinux-devel
4da1f5
4da1f5
# BuildArch:      
591d66
Requires:       %{name}-console = %{version}-%{release}
591d66
%if %{with networkx}
591d66
Requires:       %{name}-console-analyses = %{version}-%{release}
591d66
Requires:       %{name}-gui = %{version}-%{release}
591d66
%endif
4da1f5
4da1f5
%description
4da1f5
SETools is a collection of graphical tools, command-line tools, and
4da1f5
Python modules designed to facilitate SELinux policy analysis.
4da1f5
4da1f5
%package     console
4da1f5
Summary:     Policy analysis command-line tools for SELinux
4da1f5
License:     GPLv2
4da1f5
Requires:    python3-setools = %{version}-%{release}
4da1f5
Requires:    libselinux >= %{selinux_ver}
4da1f5
4da1f5
%description console
4da1f5
SETools is a collection of graphical tools, command-line tools, and
4da1f5
libraries designed to facilitate SELinux policy analysis.
4da1f5
4da1f5
This package includes the following console tools:
4da1f5
4da1f5
  sediff       Compare two policies to find differences.
4da1f5
  seinfo       List policy components.
4da1f5
  sesearch     Search rules (allow, type_transition, etc.)
4da1f5
4da1f5
4da1f5
%if %{with networkx}
4da1f5
%package     console-analyses
4da1f5
Summary:     Policy analysis command-line tools for SELinux
4da1f5
License:     GPLv2
4da1f5
Requires:    python3-setools = %{version}-%{release}
4da1f5
Requires:    libselinux >= %{selinux_ver}
4da1f5
Requires:    python3-networkx
4da1f5
4da1f5
%description console-analyses
4da1f5
SETools is a collection of graphical tools, command-line tools, and
4da1f5
libraries designed to facilitate SELinux policy analysis.
4da1f5
4da1f5
This package includes the following console tools:
4da1f5
4da1f5
  sedta        Perform domain transition analyses.
4da1f5
  seinfoflow   Perform information flow analyses.
4da1f5
%endif
4da1f5
4da1f5
4da1f5
%package     -n python3-setools
4da1f5
Summary:     Policy analysis tools for SELinux  
4da1f5
Obsoletes:   setools-libs < 4.0.0, setools-libs-tcl
4da1f5
Recommends:  libselinux-python3
4da1f5
# Remove before F30
4da1f5
Provides: %{name}-python3 = %{version}-%{release}
4da1f5
Provides: %{name}-python3%{?_isa} = %{version}-%{release}
4da1f5
Obsoletes: %{name}-python3 < %{version}-%{release}
4da1f5
%if 0%{?rhel} && 0%{?rhel} >= 8
4da1f5
Requires:    platform-python-setuptools
4da1f5
%else
4da1f5
Requires:    python3-setuptools
4da1f5
%endif
4da1f5
4da1f5
%description -n python3-setools
4da1f5
SETools is a collection of graphical tools, command-line tools, and
4da1f5
Python 3 modules designed to facilitate SELinux policy analysis.
4da1f5
4da1f5
4da1f5
%if %{with networkx}
4da1f5
%package     gui
4da1f5
Summary:     Policy analysis graphical tools for SELinux
4da1f5
Requires:    python3-setools = %{version}-%{release}
4da1f5
Requires:    python3-qt5
4da1f5
Requires:    python3-networkx
4da1f5
4da1f5
%description gui
4da1f5
SETools is a collection of graphical tools, command-line tools, and
4da1f5
Python modules designed to facilitate SELinux policy analysis.
4da1f5
%endif
4da1f5
4da1f5
4da1f5
%prep
4da1f5
%autosetup -p 1 -S git -n setools-%{version}%{?setools_pre_ver:-%{setools_pre_ver}}
4da1f5
4da1f5
4da1f5
%build
4da1f5
# Remove CFLAGS=... for noarch packages (unneeded)
4da1f5
%set_build_flags
4da1f5
%{__python3} setup.py build
4da1f5
4da1f5
4da1f5
%install
4da1f5
%{__python3} setup.py install --root %{buildroot}
4da1f5
4da1f5
%if %{without networkx}
4da1f5
rm -f %{buildroot}%{_bindir}/sedta %{buildroot}%{_bindir}/seinfoflow \
591d66
  %{buildroot}%{_mandir}*/man1/sedta* %{buildroot}%{_mandir}*/man1/sedinfoflow* \
4da1f5
rm -rf %{buildroot}%{_bindir}/apol %{buildroot}%{python3_sitearch}/setoolsgui \
591d66
  %{buildroot}%{_mandir}*/man1/apol*
4da1f5
%endif
4da1f5
4da1f5
%check
4da1f5
%if %{?_with_check:1}%{!?_with_check:0}
4da1f5
%{__python3} setup.py test
4da1f5
%endif
4da1f5
4da1f5
4da1f5
%files
4da1f5
4da1f5
%files console
4da1f5
%{_bindir}/sediff
4da1f5
%{_bindir}/seinfo
4da1f5
%{_bindir}/sesearch
4da1f5
%{_mandir}/man1/sediff*
4da1f5
%{_mandir}/man1/seinfo*
4da1f5
%{_mandir}/man1/sesearch*
591d66
%{_mandir}/ru/man1/sediff*
591d66
%{_mandir}/ru/man1/seinfo*
591d66
%{_mandir}/ru/man1/sesearch*
4da1f5
4da1f5
%if %{with networkx}
4da1f5
%files console-analyses
4da1f5
%{_bindir}/sedta
4da1f5
%{_bindir}/seinfoflow
4da1f5
%{_mandir}/man1/sedta*
4da1f5
%{_mandir}/man1/seinfoflow*
591d66
%{_mandir}/ru/man1/sedta*
591d66
%{_mandir}/ru/man1/seinfoflow*
4da1f5
%endif
4da1f5
4da1f5
%files -n python3-setools
4da1f5
%license COPYING COPYING.GPL COPYING.LGPL
4da1f5
%{python3_sitearch}/setools
4da1f5
%{python3_sitearch}/setools-*
4da1f5
4da1f5
%if %{with networkx}
4da1f5
%files gui
4da1f5
%{_bindir}/apol
4da1f5
%{python3_sitearch}/setoolsgui
4da1f5
%{_mandir}/man1/apol*
591d66
%{_mandir}/ru/man1/apol*
4da1f5
%endif
4da1f5
4da1f5
%changelog
26bda7
* Tue Nov 30 2021 Vit Mojzis <vmojzis@redhat.com> - 4.3.0-3}
26bda7
- Make seinfo output predictable (#2019961)
26bda7
fd14c0
* Tue Jun 30 2020 Vit Mojzis <vmojzis@redhat.com> - 4.3.0-2
fd14c0
- Support old boolean names in policy queries (#1595572, #1581848)
fd14c0
591d66
* Fri Apr 03 2020 Vit Mojzis <vmojzis@redhat.com> - 4.3.0-1
591d66
- SETools 4.3.0 release (#1820079)
591d66
- Revised sediff method for TE rules. This drastically reduced memory and run time.
591d66
- Added infiniband context support to seinfo, sediff, and apol.
591d66
- Added apol configuration for location of Qt assistant.
591d66
- Fixed sediff issue where properties header would display when not requested.
591d66
- Fixed sediff issue with type_transition file name comparison.
591d66
- Fixed permission map socket sendto information flow direction.
591d66
- Added methods to TypeAttribute class to make it a complete Python collection.
591d66
- Genfscon now will look up classes rather than using fixed values which
591d66
  were dropped from libsepol.
591d66
- setools requires -console, -console-analyses and -gui packages (#1820078)
591d66
e0325d
* Sat Nov 30 2019 Petr Lautrbach <plautrba@redhat.com> - 4.2.2-2
e0325d
- Build setools-console-analyses and setools-gui (#1731519)
e0325d
e0325d
* Mon Jul 08 2019 Vit Mojzis <vmojzis@redhat.com> - 4.2.2-1
e0325d
- SETools 4.2.2 release
e0325d
4da1f5
* Mon May 13 2019 Vit Mojzis <vmojzis@redhat.com> - 4.2.1-3
4da1f5
- Use %set_build_flags instead of %optflags
4da1f5
4da1f5
* Mon May 06 2019 Vit Mojzis <vmojzis@redhat.com> - 4.2.1-2
4da1f5
- SELinuxPolicy: Create a map of aliases on policy load (#1672631)
4da1f5
4da1f5
* Tue Mar 26 2019 Petr Lautrbach <plautrba@redhat.com> - 4.2.1-1
4da1f5
- SETools 4.2.1 release (#1581761, #1595582)
4da1f5
4da1f5
* Fri Nov 16 2018 Lumír Balhar <lbalhar@redhat.com> - 4.2.0-2
4da1f5
- Require platform-python-setuptools instead of python3-setuptools
4da1f5
- Resolves: rhbz#1650548
4da1f5
4da1f5
* Tue Nov 13 2018 Petr Lautrbach <plautrba@redhat.com> - 4.2.0-1
4da1f5
- SETools 4.2.0 release
4da1f5
4da1f5
* Mon Oct 01 2018 Vit Mojzis <vmojzis@redhat.com> - 4.2.0-0.3.rc
4da1f5
- Update upstream source to 4.2.0-rc
4da1f5
4da1f5
* Wed Aug 22 2018 Petr Lautrbach <plautrba@redhat.com> - 4.1.1-11
4da1f5
- Fix SCTP patch - https://github.com/SELinuxProject/setools/issues/9
4da1f5
4da1f5
* Thu Jun 14 2018 Petr Lautrbach <plautrba@redhat.com> - 4.1.1-10
4da1f5
- Move gui python files to -gui subpackage
4da1f5
- Do not build gui and console-analyses by default
4da1f5
4da1f5
* Wed Jun  6 2018 Petr Lautrbach <plautrba@redhat.com> - 4.1.1-9
4da1f5
- Don't build the Python 2 subpackage (#1567362)
4da1f5
4da1f5
* Thu Apr 26 2018 Vit Mojzis <vmojzis@redhat.com> - 4.1.1-8
4da1f5
- Add support for SCTP protocol (#1568333)
4da1f5
4da1f5
* Thu Apr 19 2018 Iryna Shcherbina <shcherbina.iryna@gmail.com> - 4.1.1-7
4da1f5
- Update Python 2 dependency declarations to new packaging standards
4da1f5
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
4da1f5
4da1f5
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.1-6
4da1f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
4da1f5
4da1f5
* Mon Sep 04 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.1-5
4da1f5
- setools-python2 requires python2-enum34
4da1f5
4da1f5
* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 4.1.1-4
4da1f5
- Add Provides for the old name without %%_isa
4da1f5
4da1f5
* Thu Aug 10 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 4.1.1-3
4da1f5
- Python 2 binary package renamed to python2-setools
4da1f5
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
4da1f5
- Python 3 binary package renamed to python3-setools
4da1f5
4da1f5
* Thu Aug 10 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.1-2
4da1f5
- bswap_* macros are defined in byteswap.h
4da1f5
4da1f5
* Mon Aug 07 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.1-1
4da1f5
- New upstream release
4da1f5
4da1f5
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-5
4da1f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
4da1f5
4da1f5
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-4
4da1f5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
4da1f5
4da1f5
* Mon May 22 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.0-3
4da1f5
- setools-python{,3} packages should have a weak dependency on libselinux-python{,3}
4da1f5
  (#1447747)
4da1f5
4da1f5
* Thu Feb 23 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.0-2
4da1f5
- Move python networkx dependency to -gui and -console-analyses
4da1f5
- Ship sedta and seinfoflow in setools-console-analyses
4da1f5
4da1f5
* Wed Feb 15 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.0-1
4da1f5
- New upstream release.