Last active
December 29, 2021 10:08
-
-
Save zypA13510/2d72a3e918e262ff4a885295560cfe32 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%global origname traffic-accounting-nginx-module | |
%global commitref d53a4a6 | |
Name: nginx-mod-traffic-accounting | |
Version: 2.0 | |
Release: 2.git.106.d53a4a6%{?dist} | |
Summary: nginx traffic accounting module | |
License: BSD | |
URL: https://github.com/Lax/traffic-accounting-nginx-module | |
Source0: %{url}/archive/%{commitref}/%{origname}-%{version}.tar.gz | |
Requires: nginx-mod-http-accounting | |
#Requires: nginx-mod-stream-accounting | |
BuildRequires: gcc | |
BuildRequires: nginx-mod-devel | |
%description | |
Monitor the incoming and outgoing traffic metrics in realtime for NGINX. | |
%package -n nginx-mod-http-accounting | |
Summary: Nginx HTTP accounting module | |
%description -n nginx-mod-http-accounting | |
%{summary}. | |
#%package -n nginx-mod-stream-accounting | |
#Summary: Nginx stream accounting module | |
#Requires: nginx-mod-stream | |
# | |
#%description -n nginx-mod-stream-accounting | |
#%{summary}. | |
%prep | |
%autosetup -n %{origname}-%{version} | |
%build | |
%nginx_modconfigure | |
#%nginx_modconfigure --with-stream | |
%nginx_modbuild | |
%install | |
pushd %{_vpath_builddir} | |
install -dm 0755 %{buildroot}%{nginx_moddir} | |
install -pm 0755 ngx_http_accounting_module.so %{buildroot}%{nginx_moddir} | |
#install -pm 0755 ngx_stream_accounting_module.so %{buildroot}%{nginx_moddir} | |
install -dm 0755 %{buildroot}%{nginx_modconfdir} | |
echo 'load_module "%{nginx_moddir}/ngx_http_accounting_module.so";' \ | |
> %{buildroot}%{nginx_modconfdir}/mod-http-accounting.conf | |
#echo 'load_module "%{nginx_moddir}/ngx_stream_accounting_module.so";' \ | |
# > %{buildroot}%{nginx_modconfdir}/mod-stream-accounting.conf | |
popd | |
%files | |
%license LICENSE | |
%doc README.md | |
%files -n nginx-mod-http-accounting | |
%license LICENSE | |
%{nginx_moddir}/ngx_http_accounting_module.so | |
%{nginx_modconfdir}/mod-http-accounting.conf | |
#%files -n nginx-mod-stream-accounting | |
#%license LICENSE | |
#%{nginx_moddir}/ngx_stream_accounting_module.so | |
#%{nginx_modconfdir}/mod-stream-accounting.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works on copr, albeit with some limitations:
mod-devel
package or not).$STREAM
to 'YES' or 'DYNAMIC' in the build environment (the base package was built with--with-stream=dynamic
but somehow not working12 when building modules). The related sections are kept in the spec file as comment.