%global _hardened_build 1 %global nginx_user nginx %global nginx_group nginx %global nginx_modulename upload %global nginx_moduledir %{_libdir}/nginx/modules %global nginx_moduleconfdir %{_datadir}/nginx/modules %define __arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot %if 0%{?fedora} || 0%{?rhel} > 7 %define _debugsource_template %{nil} %endif Summary: nginx %{nginx_modulename} dynamic module Name: nginx-mod-http-%{nginx_modulename} Version: 1.24.0 Release: 1%{?dist} Vendor: NGINX Packaging URL: https://www.nginx.com/blog/compiling-dynamic-modules-nginx-plus/ Group: System Environment/Daemons Source0: https://nginx.org/download/nginx-%{version}.tar.gz Source1: %{nginx_modulename}-%{version}.tar.gz License: 2-clause BSD-like license BuildRequires: gcc BuildRequires: openssl-devel BuildRequires: pcre2-devel BuildRequires: zlib-devel Requires: nginx >= %{version} %description nginx %{nginx_modulename} dynamic module. %define BASE_CONFIGURE_ARGS $(echo "--prefix=%{_datadir}/nginx --sbin-path=%{_sbindir}/nginx --modules-path=%{nginx_moduledir} --conf-path=%{_sysconfdir}/nginx/nginx.conf --error-log-path=%{_localstatedir}/log/nginx/error.log --http-log-path=%{_localstatedir}/log/nginx/access.log --http-client-body-temp-path=%{_localstatedir}/lib/nginx/tmp/client_body --http-proxy-temp-path=%{_localstatedir}/lib/nginx/tmp/proxy --http-fastcgi-temp-path=%{_localstatedir}/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=%{_localstatedir}/lib/nginx/tmp/uwsgi --http-scgi-temp-path=%{_localstatedir}/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=%{nginx_user} --group=%{nginx_user} --with-compat --with-debug --with-file-aio --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_degradation_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail_ssl_module --with-openssl-opt=enable-ktls --with-pcre --with-pcre-jit --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-threads") %define MODULE_CONFIGURE_ARGS $(echo "--add-dynamic-module=%{nginx_modulename}-%{version}") %prep %setup -qcTn %{name}-%{version} tar --strip-components=1 -zxf %{SOURCE0} tar xvzfo %{SOURCE1} ln -s %{nginx_modulename}-* %{nginx_modulename} %build # nginx does not utilize a standard configure script. It has its own # and the standard configure options cause the nginx configure script # to error out. This is is also the reason for the DESTDIR environment # variable. export DESTDIR=%{buildroot} # So the perl module finds its symbols: nginx_ldopts="$RPM_LD_FLAGS -Wl,-E" ./configure %{BASE_CONFIGURE_ARGS} %{MODULE_CONFIGURE_ARGS} \ --with-cc-opt="%{optflags} $(pcre2-config --cflags)" \ --with-ld-opt="$nginx_ldopts" make %{?_smp_mflags} modules %install %{__mkdir} -p %{buildroot}%{nginx_moduledir} for module in `find objs/ -maxdepth 1 -type f -name "*module.so"`; do %{__install} -m755 ${module} \ %{buildroot}%{nginx_moduledir}/ done %{__mkdir} -p %{buildroot}%{nginx_moduleconfdir} echo 'load_module "%{nginx_moduledir}/ngx_http_'%{nginx_modulename}'_module.so";' \ > %{buildroot}%{nginx_moduleconfdir}/mod-http-%{nginx_modulename}.conf %check %{__rm} -rf %{buildroot}/usr/src grep -v 'usr/src' debugfiles.list > debugfiles.list.new && mv debugfiles.list.new debugfiles.list cat /dev/null > debugsources.list %files %defattr(-,root,root) %{nginx_moduleconfdir}/mod-http-%{nginx_modulename}.conf %{nginx_moduledir}/ngx_http_%{nginx_modulename}_module.so %changelog * Wed Dec 18 2024 Jean-Marc Liger - 1.24.0-1%{?dist} - Rename to nginx-mod-http-upload for COPR LE9 * Tue Nov 19 2024 Build Script - 1.24.0+1.0-1%{?dist}.ngx - initial release of upload module for nginx