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
d5a84f
%global sepol_ver 2.6-0
d5a84f
%global selinux_ver 2.6-0
d5a84f
d5a84f
Name:           setools
d5a84f
Version:        4.1.0
03687f
Release:        5%{?setools_pre_ver:.%{setools_pre_ver}}%{?dist}
d5a84f
Summary:        Policy analysis tools for SELinux
d5a84f
d5a84f
License:        GPLv2
d5a84f
URL:            https://github.com/TresysTechnology/setools/wiki
d5a84f
Source0:        https://github.com/TresysTechnology/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
31fd61
Patch3:         0003-bswap_-macros-are-defined-in-byteswap.h.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
c9f64b
BuildRequires:  python2-devel
c9f64b
BuildRequires:  python2-setuptools
c9f64b
BuildRequires:  python3-devel
c9f64b
BuildRequires:  python3-setuptools
d5a84f
d5a84f
# BuildArch:      
d5a84f
Requires:       %{name}-python3 = %{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
Group:       System Environment/Base
12efca
License:     GPLv2
12efca
Requires:    setools-python3 = %{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
Group:       System Environment/Base
d57070
License:     GPLv2
d57070
Requires:    setools-python3 = %{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
d5a84f
%package     python
d5a84f
Summary:     Policy analysis tools for SELinux  
7bfe6f
Recommends:  libselinux-python
03687f
Requires:    python-enum34
6023d0
d5a84f
%description python
d5a84f
SETools is a collection of graphical tools, command-line tools, and
d5a84f
Python 2 modules designed to facilitate SELinux policy analysis.
66ba7d
d5a84f
%package     python3
d5a84f
Summary:     Policy analysis tools for SELinux  
d5a84f
Obsoletes:   setools-libs < 4.0.0, setools-libs-tcl
7bfe6f
Recommends:  libselinux-python3
db9848
d5a84f
%description python3
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
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
d5a84f
# Remove CFLAGS=... for noarch packages (unneeded)
12efca
CFLAGS="%{optflags}" %{__python3} setup.py 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}
12efca
%{__python3} setup.py install --root %{buildroot}
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
d5a84f
%defattr(-,root,root,-)
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
d5a84f
%files python
d5a84f
# %doc AUTHORS ChangeLog KNOWN-BUGS NEWS README
d5a84f
%license COPYING COPYING.GPL COPYING.LGPL
d5a84f
# For noarch packages: sitelib
d5a84f
# %{python2_sitelib}/*
d5a84f
# For arch-specific packages: sitearch
d5a84f
%{python2_sitearch}/*
00fe00
d5a84f
%files python3
d5a84f
%license COPYING COPYING.GPL COPYING.LGPL
d5a84f
# %doc AUTHORS ChangeLog KNOWN-BUGS NEWS README
d5a84f
# For noarch packages: sitelib
d5a84f
# %{python3_sitelib}/*
d5a84f
# For arch-specific packages: sitearch
d5a84f
%{python3_sitearch}/*
a73038
d5a84f
%files gui
d5a84f
%{_bindir}/apol
d57070
%{_mandir}/man1/apol*
a557fc
d5a84f
%changelog
03687f
* Mon Sep 04 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.0-5}
03687f
- setools-python requires python-enum34
03687f
31fd61
* Mon Sep 04 2017 Petr Lautrbach <plautrba@redhat.com> - 4.1.0-4
31fd61
- bswap_* macros are defined in byteswap.h
31fd61
31fd61
* 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.