From 5028af8f685c0d3d22079ed664e468bdeab2a60e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Feb 02 2020 21:45:18 +0000 Subject: * Thu Jan 30 2020 Fabian Affolter - 1.21.3-3 - Fix line endings * Tue Jan 28 2020 Fabian Affolter - 1.21.3-2 - Fix ownership - Improve the check workflow (rhbz#1795077) * Sun Jan 26 2020 Fabian Affolter - 1.21.3-1 - Initial package for Fedora --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..52513bf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/shodan-1.21.3.tar.gz diff --git a/python-shodan.spec b/python-shodan.spec new file mode 100644 index 0000000..76c3d24 --- /dev/null +++ b/python-shodan.spec @@ -0,0 +1,104 @@ +%global pypi_name shodan +# The tests require a working API key and the possibility to connect to Shodan.io +%bcond_with api_key +# Add your Shodan.io API key +%global api_key ABCDEFGH + +Name: python-%{pypi_name} +Version: 1.21.3 +Release: 3%{?dist} +Summary: Python library and command-line utility for Shodan.io + +License: MIT +URL: https://github.com/achillean/shodan-python +Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz +BuildArch: noarch + +%description +The official Python library and CLI for Shodan Shodan is a search engine for +Internet-connected devices. Google lets you search for websites, Shodan lets +you search for devices. This library provides developers easy access to all +of the data stored in Shodan in order to automate tasks and integrate into +existing tools. + +%package -n python3-%{pypi_name} +Summary: %{summary} + +BuildRequires: python3-devel +BuildRequires: python3-click +BuildRequires: python3-click-plugins +BuildRequires: python3-colorama +BuildRequires: python3-requests +BuildRequires: python3-setuptools +BuildRequires: python3-xlsxwriter +%{?python_provide:%python_provide python3-%{pypi_name}} + +%description -n python3-%{pypi_name} +The official Python library and CLI for Shodan Shodan is a search engine for +Internet-connected devices. Google lets you search for websites, Shodan lets +you search for devices. This library provides developers easy access to all +of the data stored in Shodan in order to automate tasks and integrate into +existing tools. + +%package -n python-%{pypi_name}-doc +Summary: %{name} documentation + +BuildRequires: python3-sphinx + +%description -n python-%{pypi_name}-doc +Documentation for %{name}. + +%package -n %{pypi_name} +Summary: CLI tool to access Shodan.io + +Requires: python3-%{pypi_name} = %{?epoch:%{epoch}:}%{version}-%{release} + +%description -n %{pypi_name} +Command-line tool to to access Shodan.io. + +%prep +%autosetup -n %{pypi_name}-python-%{version} +rm -rf %{pypi_name}.egg-info +sed -i -e '/^#!\//, 1d' shodan/cli/worldmap.py +dos2unix docs/{api.rst,tutorial.rst} +dos2unix docs/examples/{basic-search.rst,cert-stream.rst,query-summary.rst} +%if %{with api_key} +echo %{api_key} > SHODAN-API-KEY +%endif + +%build +%py3_build +PYTHONPATH=${PWD} sphinx-build-3 docs html +rm -rf html/.{doctrees,buildinfo} + +%install +%py3_install + +%if %{with api_key} +%check +%{__python3} setup.py test +%endif + +%files -n python3-%{pypi_name} +%license LICENSE +%doc README.rst +%{python3_sitelib}/%{pypi_name}/ +%{python3_sitelib}/%{pypi_name}-*.egg-info/ + +%files -n %{pypi_name} +%{_bindir}/%{pypi_name} + +%files -n python-%{pypi_name}-doc +%doc html +%license LICENSE + +%changelog +* Thu Jan 30 2020 Fabian Affolter - 1.21.3-3 +- Fix line endings + +* Tue Jan 28 2020 Fabian Affolter - 1.21.3-2 +- Fix ownership +- Improve the check workflow (rhbz#1795077) + +* Sun Jan 26 2020 Fabian Affolter - 1.21.3-1 +- Initial package for Fedora diff --git a/sources b/sources new file mode 100644 index 0000000..9d2a9eb --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (shodan-1.21.3.tar.gz) = 83f5d31d9cf5cdfcb6b2ab1625b5bbf69f18eda0753a1664a753d5366f493bac64a03d8fd86bca196eb9cc7911f0c4c2e9bc8155af8c69cf40b9ff42582f4db0