diff --git a/dionaea.spec b/dionaea.spec index 655faa7..4bb8eb7 100644 --- a/dionaea.spec +++ b/dionaea.spec @@ -1,9 +1,13 @@ Name: dionaea Version: 0.7.0 Summary: Low interaction honeypot - # Show as the RPM release number (keep same number line for tarball and git builds) -%global rel 5 +%global baserelease 6 + +%if 0%{?rhel} +# Group needed for EPEL +Group: Applications/System +%endif # Dionaea package is licensed with GPLv2 # On top of that it is granting one exception extra - it is permitted by the license @@ -36,25 +40,25 @@ URL: https://dionaea.readthedocs.io/ # Use systemd unit files on Fedora and RHEL 7 and above. -%global _with_systemd 1 - +%bcond_without systemd %if (0%{?rhel} && 0%{?rhel} < 7) - %global _with_systemd 0 +%bcond_with systemd %endif -# Build source is github release=1 or git commit=0 -%global build_release 1 +# By default build from official release +# leave option here to build from git snapshot instead +%bcond_with snapshot -%if 0%{?build_release} > 0 -Release: %{rel}%{?dist}.3 -Source0: https://github.com/%{gituser}/%{gitname}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz -%else -# not using 0. on the beginning of release as this git snapshot is past the 0.6.0 release -Release: %{rel}.%{gitdate}git%{shortcommit}%{?dist}.5 +%if 0%{?with_snapshot} +# not using 0. on the beginning of release as this git snapshot is past the 0.7.0 release +Release: %{baserelease}.%{gitdate}git%{shortcommit}%{?dist} Source0: https://github.com/%{gituser}/%{gitname}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz -%endif #build_release +%else +Release: %{baserelease}%{?dist} +Source0: https://github.com/%{gituser}/%{gitname}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +%endif Source1: %{name}.sysconfig Source2: %{name}.initd @@ -145,7 +149,7 @@ BuildRequires: openssl-devel BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-Cython -%if 0%{?_with_systemd} +%if 0%{?with_systemd} BuildRequires: systemd-units %endif @@ -171,7 +175,7 @@ Requires: logrotate # Base package can't run without the python module Requires: python%{python3_pkgversion}-dionaea -%if 0%{?_with_systemd} +%if 0%{?with_systemd} %{?systemd_requires} %else Requires(post): chkconfig @@ -222,13 +226,12 @@ This is a Python3 library that gives access to dionaea honeypot functionality. # ============= preparation ==================================================== %prep -%if 0%{?build_release} > 0 +%if 0%{?with_snapshot} +# Build from git snapshot +%autosetup -p 1 -n %{gitname}-%{commit} -N +%else # Build from git release version %autosetup -p 1 -n %{gitname}-%{version} -N - -%else -# Build from git commit -%autosetup -p 1 -n %{gitname}-%{commit} -N %endif # Re-initialize the git repo, to track changes even on files ignored by the upstream @@ -369,7 +372,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/sysconfig install -p -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/%{name} # install the service init files -%if 0%{?_with_systemd} +%if 0%{?with_systemd} # install systemd service files mkdir -p %{buildroot}%{_unitdir} install -p -D -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service @@ -403,14 +406,14 @@ touch %{buildroot}%{_sharedstatedir}/%{name}/sipaccounts.sqlite # ============= Scriptlets ========================================================== %post -%if 0%{?_with_systemd} +%if 0%{?with_systemd} %systemd_post %{name}.service %else /sbin/chkconfig --add %{name} %endif %preun -%if 0%{?_with_systemd} +%if 0%{?with_systemd} %systemd_preun %{name}.service %else if [ $1 -eq 0 ] ; then @@ -420,7 +423,7 @@ touch %{buildroot}%{_sharedstatedir}/%{name}/sipaccounts.sqlite %endif %postun -%if 0%{?_with_systemd} +%if 0%{?with_systemd} %systemd_postun %{name}.service %else if [ $1 -eq 1 ] ; then @@ -458,14 +461,14 @@ getent passwd dionaea >/dev/null || \ %attr(0750,dionaea,dionaea) %dir %{_sharedstatedir}/%{name}/bistreams %attr(-,dionaea,dionaea) %{_sharedstatedir}/%{name}/roots/ %attr(-,dionaea,dionaea) %{_sharedstatedir}/%{name}/share/ -%attr(-,dionaea,dionaea) %{_sharedstatedir}/%{name}/dionaea.sqlite -%attr(-,dionaea,dionaea) %{_sharedstatedir}/%{name}/dionaea_incident.sqlite -%attr(-,dionaea,dionaea) %{_sharedstatedir}/%{name}/sipaccounts.sqlite +%attr(-,dionaea,dionaea) %{_sharedstatedir}/%{name}/dionaea.sqlite +%attr(-,dionaea,dionaea) %{_sharedstatedir}/%{name}/dionaea_incident.sqlite +%attr(-,dionaea,dionaea) %{_sharedstatedir}/%{name}/sipaccounts.sqlite -%if 0%{?_with_systemd} +%if 0%{?with_systemd} %{_unitdir}/*.service %else %{_initrddir}/* @@ -489,6 +492,9 @@ getent passwd dionaea >/dev/null || \ %changelog +* Thu Oct 24 2019 Michal Ambroz 0.7.0-6 +- rebuilt rawhide after ressurection of libdasm/libemu + * Mon Aug 19 2019 Miro HronĨok - 0.7.0-5.3 - Rebuilt for Python 3.8