%define nginx_user nginx %define nginx_group nginx %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 upload dynamic module Name: nginx-mod-upload 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-module-upload.copyright Source100: upload-1.24.0.tar.gz License: 2-clause BSD-like license BuildRequires: gcc BuildRequires: openssl-devel BuildRequires: pcre2-devel BuildRequires: zlib-devel Requires: nginx >= %{version} %description nginx upload dynamic module. %define WITH_CC_OPT $(echo %{optflags} $(pcre2-config --cflags)) %define WITH_LD_OPT -Wl,-z,relro -Wl,-z,now %define BASE_CONFIGURE_ARGS $(echo "--prefix=%{_sysconfdir}/nginx --sbin-path=%{_sbindir}/nginx --modules-path=%{_libdir}/nginx/modules --conf-path=%{_sysconfdir}/nginx/nginx.conf --error-log-path=%{_localstatedir}/log/nginx/error.log --http-log-path=%{_localstatedir}/log/nginx/access.log --pid-path=%{_localstatedir}/run/nginx.pid --lock-path=%{_localstatedir}/run/nginx.lock --http-client-body-temp-path=%{_localstatedir}/cache/nginx/client_temp --http-proxy-temp-path=%{_localstatedir}/cache/nginx/proxy_temp --http-fastcgi-temp-path=%{_localstatedir}/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=%{_localstatedir}/cache/nginx/uwsgi_temp --http-scgi-temp-path=%{_localstatedir}/cache/nginx/scgi_temp --user=%{nginx_user} --group=%{nginx_group} --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_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 --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module") %define MODULE_CONFIGURE_ARGS $(echo "--add-dynamic-module=upload-1.24.0") %prep %setup -qcTn %{name}-%{version} tar --strip-components=1 -zxf %{SOURCE0} tar xvzfo %{SOURCE100} ln -s upload-* upload %build ./configure %{BASE_CONFIGURE_ARGS} %{MODULE_CONFIGURE_ARGS} \ --with-cc-opt="%{WITH_CC_OPT} " \ --with-ld-opt="%{WITH_LD_OPT} " \ --with-debug make %{?_smp_mflags} modules for so in `find objs/ -type f -name "*.so"`; do debugso=`echo $so | sed -e 's|\.so$|-debug.so|'` mv $so $debugso done ./configure %{BASE_CONFIGURE_ARGS} %{MODULE_CONFIGURE_ARGS} \ --with-cc-opt="%{WITH_CC_OPT} " \ --with-ld-opt="%{WITH_LD_OPT} " make %{?_smp_mflags} modules %install %{__rm} -rf %{buildroot} %{__mkdir} -p %{buildroot}%{_datadir}/doc/nginx-module-upload %{__install} -m 644 -p %{SOURCE1} \ %{buildroot}%{_datadir}/doc/nginx-module-upload/COPYRIGHT %{__mkdir} -p %{buildroot}%{_libdir}/nginx/modules for so in `find objs/ -maxdepth 1 -type f -name "*.so"`; do %{__install} -m755 $so \ %{buildroot}%{_libdir}/nginx/modules/ done %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 %post if [ $1 -eq 1 ]; then cat < - 1.24.0-1%{?dist} - Rename to nginx-mod-upload * Tue Nov 19 2024 Build Script - 1.24.0+1.0-1%{?dist}.ngx - initial release of upload module for nginx