Репозиторий Sisyphus
Последнее обновление: 22 октября 2020 | Пакетов: 17699 | Посещений: 19461244
en ru br
Репозитории ALT

Группа :: Other
Пакет: cve-manager

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%define cve_group  cve
%define backup     cve-backup
%define history    cve-history
%define download   cve-download
%define import     cve-import
%define fixes      cve-fixes
%define map        cpe-map
%define issues     cve-issues
%define monitor    cve-monitor
%define mail       cve-mail
%define libcommon  libcve-manager
%define common     %{name}-common
%define python3_sp /usr/lib/python3/site-packages
%define common_sp  %{python3_sp}/cve_manager
%define map_sp     %{python3_sp}/cpe_map
%define choice_sp  %{python3_sp}/cpe_map_choice
%define issues_sp  %{python3_sp}/cve_issues
%define monitor_sp %{python3_sp}/cve_monitor
%define knowledge  %{name}-inner-knowledge

%define lcontrolpp_ver 0.24.1
%define ltree_ver      0.4
%define ax_ver         0.11

Name: cve-manager
Version: 0.40.0
Release: alt1

Summary: CVE-management toolkit
License: GPLv3
Group: Other
Url: https://www.altlinux.org/CVE-Manager

Packager: Alexey Appolonov <alexey at altlinux.org>

# http://git.altlinux.org/people/alexey/packages/?p=cve-manager.git

Source: %{name}-%{version}.tar

# For cve-import

BuildRequires: gcc-c++
BuildRequires: libstdc++8-devel-static
BuildRequires: libcontrol++-devel >= %{lcontrolpp_ver}
BuildRequires: libtree-devel >= %{ltree_ver}
BuildRequires: libmysqlcppconn-devel
BuildRequires: libcurl-devel

# For py-modules

Requires: python3
Requires: python3-module-ax >= %{ax_ver}
Requires: python3-module-mysql
Requires: python3-module-Levenshtein
Requires(pre): %{common}
Requires: %{libcommon}
Requires: %{backup}
Requires: %{history}
Requires: %{download}
Requires: %{import}
Requires: %{fixes}
Requires: %{map}
Requires: %{issues}
Requires: %{monitor}

ExclusiveArch: x86_64

%description
%{name} is a command line utilities toolkit
used to import various CVE lists (in CSV or XML formats)
into MySQL DB, getting access to and analyse formed CVE DB.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


%package -n %{backup}
Summary: CVE DB backupper/restorer
Group: Other

Requires: %{common}

%description -n %{backup}
%{backup} is a command line utility 'used to backup/restore CVE DB.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


%package -n %{history}
Summary: Tracker of CVE-dynamics
Group: Other

Requires: %{common}

%description -n %{history}
%{history} is a command line utility used to save current unfixed issues
and compare them with the previously saved ones.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


%package -n %{download}
Summary: CVE-lists and CPE dictionary downloader
Group: Other

Requires: %{common}

%description -n %{download}
%{download} is a command line utility used to download CVE-lists
and CPE dictionary via https.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


%package -n %{import}
Summary: Data parser and MySQL DB importer
Group: Other

Requires: %{common}
Requires: %{libcommon}

%description -n %{import}
%{import} is a command line utility that can import
various CVE lists (in CSV or XML formats) into MySQL DB.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


%package -n %{fixes}
Summary: CVE-fixes entries handler
Group: Other

Requires: %{common}

%description -n %{fixes}
%{fixes} is a command line utility used to retrieve CVE-fixes entries
from changelogs of all the packages and push them into the CVE DB.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


%package -n %{map}
Summary: CPE list to software packages list mapper
Group: Other

Requires: %{common}
Requires: %{knowledge}

%description -n %{map}
%{map} is a command line utility that can map
CPE list to software packages list.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


%package -n %{issues}
Summary: CVE-issues detector
Group: Other

Requires: %{common}
Requires: %{knowledge}

%description -n %{issues}
%{issues} is a command line utility used to detect CVE-issues.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


%package -n %{monitor}
Summary: CVE database monitor
Group: Other

Requires: %{common}

%description -n %{monitor}
%{monitor} is a command line utility used to query CVE database.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


%package -n %{libcommon}
Summary: C++ lib with common functionality
Group: Other

Requires: libtree >= %{ltree_ver}

%description -n %{libcommon}
C++ library with common functionality such as DB connection and parsing
of the main configuration file.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


%package -n %{common}
Summary: Common files of the CVE manager
Group: Other

%description -n %{common}
Common files of the CVE manager such as config file
and common py-module.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


%prep
%setup

%build
%make_build -C libcve-manager/
%make_build -C cve-import/

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


%install

# Preparing dirs

mkdir -p \
%{buildroot}%{_bindir} \
%{buildroot}%{_libdir} \
%{buildroot}%{_defaultdocdir}/%{name} \
%{buildroot}%{_sysconfdir}/%{name} \
%{buildroot}%{map_sp} \
%{buildroot}%{choice_sp} \
%{buildroot}%{issues_sp} \
%{buildroot}%{monitor_sp} \
%{buildroot}%{common_sp}

# Installing executables

install -m0750 \
%{import}/bin/%{import} \
%{name} \
%{backup} \
%{history} \
%{download} \
%{fixes} \
%{map}* \
%{issues} \
%{buildroot}%{_bindir}
install -m0755 \
%{monitor} \
gb-x-parse-vulns-from-changelog \
%{buildroot}%{_bindir}
install -m0750 cpe_map/*        %{buildroot}%{map_sp}
install -m0750 cpe_map_choice/* %{buildroot}%{choice_sp}
install -m0750 cve_issues/*     %{buildroot}%{issues_sp}
install -m0755 cve_monitor/*    %{buildroot}%{monitor_sp}
install -m0755 cve_manager/*    %{buildroot}%{common_sp}
install -m0755 %{libcommon}/bin/%{libcommon}.so %{buildroot}%{_libdir}

# Installing configs (user should be in the 'cve' group to use cve-manager)

cp -r samples/* %{buildroot}%{_sysconfdir}/%{name}
chmod 660 %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
chmod 660 %{buildroot}%{_sysconfdir}/%{name}/%{mail}.conf
chmod 664 %{buildroot}%{_sysconfdir}/%{name}/%{monitor}.conf

# Installing documentation

cp COPYING readme.txt %{buildroot}%{_defaultdocdir}/%{name}/

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

# Conf file and modules that modify CVEDB belong to the grp of cve-manager usrs

%post -n %{common}
# Creating group for cve-manager users if it doesn't exists
if ! grep -q %{cve_group} /etc/group; then
groupadd %{cve_group}
fi
chgrp cve %{_sysconfdir}/%{name}/%{name}.conf

%post
chgrp cve %{_bindir}/%{name}

%post -n %{backup}
chgrp cve %{_bindir}/%{backup}

%post -n %{history}
chgrp cve %{_bindir}/%{history}

%post -n %{download}
chgrp cve %{_bindir}/%{download}

%post -n %{import}
chgrp cve %{_bindir}/%{import}

%post -n %{fixes}
chgrp cve %{_bindir}/%{fixes}

%post -n %{map}
chgrp cve \
%{_bindir}/%{map}* \
%{map_sp}/* \
%{choice_sp}/*

%post -n %{issues}
chgrp cve \
%{_bindir}/%{issues} \
%{issues_sp}/*

%post -n %{monitor}
chgrp cve \
%{_sysconfdir}/%{name}/%{monitor}.conf \
%{_sysconfdir}/%{name}/%{mail}.conf

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


%files
%{_bindir}/%{name}

%files -n %{download}
%{_bindir}/%{download}

%files -n %{backup}
%{_bindir}/%{backup}

%files -n %{history}
%{_bindir}/%{history}

%files -n %{import}
%{_bindir}/%{import}

%files -n %{fixes}
%{_bindir}/%{fixes}
%{_bindir}/gb-x-parse-vulns-from-changelog

%files -n %{map}
%{_bindir}/%{map}*
%{map_sp}
%{choice_sp}

%files -n %{issues}
%{_bindir}/%{issues}
%{issues_sp}

%files -n %{monitor}
%{_bindir}/%{monitor}
%{monitor_sp}
%config(noreplace) %{_sysconfdir}/%{name}/%{monitor}.conf
%config(noreplace) %{_sysconfdir}/%{name}/%{mail}.conf

%files -n %{libcommon}
%{_libdir}/%{libcommon}.so

%files -n %{common}
%{common_sp}
%{_defaultdocdir}/%{name}
%dir %{_sysconfdir}/%{name}/
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin