1# distribution specific definitions 2%define bdir %{_builddir}/%{name}-%{version} 3 4%%MODULE_DEFINITIONS%% 5 6%if (0%{?rhel} == 7 && 0%{?amzn} == 0) 7%define dist .el7 8%endif 9 10%define unit_version %%UNIT_VERSION%% 11%define unit_release %%UNIT_RELEASE%%%{?dist}.ngx 12 13%define CC_OPT %{optflags} 14 15%define CONFIGURE_ARGS $(echo "%%CONFIGURE_ARGS%%") 16 17Name: %%NAME%% 18Summary: %%SUMMARY%% 19Version: %%VERSION%% 20Release: %%RELEASE%%%{?dist}.ngx 21License: ASL 2.0 22Vendor: Nginx Software, Inc. 23URL: https://unit.nginx.org/ 24Packager: Nginx Software, Inc. <https://www.nginx.com> 25Group: System Environment/Daemons 26 27Source0: unit-%{version}.tar.gz 28%%MODULE_SOURCES%% 29 30BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) 31 32Requires: unit == %%UNIT_VERSION%%-%%UNIT_RELEASE%%%{?dist}.ngx 33 34%description 35NGINX Unit is a runtime and delivery environment for modern distributed 36applications. It runs the application code in multiple languages 37(PHP, Python, Go, etc.), and tightly couples it with traffic delivery 38in and out of the application. Take this application server and proxy 39directly in the cloud / container environments and fully control your app 40dynamically via an API. 41This package contains %%SUMMARY%%. 42 43%if 0%{?suse_version} 44%debug_package 45%endif 46 47%prep 48%setup -qcTn %{name}-%{unit_version} 49tar --strip-components=1 -zxf %{SOURCE0} 50 51%build 52./configure \ 53 %{CONFIGURE_ARGS} \ 54 --modules=%{_libdir}/unit/debug-modules \ 55 --cc-opt="%{CC_OPT}" \ 56 --debug 57./configure %%MODULE_CONFARGS%% 58make %%MODULE_MAKEARGS%% 59%{__mv} build build-debug 60./configure \ 61 %{CONFIGURE_ARGS} \ 62 --modules=%{_libdir}/unit/modules \ 63 --cc-opt="%{CC_OPT}" 64./configure %%MODULE_CONFARGS%% 65make %%MODULE_MAKEARGS%% 66 67%install 68%{__rm} -rf %{buildroot} 69%{__mkdir} -p %{buildroot}%{_datadir}/doc/%%NAME%% 70%{__install} -m 644 -p NOTICE \ 71 %{buildroot}%{_datadir}/doc/%%NAME%%/COPYRIGHT 72%%MODULE_PREINSTALL%% 73DESTDIR=%{buildroot} make %%MODULE_INSTARGS%% 74%{__rm} -rf build 75%{__mv} build-debug build 76DESTDIR=%{buildroot} make %%MODULE_INSTARGS%% 77 78%check 79 80%clean 81%{__rm} -rf %{buildroot} 82 83%post 84if [ $1 -eq 1 ]; then 85%%MODULE_POST%% 86fi 87 88%files 89%defattr(-,root,root,-) 90%dir %{_datadir}/doc/%%NAME%% 91%{_datadir}/doc/%%NAME%%/* 92%%MODULE_FILES%% 93 94%changelog 95