File intelmq-manager.spec of Package intelmq-manager
#
# spec file for package intelmq-manager
#
# Copyright (c) 2020 Sebastian Wagner <wagner@cert.at>
#
# 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/
#
Name: intelmq-manager
Version: 3.3.0
Release: 0
Summary: A graphical interface to manage configurations for IntelMQ
License: AGPL-3.0
Group: Development/Languages/Other
Url: https://intelmq.org/
Source0: intelmq-manager_%{version}.orig.tar.gz
#Source1: intelmq-manager_%%{version}-2.debian.tar.gz
BuildRequires: systemd
BuildRequires: fdupes
BuildRequires: python3-setuptools
BuildRequires: python3-mako
BuildRequires: python3
%if 0%{?suse_version}
BuildRequires: apache2
BuildRequires: apache-rpm-macros
Requires: apache2
Requires: apache2-utils
%define httpd_name apache2
%define httpd_conf_dir vhosts.d
%else
BuildRequires: httpd
Requires: httpd
Requires: httpd-tools
Requires(pre): shadow-utils
%define apache_user apache
%define httpd_name httpd
%define httpd_conf_dir conf.d
%endif
%{?systemd_requires}
Requires: systemd
Requires: intelmq-api >= 2.2.0
BuildArch: noarch
%description
A graphical interface to manage configurations for the IntelMQ framework. A IntelMQ configuration is a set of config files which describe which bots and processing steps should be run in which order. It is similar to describing the dataflow in dataflow oriented languages. IntelMQ Manager is therefore an intuitive tool to allow non-programmers to specify the data flow in IntelMQ.
%prep
%setup -q -n intelmq-manager
#%%setup -q -D -T -b 1 -n intelmq-manager
sed -i 's/intelmq_manager/intelmq-manager/g' contrib/manager-apache.conf
%build
%python_build
PYTHONPATH=. python3 ./intelmq_manager/build.py --output-dir html/
%install
install -d %{buildroot}%{_datadir}/%{name}/
cp -r html/ %{buildroot}%{_datadir}/%{name}/
install -d %{buildroot}%{_sysconfdir}/%httpd_name/%httpd_conf_dir/
install -D -m 644 contrib/manager-apache.conf %{buildroot}%{_sysconfdir}/%httpd_name/%httpd_conf_dir/
%fdupes %{buildroot}
%post
if [ "$1" == 1 ]; then
echo 'To create user-accounts for the webinterface run `INTELMQ_API_CONFIG=/etc/intelmq/api-config.json intelmq-api-adduser --user "$ACCOUNT"`' > /dev/stderr
fi
%if 0%{?suse_version}
a2enmod -q headers || a2enmod headers
%restart_on_update apache2.service
%else
%if 0%{?centos_version}
systemctl reload httpd.service
%else
systemctl reload apache-httpd.service
%endif
%endif
%check
%files
%defattr(-,root,root,-)
%if 0%{?suse_version}
%dir %{_sysconfdir}/%httpd_name/
%dir %{_sysconfdir}/%httpd_name/%httpd_conf_dir/
%endif
%{_datadir}/%{name}/
%config(noreplace) %{_sysconfdir}/%httpd_name/%httpd_conf_dir/manager-apache.conf
%doc CONTRIBUTORS.md README.md CHANGELOG.md NEWS.md
%license LICENSES/*
%changelog