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
d5a84f0
%global sepol_ver 2.6-0
d5a84f0
%global selinux_ver 2.6-0
d5a84f0
d5a84f0
Name:           setools
d5a84f0
Version:        4.1.0
526a526
Release:        2%{?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
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
d5a84f0
BuildRequires:  python-devel
d5a84f0
d5a84f0
# BuildArch:      
d5a84f0
BuildRequires:  python-devel
d5a84f0
Requires:       %{name}-python3 = %{version}-%{release}
d5a84f0
BuildRequires:  python3-devel
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
Group:       System Environment/Base
12efca8
License:     GPLv2
12efca8
Requires:    setools-python3 = %{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
Group:       System Environment/Base
d570700
License:     GPLv2
d570700
Requires:    setools-python3 = %{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
d5a84f0
%package     python
d5a84f0
Summary:     Policy analysis tools for SELinux  
6023d0f
d5a84f0
%description python
d5a84f0
SETools is a collection of graphical tools, command-line tools, and
d5a84f0
Python 2 modules designed to facilitate SELinux policy analysis.
66ba7d0
d5a84f0
%package     python3
d5a84f0
Summary:     Policy analysis tools for SELinux  
d5a84f0
Obsoletes:   setools-libs < 4.0.0, setools-libs-tcl
db98489
d5a84f0
%description python3
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
d5a84f0
%defattr(-,root,root,-)
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
d5a84f0
%files python
d5a84f0
# %doc AUTHORS ChangeLog KNOWN-BUGS NEWS README
d5a84f0
%license COPYING COPYING.GPL COPYING.LGPL
d5a84f0
# For noarch packages: sitelib
d5a84f0
# %{python2_sitelib}/*
d5a84f0
# For arch-specific packages: sitearch
d5a84f0
%{python2_sitearch}/*
00fe000
d5a84f0
%files python3
d5a84f0
%license COPYING COPYING.GPL COPYING.LGPL
d5a84f0
# %doc AUTHORS ChangeLog KNOWN-BUGS NEWS README
d5a84f0
# For noarch packages: sitelib
d5a84f0
# %{python3_sitelib}/*
d5a84f0
# For arch-specific packages: sitearch
d5a84f0
%{python3_sitearch}/*
a73038c
d5a84f0
%files gui
d5a84f0
%{_bindir}/apol
d570700
%{_mandir}/man1/apol*
a557fc8
d5a84f0
%changelog
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.