xref: /unit/pkg/rpm/unit.module.spec.in (revision 500:abdf51afae81)
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%{__mv} build build-nodebug
67
68%install
69%{__rm} -rf %{buildroot}
70%{__mkdir} -p %{buildroot}%{_datadir}/doc/%%NAME%%
71%{__install} -m 644 -p NOTICE \
72    %{buildroot}%{_datadir}/doc/%%NAME%%/COPYRIGHT
73%%MODULE_PREINSTALL%%
74%{__ln_s} build-debug build
75DESTDIR=%{buildroot} make %%MODULE_INSTARGS%%
76%{__rm} -f build
77%{__ln_s} build-nodebug build
78DESTDIR=%{buildroot} make %%MODULE_INSTARGS%%
79
80%check
81
82%clean
83%{__rm} -rf %{buildroot}
84
85%post
86if [ $1 -eq 1 ]; then
87%%MODULE_POST%%
88fi
89
90%files
91%defattr(-,root,root,-)
92%dir %{_datadir}/doc/%%NAME%%
93%{_datadir}/doc/%%NAME%%/*
94%%MODULE_FILES%%
95
96%changelog
97