Files
python-pymisp/python-pymisp.spec

99 lines
4.4 KiB
RPMSpec

#
# spec file for package python-pymisp
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%{!?license: %global license %doc}
%bcond_without test
Name: python-pymisp
Version: 2.4.79
Release: 0
Summary: Python API for MISP
License: BSD-2-Clause
Group: Development/Languages/Python
Url: https://github.com/MISP/PyMISP
Source: https://files.pythonhosted.org/packages/source/p/pymisp/pymisp-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
%if %{with test}
BuildRequires: %{python_module jsonschema}
BuildRequires: %{python_module python-dateutil}
BuildRequires: %{python_module requests-mock}
BuildRequires: %{python_module requests}
%endif
# SECTION docs
BuildRequires: python3-CommonMark
BuildRequires: python3-Sphinx
BuildRequires: python3-recommonmark
# /SECTION
Requires: python-jsonschema
Requires: python-python-dateutil
Requires: python-requests
Suggests: %{name}-doc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%python_subpackages
%package -n %{name}-doc
Summary: Examples and Documentation for %{name}
Group: Documentation/HTML
%description
PyMISP is a Python library to access MISP platforms via their REST API.
PyMISP allows you to fetch events, add or update events/attributes, add or update samples or search for attributes.
%description -n %{name}-doc
Examples and HTML documentation for %{name}.
%prep
%setup -q -n pymisp-%{version}
sed -i '1s/^#!.*//' pymisp/tools/neo4j.py pymisp/tools/openioc.py pymisp/mispevent.py pymisp/tools/stix.py pymisp/exceptions.py pymisp/api.py examples/edit_user_json.py examples/get.py examples/create_events.py examples/events/create_dummy_event.py examples/searchall.py examples/ioc-2-misp/ioc2misp.py examples/del.py examples/add_user_json.py examples/test_sign.py examples/sighting.py examples/delete_user.py examples/misp2clamav.py examples/get_network_activity.py examples/copy_list.py examples/situational-awareness/attribute_treemap.py examples/events/create_massive_dummy_events.py examples/add_user.py examples/up.py examples/feed-generator/generate.py examples/yara_dump.py examples/suricata.py examples/yara.py examples/tags.py examples/graphdb/make_neo4j.py examples/edit_user.py examples/last.py examples/et2misp.py examples/stats.py examples/upload.py examples/suricata.py examples/upload.py examples/sighting.py examples/get_network_activity.py examples/yara.py examples/events/create_massive_dummy_events.py examples/add_user_json.py examples/tags.py examples/edit_user_json.py examples/last.py examples/feed-generator/generate.py examples/stats.py examples/del.py examples/searchall.py examples/situational-awareness/attribute_treemap.py examples/up.py examples/delete_user.py examples/misp2clamav.py examples/edit_user.py examples/get.py examples/create_events.py examples/events/create_dummy_event.py examples/test_sign.py examples/copy_list.py examples/yara_dump.py examples/add_user.py examples/ioc-2-misp/ioc2misp.py examples/et2misp.py examples/graphdb/make_neo4j.py examples/search.py examples/addtag.py examples/tagstatistics.py examples/add_named_attribute.py examples/users_list.py examples/sharing_groups.py examples/addtag2.py
%build
%python_build
pushd docs
export LANG=en_US.UTF-8
make html
rm build/html/.buildinfo
popd
%install
%python_install
%{python_expand %fdupes %{buildroot}%{$python_sitelib}}
%if %{with test}
%check
# Requires internet access and a MISP-instance
rm tests/test.py
%python_exec setup.py test
%endif
%files %{python_files}
%defattr(-,root,root,-)
%doc README.md
%%license LICENSE
%{python_sitelib}/*
%files -n %{name}-doc
%doc examples docs/build/html
%changelog