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