d5a84f0
# sitelib for noarch packages, sitearch for others (remove the unneeded one)
d5a84f0
%{!?__python2: %global __python2 %__python}
d5a84f0
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
d5a84f0
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
d5a84f0
d5a84f0
# % global setools_pre_ver beta.1.8e09d95
d5a84f0
# % global gitver f1e5b20
d5a84f0
13a8a83
%global sepol_ver 2.7-1
13a8a83
%global selinux_ver 2.7-1
d5a84f0
d5a84f0
Name:           setools
13a8a83
Version:        4.1.1
3bb977d
Release:        11%{?setools_pre_ver:.%{setools_pre_ver}}%{?dist}
d5a84f0
Summary:        Policy analysis tools for SELinux
d5a84f0
d5a84f0
License:        GPLv2
d5a84f0
URL:            https://github.com/TresysTechnology/setools/wiki
d5a84f0
Source0:        https://github.com/TresysTechnology/setools/archive/%{version}%{?setools_pre_ver:-%{setools_pre_ver}}.tar.gz
d5a84f0
Source1:        setools.pam
d5a84f0
Source2:        apol.desktop
fdd5e43
Patch1:         0001-Do-not-use-Werror-during-build.patch
d570700
Patch2:         0002-Do-not-export-use-setools.InfoFlowAnalysis-and-setoo.patch
5739cf7
Patch3:         0003-bswap_-macros-are-defined-in-byteswap.h.patch
efa4712
Patch4:         0004-Add-support-for-SCTP-protocol.patch
d5a84f0
d5a84f0
Obsoletes:      setools < 4.0.0, setools-devel < 4.0.0
d5a84f0
BuildRequires:  flex,  bison
442c972
BuildRequires:  glibc-devel, gcc, git
e236753
BuildRequires:  libsepol-devel >= %{sepol_ver}, libsepol-static >= %{sepol_ver}
d5a84f0
BuildRequires:  qt5-qtbase-devel
d5a84f0
BuildRequires:  swig
ccf0ebf
BuildRequires:  python2-devel
ccf0ebf
BuildRequires:  python2-setuptools
ccf0ebf
BuildRequires:  python3-devel
ccf0ebf
BuildRequires:  python3-setuptools
d5a84f0
d5a84f0
# BuildArch:      
051ad0f
Requires:       python3-%{name} = %{version}-%{release}
933ef7d
cvsdist ea3dcf6
%description
6023d0f
SETools is a collection of graphical tools, command-line tools, and
d5a84f0
Python modules designed to facilitate SELinux policy analysis.
6023d0f
12efca8
%package     console
12efca8
Summary:     Policy analysis command-line tools for SELinux
12efca8
License:     GPLv2
051ad0f
Requires:    python3-setools = %{version}-%{release}
12efca8
Requires:    libselinux >= %{selinux_ver}
6023d0f
6023d0f
%description console
6023d0f
SETools is a collection of graphical tools, command-line tools, and
6023d0f
libraries designed to facilitate SELinux policy analysis.
6023d0f
6023d0f
This package includes the following console tools:
6023d0f
d5a84f0
  sediff       Compare two policies to find differences.
d5a84f0
  seinfo       List policy components.
d5a84f0
  sesearch     Search rules (allow, type_transition, etc.)
cvsdist ea3dcf6
cvsdist ea3dcf6
d570700
%package     console-analyses
d570700
Summary:     Policy analysis command-line tools for SELinux
d570700
License:     GPLv2
051ad0f
Requires:    python3-setools = %{version}-%{release}
d570700
Requires:    libselinux >= %{selinux_ver}
d570700
Requires:    python3-networkx
d570700
d570700
%description console-analyses
d570700
SETools is a collection of graphical tools, command-line tools, and
d570700
libraries designed to facilitate SELinux policy analysis.
d570700
d570700
This package includes the following console tools:
d570700
d570700
  sedta        Perform domain transition analyses.
d570700
  seinfoflow   Perform information flow analyses.
d570700
d570700
be3765e
%package     -n python2-setools
d5a84f0
Summary:     Policy analysis tools for SELinux  
2dcce95
Recommends:  python2-libselinux
be3765e
%{?python_provide:%python_provide python2-setools}
be3765e
# Remove before F30
7672531
Provides: %{name}-python = %{version}-%{release}
be3765e
Provides: %{name}-python%{?_isa} = %{version}-%{release}
be3765e
Obsoletes: %{name}-python < %{version}-%{release}
1924f09
Requires:    python2-enum34
6023d0f
be3765e
%description -n python2-setools
d5a84f0
SETools is a collection of graphical tools, command-line tools, and
d5a84f0
Python 2 modules designed to facilitate SELinux policy analysis.
66ba7d0
051ad0f
%package     -n python3-setools
d5a84f0
Summary:     Policy analysis tools for SELinux  
950d0d1
Obsoletes:   setools-libs < 4.0.0
7bfe6fa
Recommends:  libselinux-python3
051ad0f
%{?python_provide:%python_provide python2-setools}
051ad0f
# Remove before F30
7672531
Provides: %{name}-python3 = %{version}-%{release}
051ad0f
Provides: %{name}-python3%{?_isa} = %{version}-%{release}
051ad0f
Obsoletes: %{name}-python3 < %{version}-%{release}
db98489
051ad0f
%description -n python3-setools
d5a84f0
SETools is a collection of graphical tools, command-line tools, and
d5a84f0
Python 3 modules designed to facilitate SELinux policy analysis.
0fd1802
26a7d40
d5a84f0
%package     gui
d5a84f0
Summary:     Policy analysis graphical tools for SELinux
d5a84f0
Requires:    python3-qt5
d570700
Requires:    python3-networkx
b7aa74d
d5a84f0
%description gui
d5a84f0
SETools is a collection of graphical tools, command-line tools, and
d5a84f0
Python modules designed to facilitate SELinux policy analysis.
52c9820
f1f2c58
d5a84f0
%prep
442c972
%autosetup -p 1 -S git
2456e82
12efca8
cp -a ../setools-%{version}%{?setools_pre_ver:-%{setools_pre_ver}} ../setools-%{version}%{?setools_pre_ver:-%{setools_pre_ver}}-python2
f4279f3
764e716
d5a84f0
%build
d5a84f0
# Remove CFLAGS=... for noarch packages (unneeded)
12efca8
CFLAGS="%{optflags}" %{__python3} setup.py build
764e716
12efca8
pushd ../setools-%{version}%{?setools_pre_ver:-%{setools_pre_ver}}-python2
d5a84f0
# Remove CFLAGS=... for noarch packages (unneeded)
12efca8
CFLAGS="%{optflags}" %{__python2} setup.py build
d5a84f0
popd
764e716
764e716
d5a84f0
%install
d5a84f0
rm -rf %{buildroot}
12efca8
pushd ../setools-%{version}%{?setools_pre_ver:-%{setools_pre_ver}}-python2
d5a84f0
%{__python2} setup.py install --root %{buildroot}
d5a84f0
popd
d5a84f0
12efca8
rm -rf %{buildroot}%{_bindir}
12efca8
%{__python3} setup.py install --root %{buildroot}
d5a84f0
d5a84f0
%check
d5a84f0
%if %{?_with_check:1}%{!?_with_check:0}
12efca8
%{__python3} setup.py test
d5a84f0
12efca8
pushd ../setools-%{version}%{?setools_pre_ver:-%{setools_pre_ver}}-python2
d5a84f0
%{__python2} setup.py test
d5a84f0
popd
d5a84f0
%endif
277093c
019b809
d5a84f0
%files
1a39aa9
d5a84f0
%files console
d5a84f0
%{_bindir}/sediff
d5a84f0
%{_bindir}/seinfo
d5a84f0
%{_bindir}/sesearch
d570700
%{_mandir}/man1/sediff*
d570700
%{_mandir}/man1/seinfo*
d570700
%{_mandir}/man1/sesearch*
d570700
d570700
%files console-analyses
d570700
%{_bindir}/sedta
d570700
%{_bindir}/seinfoflow
d570700
%{_mandir}/man1/sedta*
d570700
%{_mandir}/man1/seinfoflow*
d01ce99
be3765e
%files -n python2-setools
d5a84f0
%license COPYING COPYING.GPL COPYING.LGPL
d5a84f0
%{python2_sitearch}/*
00fe000
051ad0f
%files -n python3-setools
d5a84f0
%license COPYING COPYING.GPL COPYING.LGPL
afb5e45
%{python3_sitearch}/setools
afb5e45
%{python3_sitearch}/setools-*
a73038c
d5a84f0
%files gui
d5a84f0
%{_bindir}/apol
afb5e45
%{python3_sitearch}/setoolsgui
d570700
%{_mandir}/man1/apol*
a557fc8
d5a84f0
%changelog
3bb977d
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.1-11
3bb977d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
3bb977d
a5d7dbf
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 4.1.1-10
a5d7dbf
- Rebuilt for Python 3.7
a5d7dbf
9ad7d4e
* Thu Jun 14 2018 Petr Lautrbach <plautrba@redhat.com> - 4.1.1-9
f73658f
- Move gui python files to -gui subpackage
f73658f
efa4712
* Thu Apr 26 2018 Vit Mojzis <vmojzis@redhat.com> - 4.1.1-8
efa4712
- Add support for SCTP protocol (#1568333)
efa4712
2dcce95
* Thu Apr 19 2018 Iryna Shcherbina <shcherbina.iryna@gmail.com> - 4.1.1-7
2dcce95
- Update Python 2 dependency declarations to new packaging standards
2dcce95
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
2dcce95
3a754fe
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.1-6
3a754fe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
3a754fe
1924f09
* Mon Sep 04 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.1-5
1924f09
- setools-python2 requires python2-enum34
1924f09
7672531
* Sun Aug 20 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 4.1.1-4
7672531
- Add Provides for the old name without %%_isa
7672531
be3765e
* Thu Aug 10 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 4.1.1-3
be3765e
- Python 2 binary package renamed to python2-setools
be3765e
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
051ad0f
- Python 3 binary package renamed to python3-setools
be3765e
5739cf7
* Thu Aug 10 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.1-2
5739cf7
- bswap_* macros are defined in byteswap.h
5739cf7
13a8a83
* Mon Aug 07 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.1-1
13a8a83
- New upstream release
13a8a83
4006d5c
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-5
4006d5c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
4006d5c
869ecbd
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-4
869ecbd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
869ecbd
13a8a83
* Mon May 22 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.0-3
7bfe6fa
- setools-python{,3} packages should have a weak dependency on libselinux-python{,3}
7bfe6fa
  (#1447747)
7bfe6fa
526a526
* Thu Feb 23 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.0-2
526a526
- Move python networkx dependency to -gui and -console-analyses
526a526
- Ship sedta and seinfoflow in setools-console-analyses
526a526
d5a84f0
* Wed Feb 15 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.0-1
308e8fe
- New upstream release.