!64 add package mod-devel
From: @sherlock2010 Reviewed-by: @yaqiangchen Signed-off-by: @yaqiangchen
This commit is contained in:
commit
52f0085263
20
macros.nginxmods.in
Normal file
20
macros.nginxmods.in
Normal file
@ -0,0 +1,20 @@
|
||||
%_nginx_abiversion @@NGINX_ABIVERSION@@
|
||||
%_nginx_srcdir @@NGINX_SRCDIR@@
|
||||
%_nginx_buildsrcdir nginx-src
|
||||
%_nginx_modsrcdir ..
|
||||
%_nginx_modbuilddir ../%{_vpath_builddir}
|
||||
%nginx_moddir @@NGINX_MODDIR@@
|
||||
%nginx_modconfdir @@NGINX_MODCONFDIR@@
|
||||
|
||||
%nginx_modrequires Requires: nginx(abi) = %{_nginx_abiversion}
|
||||
|
||||
%nginx_modconfigure(:-:) \\\
|
||||
%undefine _strict_symbol_defs_build \
|
||||
cp -a "%{_nginx_srcdir}" "%{_nginx_buildsrcdir}" \
|
||||
cd "%{_nginx_buildsrcdir}" \
|
||||
nginx_ldopts="$RPM_LD_FLAGS -Wl,-E" \
|
||||
./configure --with-compat --with-cc-opt="%{optflags} $(pcre-config --cflags)" --with-ld-opt="$nginx_ldopts" \\\
|
||||
--add-dynamic-module=$(realpath %{_nginx_modsrcdir}) --builddir=$(realpath %{_nginx_modbuilddir}) %{**} \
|
||||
cd -
|
||||
|
||||
%nginx_modbuild %{__make} -C "%{_nginx_buildsrcdir}" %{_make_output_sync} %{?_smp_mflags} %{_make_verbose} modules
|
||||
57
nginx.spec
57
nginx.spec
@ -11,10 +11,13 @@
|
||||
|
||||
%global with_aio 1
|
||||
|
||||
%global __provides_exclude_from ^%{_usrsrc}/%{name}-%{version}-%{release}/.*$
|
||||
%global __requires_exclude_from ^%{_usrsrc}/%{name}-%{version}-%{release}/.*$
|
||||
|
||||
Name: nginx
|
||||
Epoch: 1
|
||||
Version: 1.23.2
|
||||
Release: 1
|
||||
Release: 2
|
||||
Summary: A HTTP server, reverse proxy and mail proxy server
|
||||
License: BSD
|
||||
URL: http://nginx.org/
|
||||
@ -24,6 +27,8 @@ Source10: nginx.service
|
||||
Source11: nginx.logrotate
|
||||
Source12: nginx.conf
|
||||
Source13: nginx-upgrade
|
||||
Source14: macros.nginxmods.in
|
||||
Source15: nginxmods.attr
|
||||
Source100: index.html
|
||||
Source102: nginx-logo.png
|
||||
Source103: 404.html
|
||||
@ -45,6 +50,7 @@ Requires(post): systemd
|
||||
Requires(preun): systemd
|
||||
Requires(postun): systemd
|
||||
Provides: webserver
|
||||
Provides: nginx(abi) = %{version}
|
||||
Recommends: logrotate
|
||||
|
||||
%description
|
||||
@ -83,7 +89,7 @@ The package contains the basic directory layout for the Nginx server.
|
||||
%package mod-http-geoip
|
||||
Summary: HTTP geoip module for nginx
|
||||
BuildRequires: GeoIP-devel
|
||||
Requires: nginx GeoIP
|
||||
Requires: nginx(abi) = %{version} GeoIP
|
||||
|
||||
%description mod-http-geoip
|
||||
The package is the Nginx HTTP geoip module.
|
||||
@ -92,7 +98,7 @@ The package is the Nginx HTTP geoip module.
|
||||
%package mod-http-image-filter
|
||||
Summary: HTTP image filter module for nginx
|
||||
BuildRequires: gd-devel
|
||||
Requires: nginx gd
|
||||
Requires: nginx(abi) = %{version} gd
|
||||
|
||||
%description mod-http-image-filter
|
||||
Nginx HTTP image filter module.
|
||||
@ -100,7 +106,7 @@ Nginx HTTP image filter module.
|
||||
%package mod-http-perl
|
||||
Summary: HTTP perl module for nginx
|
||||
BuildRequires: perl-devel perl(ExtUtils::Embed)
|
||||
Requires: nginx perl(constant)
|
||||
Requires: nginx(abi) = %{version} perl(constant)
|
||||
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
|
||||
|
||||
%description mod-http-perl
|
||||
@ -109,30 +115,47 @@ Nginx HTTP perl module.
|
||||
%package mod-http-xslt-filter
|
||||
Summary: XSLT module for nginx
|
||||
BuildRequires: libxslt-devel
|
||||
Requires: nginx
|
||||
Requires: nginx(abi) = %{version}
|
||||
|
||||
%description mod-http-xslt-filter
|
||||
Nginx XSLT module.
|
||||
|
||||
%package mod-mail
|
||||
Summary: mail modules for nginx
|
||||
Requires: nginx
|
||||
Requires: nginx(abi) = %{version}
|
||||
|
||||
%description mod-mail
|
||||
Nginx mail modules
|
||||
|
||||
%package mod-stream
|
||||
Summary: stream modules for nginx
|
||||
Requires: nginx
|
||||
Requires: nginx(abi) = %{version}
|
||||
|
||||
%description mod-stream
|
||||
Nginx stream modules.
|
||||
|
||||
%package mod-devel
|
||||
Summary: nginx module development
|
||||
Requires: nginx = %{epoch}:%{version}-%{release}
|
||||
Requires: make gcc gd-devel libxslt-devel openssl-devel
|
||||
Requires: pcre2-devel perl-devel perl(ExtUtils::Embed) zlib-devel
|
||||
%if 0%{?with_gperftools}
|
||||
Requires: gperftools-devel
|
||||
%endif
|
||||
%if %{with geoip}
|
||||
Requires: GeoIP-devel
|
||||
%endif
|
||||
|
||||
%description mod-devel
|
||||
Nginx module development
|
||||
|
||||
%package_help
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version} -p1
|
||||
cp %{SOURCE200} %{SOURCE210} %{SOURCE10} %{SOURCE12} .
|
||||
cp -a ../%{name}-%{version} ../%{name}-%{version}-%{release}-src
|
||||
mv ../%{name}-%{version}-%{release}-src .
|
||||
|
||||
%build
|
||||
export DESTDIR=%{buildroot}
|
||||
@ -227,6 +250,17 @@ echo 'load_module "%{_libdir}/nginx/modules/ngx_stream_module.so";' \
|
||||
> .%{_datadir}/nginx/modules/mod-stream.conf
|
||||
popd
|
||||
|
||||
mkdir -p %{buildroot}%{_usrsrc}
|
||||
mv %{name}-%{version}-%{release}-src %{buildroot}%{_usrsrc}/%{name}-%{version}-%{release}
|
||||
|
||||
mkdir -p %{buildroot}%{_rpmmacrodir}
|
||||
sed -e "s|@@NGINX_ABIVERSION@@|%{version}|g" \
|
||||
-e "s|@@NGINX_MODDIR@@|%{_libdir}\/nginx\/modules|g" \
|
||||
-e "s|@@NGINX_MODCONFDIR@@|%{_datadir}\/nginx\/modules|g" \
|
||||
-e "s|@@NGINX_SRCDIR@@|%{_usrsrc}\/%{name}-%{version}-%{release}|g" \
|
||||
%{SOURCE14} > %{buildroot}%{_rpmmacrodir}/macros.nginxmods
|
||||
install -Dpm0644 %{SOURCE15} %{buildroot}%{_fileattrsdir}/nginxmods.attr
|
||||
|
||||
%pre filesystem
|
||||
getent group %{nginx_user} > /dev/null || groupadd -r %{nginx_user}
|
||||
getent passwd %{nginx_user} > /dev/null || useradd -r -d %{_localstatedir}/lib/nginx -g %{nginx_user} \
|
||||
@ -290,6 +324,7 @@ fi
|
||||
%{_bindir}/nginx-upgrade
|
||||
%{_sbindir}/nginx
|
||||
%dir %{_libdir}/nginx/modules
|
||||
%dir %{_datadir}/nginx/modules
|
||||
%attr(770,%{nginx_user},root) %dir %{_localstatedir}/lib/nginx
|
||||
%attr(770,%{nginx_user},root) %dir %{_localstatedir}/lib/nginx/tmp
|
||||
%{_unitdir}/nginx.service
|
||||
@ -338,6 +373,11 @@ fi
|
||||
%{_libdir}/nginx/modules/ngx_stream_module.so
|
||||
%{_datadir}/nginx/modules/mod-stream.conf
|
||||
|
||||
%files mod-devel
|
||||
%{_rpmmacrodir}/macros.nginxmods
|
||||
%{_fileattrsdir}/nginxmods.attr
|
||||
%{_usrsrc}/%{name}-%{version}-%{release}
|
||||
|
||||
%files help
|
||||
%defattr(-,root,root)
|
||||
%doc CHANGES README README.dynamic
|
||||
@ -345,6 +385,9 @@ fi
|
||||
%{_mandir}/man8/nginx.8*
|
||||
|
||||
%changelog
|
||||
* Thu Nov 24 2022 zhouyihang <zhouyihang3@h-partners.com> - 1:1.23.2-2
|
||||
- add package mod-devel
|
||||
|
||||
* Mon Nov 14 2022 gaihuiying <eaglegai@163.com> - 1:1.23.2-1
|
||||
- update nginx to 1.23.2
|
||||
|
||||
|
||||
14
nginxmods.attr
Normal file
14
nginxmods.attr
Normal file
@ -0,0 +1,14 @@
|
||||
%__nginxmods_requires() %{lua:
|
||||
-- Match buildroot paths of the form
|
||||
-- /PATH/OF/BUILDROOT/usr/lib/nginx/modules/ and
|
||||
-- /PATH/OF/BUILDROOT/usr/lib64/nginx/modules/
|
||||
-- generating a line of the form:
|
||||
-- nginx(abi) = VERSION
|
||||
local path = rpm.expand("%1")
|
||||
if path:match("/usr/lib%d*/nginx/modules/.*") then
|
||||
local requires = "nginx(abi) = " .. rpm.expand("%{_nginx_abiversion}")
|
||||
print(requires)
|
||||
end
|
||||
}
|
||||
|
||||
%__nginxmods_path ^%{_prefix}/lib(64)?/nginx/modules/.*\\.so$
|
||||
Loading…
x
Reference in New Issue
Block a user