forked from RedHatOfficial/rhsecapi
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrhsecapi.spec
More file actions
137 lines (121 loc) · 4.46 KB
/
rhsecapi.spec
File metadata and controls
137 lines (121 loc) · 4.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Disable the debuginfo build operation
%global debug_package %{nil}
%if 0%{?fedora}
%bcond_without python3
%else
%if 0%{?rhel} >= 8
%bcond_without python3
%else
%bcond_with python3
%endif
%endif
Name: rhsecapi
Version: 1.0.6
Release: 1%{?dist}
Summary: Provides a simple interface for the Red Hat Security Data API
License: GPL
URL: https://github.com/RedHatOfficial/rhsecapi
Source: %{name}-%{version}.tar.gz
%if %{with python3}
BuildRequires: python3-devel python3-setuptools
Requires: python3-requests python3-%{name}
%else
BuildRequires: python-devel python-setuptools
Requires: python-argparse python-requests python-%{name}
%endif
%description
Leverage Red Hat's Security Data API to find CVEs by various attributes
(date, severity, scores, package, IAVA, etc). Retrieve customizable details
about found CVEs or about specific CVE ids input on cmdline. Parse
arbitrary stdin for CVE ids and generate a customized report, optionally
sending it straight to pastebin. Searches are done via a single
instantaneous http request and CVE retrieval is parallelized, utilizing
multiple threads at once. Python requests is used for all remote
communication, so proxy support is baked right in. BASH intelligent
tab-completion is supported via optional Python argcomplete module. Python2
tested on RHEL6, RHEL7, & Fedora and Python3 on Fedora but since it doesnt
integrate with RHN/RHSM/yum/Satellite, it can be used on any
internet-connected machine. Feedback, feature requests, and code
contributions welcome.
%if %{with python3}
%package -n python3-%{name}
Summary: Provides a simple interface for the Red Hat Security Data API
%description -n python3-%{name}
Leverage Red Hat's Security Data API to find CVEs by various attributes
(date, severity, scores, package, IAVA, etc). Retrieve customizable details
about found CVEs or about specific CVE ids input on cmdline. Parse
arbitrary stdin for CVE ids and generate a customized report, optionally
sending it straight to pastebin. Searches are done via a single
instantaneous http request and CVE retrieval is parallelized, utilizing
multiple threads at once. Python requests is used for all remote
communication, so proxy support is baked right in. BASH intelligent
tab-completion is supported via optional Python argcomplete module. Python2
tested on RHEL6, RHEL7, & Fedora and Python3 on Fedora but since it doesnt
integrate with RHN/RHSM/yum/Satellite, it can be used on any
internet-connected machine. Feedback, feature requests, and code
contributions welcome.
%else
%package -n python2-%{name}
Summary: Provides a simple interface for the Red Hat Security Data API
%description -n python2-%{name}
Leverage Red Hat's Security Data API to find CVEs by various attributes
(date, severity, scores, package, IAVA, etc). Retrieve customizable details
about found CVEs or about specific CVE ids input on cmdline. Parse
arbitrary stdin for CVE ids and generate a customized report, optionally
sending it straight to pastebin. Searches are done via a single
instantaneous http request and CVE retrieval is parallelized, utilizing
multiple threads at once. Python requests is used for all remote
communication, so proxy support is baked right in. BASH intelligent
tab-completion is supported via optional Python argcomplete module. Python2
tested on RHEL6, RHEL7, & Fedora and Python3 on Fedora but since it doesnt
integrate with RHN/RHSM/yum/Satellite, it can be used on any
internet-connected machine. Feedback, feature requests, and code
contributions welcome.
%endif
%prep
%autosetup -c
%if %{with python3}
cp -a %{name}-%{version} python3
%else
cp -a %{name}-%{version} python2
%endif
%build
rm -rf $RPM_BUILD_ROOT
mkdir $RPM_BUILD_ROOT
%if %{with python3}
pushd python3
# Remove CFLAGS=... for noarch packages (unneeded)
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
popd
%else
pushd python2
# Remove CFLAGS=... for noarch packages (unneeded)
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
popd
%endif
%install
rm -rf $RPM_BUILD_ROOT
%if %{with python3}
pushd python3
%{__python3} setup.py install -O1 --root $RPM_BUILD_ROOT/
popd
%else
pushd python2
%{__python} setup.py install -O1 --root $RPM_BUILD_ROOT/
popd
%endif
%files
%{_bindir}/*
# For noarch packages: sitelib
%if %{with python3}
%files -n python3-%{name}
%{_bindir}/*
# For noarch packages: sitelib
%{python3_sitelib}/*
%else
%files -n python2-%{name}
%{python_sitelib}/*
%endif
%changelog
* Wed Apr 03 2024 Kyle Walker <kwalker@redhat.com> 1.0.6-1
- new package built with tito