d5a84f
# sitelib for noarch packages, sitearch for others (remove the unneeded one)
d5a84f
%{!?__python2: %global __python2 %__python}
d5a84f
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
d5a84f
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
d5a84f
d5a84f
# % global setools_pre_ver beta.1.8e09d95
d5a84f
# % global gitver f1e5b20
d5a84f
b2615b
%global sepol_ver 2.8-1
b2615b
%global selinux_ver 2.8-1
d5a84f
d5a84f
Name:           setools
13a8a8
Version:        4.1.1
0818b3
Release:        14%{?setools_pre_ver:.%{setools_pre_ver}}%{?dist}
d5a84f
Summary:        Policy analysis tools for SELinux
d5a84f
d5a84f
License:        GPLv2
b2615b
URL:            https://github.com/SELinuxProject/setools/wiki
b2615b
Source0:        https://github.com/SELinuxProject/setools/archive/%{version}%{?setools_pre_ver:-%{setools_pre_ver}}.tar.gz
d5a84f
Source1:        setools.pam
d5a84f
Source2:        apol.desktop
fdd5e4
Patch1:         0001-Do-not-use-Werror-during-build.patch
d57070
Patch2:         0002-Do-not-export-use-setools.InfoFlowAnalysis-and-setoo.patch
5739cf
Patch3:         0003-bswap_-macros-are-defined-in-byteswap.h.patch
efa471
Patch4:         0004-Add-support-for-SCTP-protocol.patch
d5a84f
d5a84f
Obsoletes:      setools < 4.0.0, setools-devel < 4.0.0
d5a84f
BuildRequires:  flex,  bison
442c97
BuildRequires:  glibc-devel, gcc, git
e23675
BuildRequires:  libsepol-devel >= %{sepol_ver}, libsepol-static >= %{sepol_ver}
d5a84f
BuildRequires:  qt5-qtbase-devel
d5a84f
BuildRequires:  swig
ccf0eb
BuildRequires:  python2-devel
ccf0eb
BuildRequires:  python2-setuptools
ccf0eb
BuildRequires:  python3-devel
ccf0eb
BuildRequires:  python3-setuptools
d5a84f
d5a84f
# BuildArch:      
051ad0
Requires:       python3-%{name} = %{version}-%{release}
933ef7
cvsdist ea3dcf
%description
6023d0
SETools is a collection of graphical tools, command-line tools, and
d5a84f
Python modules designed to facilitate SELinux policy analysis.
6023d0
12efca
%package     console
12efca
Summary:     Policy analysis command-line tools for SELinux
12efca
License:     GPLv2
051ad0
Requires:    python3-setools = %{version}-%{release}
12efca
Requires:    libselinux >= %{selinux_ver}
6023d0
6023d0
%description console
6023d0
SETools is a collection of graphical tools, command-line tools, and
6023d0
libraries designed to facilitate SELinux policy analysis.
6023d0
6023d0
This package includes the following console tools:
6023d0
d5a84f
  sediff       Compare two policies to find differences.
d5a84f
  seinfo       List policy components.
d5a84f
  sesearch     Search rules (allow, type_transition, etc.)
cvsdist ea3dcf
cvsdist ea3dcf
d57070
%package     console-analyses
d57070
Summary:     Policy analysis command-line tools for SELinux
d57070
License:     GPLv2
051ad0
Requires:    python3-setools = %{version}-%{release}
d57070
Requires:    libselinux >= %{selinux_ver}
d57070
Requires:    python3-networkx
d57070
d57070
%description console-analyses
d57070
SETools is a collection of graphical tools, command-line tools, and
d57070
libraries designed to facilitate SELinux policy analysis.
d57070
d57070
This package includes the following console tools:
d57070
d57070
  sedta        Perform domain transition analyses.
d57070
  seinfoflow   Perform information flow analyses.
d57070
d57070
be3765
%package     -n python2-setools
d5a84f
Summary:     Policy analysis tools for SELinux  
2dcce9
Recommends:  python2-libselinux
be3765
%{?python_provide:%python_provide python2-setools}
be3765
# Remove before F30
767253
Provides: %{name}-python = %{version}-%{release}
be3765
Provides: %{name}-python%{?_isa} = %{version}-%{release}
be3765
Obsoletes: %{name}-python < %{version}-%{release}
1924f0
Requires:    python2-enum34
ec182a
Requires:    python2-setuptools
6023d0
be3765
%description -n python2-setools
d5a84f
SETools is a collection of graphical tools, command-line tools, and
d5a84f
Python 2 modules designed to facilitate SELinux policy analysis.
66ba7d
051ad0
%package     -n python3-setools
d5a84f
Summary:     Policy analysis tools for SELinux  
950d0d
Obsoletes:   setools-libs < 4.0.0
7bfe6f
Recommends:  libselinux-python3
051ad0
%{?python_provide:%python_provide python2-setools}
051ad0
# Remove before F30
767253
Provides: %{name}-python3 = %{version}-%{release}
051ad0
Provides: %{name}-python3%{?_isa} = %{version}-%{release}
051ad0
Obsoletes: %{name}-python3 < %{version}-%{release}
ec182a
Requires:    python3-setuptools
db9848
051ad0
%description -n python3-setools
d5a84f
SETools is a collection of graphical tools, command-line tools, and
d5a84f
Python 3 modules designed to facilitate SELinux policy analysis.
0fd180
26a7d4
d5a84f
%package     gui
d5a84f
Summary:     Policy analysis graphical tools for SELinux
fd63d7
Requires:    python3-setools = %{version}-%{release}
d5a84f
Requires:    python3-qt5
d57070
Requires:    python3-networkx
b7aa74
d5a84f
%description gui
d5a84f
SETools is a collection of graphical tools, command-line tools, and
d5a84f
Python modules designed to facilitate SELinux policy analysis.
52c982
f1f2c5
d5a84f
%prep
442c97
%autosetup -p 1 -S git
2456e8
12efca
cp -a ../setools-%{version}%{?setools_pre_ver:-%{setools_pre_ver}} ../setools-%{version}%{?setools_pre_ver:-%{setools_pre_ver}}-python2
f4279f
764e71
d5a84f
%build
aae45e
%py3_build
764e71
12efca
pushd ../setools-%{version}%{?setools_pre_ver:-%{setools_pre_ver}}-python2
d5a84f
# Remove CFLAGS=... for noarch packages (unneeded)
12efca
CFLAGS="%{optflags}" %{__python2} setup.py build
d5a84f
popd
764e71
764e71
d5a84f
%install
d5a84f
rm -rf %{buildroot}
12efca
pushd ../setools-%{version}%{?setools_pre_ver:-%{setools_pre_ver}}-python2
d5a84f
%{__python2} setup.py install --root %{buildroot}
d5a84f
popd
d5a84f
12efca
rm -rf %{buildroot}%{_bindir}
aae45e
%py3_install
d5a84f
d5a84f
%check
d5a84f
%if %{?_with_check:1}%{!?_with_check:0}
12efca
%{__python3} setup.py test
d5a84f
12efca
pushd ../setools-%{version}%{?setools_pre_ver:-%{setools_pre_ver}}-python2
d5a84f
%{__python2} setup.py test
d5a84f
popd
d5a84f
%endif
277093
019b80
d5a84f
%files
1a39aa
d5a84f
%files console
d5a84f
%{_bindir}/sediff
d5a84f
%{_bindir}/seinfo
d5a84f
%{_bindir}/sesearch
d57070
%{_mandir}/man1/sediff*
d57070
%{_mandir}/man1/seinfo*
d57070
%{_mandir}/man1/sesearch*
d57070
d57070
%files console-analyses
d57070
%{_bindir}/sedta
d57070
%{_bindir}/seinfoflow
d57070
%{_mandir}/man1/sedta*
d57070
%{_mandir}/man1/seinfoflow*
d01ce9
be3765
%files -n python2-setools
d5a84f
%license COPYING COPYING.GPL COPYING.LGPL
d5a84f
%{python2_sitearch}/*
00fe00
051ad0
%files -n python3-setools
d5a84f
%license COPYING COPYING.GPL COPYING.LGPL
afb5e4
%{python3_sitearch}/setools
afb5e4
%{python3_sitearch}/setools-*
a73038
d5a84f
%files gui
d5a84f
%{_bindir}/apol
afb5e4
%{python3_sitearch}/setoolsgui
d57070
%{_mandir}/man1/apol*
a557fc
d5a84f
%changelog
0818b3
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.1-14
0818b3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
0818b3
ec182a
* Wed Aug 29 2018 Vit Mojzis <vmojzis@redhat.com> - 4.1.1-13
ec182a
- Add Requires for python[23]-setuptools - no longer required (just recommended)
ec182a
  by python[23] (#1623371)
ec182a
618f97
* Wed Aug 22 2018 Petr Lautrbach <plautrba@redhat.com> - 4.1.1-12.1
b2615b
- Fix SCTP patch - https://github.com/SELinuxProject/setools/issues/9
b2615b
3bb977
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.1-11
3bb977
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
3bb977
a5d7db
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 4.1.1-10
a5d7db
- Rebuilt for Python 3.7
a5d7db
9ad7d4
* Thu Jun 14 2018 Petr Lautrbach <plautrba@redhat.com> - 4.1.1-9
f73658
- Move gui python files to -gui subpackage
f73658
efa471
* Thu Apr 26 2018 Vit Mojzis <vmojzis@redhat.com> - 4.1.1-8
efa471
- Add support for SCTP protocol (#1568333)
efa471
2dcce9
* Thu Apr 19 2018 Iryna Shcherbina <shcherbina.iryna@gmail.com> - 4.1.1-7
2dcce9
- Update Python 2 dependency declarations to new packaging standards
2dcce9
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
2dcce9
3a754f
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.1-6
3a754f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
3a754f
1924f0
* Mon Sep 04 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.1-5
1924f0
- setools-python2 requires python2-enum34
1924f0
767253
* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 4.1.1-4
767253
- Add Provides for the old name without %%_isa
767253
be3765
* Thu Aug 10 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 4.1.1-3
be3765
- Python 2 binary package renamed to python2-setools
be3765
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
051ad0
- Python 3 binary package renamed to python3-setools
be3765
5739cf
* Thu Aug 10 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.1-2
5739cf
- bswap_* macros are defined in byteswap.h
5739cf
13a8a8
* Mon Aug 07 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.1-1
13a8a8
- New upstream release
13a8a8
4006d5
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-5
4006d5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
4006d5
869ecb
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-4
869ecb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
869ecb
13a8a8
* Mon May 22 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.0-3
7bfe6f
- setools-python{,3} packages should have a weak dependency on libselinux-python{,3}
7bfe6f
  (#1447747)
7bfe6f
526a52
* Thu Feb 23 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.0-2
526a52
- Move python networkx dependency to -gui and -console-analyses
526a52
- Ship sedta and seinfoflow in setools-console-analyses
526a52
d5a84f
* Wed Feb 15 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.0-1
308e8f
- New upstream release.