summaryrefslogtreecommitdiffhomepage
path: root/pkg/rpm
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2022-12-07 18:20:44 -0800
committerKonstantin Pavlov <thresh@nginx.com>2022-12-07 18:20:44 -0800
commit24e3f171029da265ee8cc20fe1a8846a0b49cb43 (patch)
treed492c3676d919379a1ddcc6adf70d0d2031dd71c /pkg/rpm
parent11c66941ce9146ca85533e8a3169ef3941340896 (diff)
downloadunit-24e3f171029da265ee8cc20fe1a8846a0b49cb43.tar.gz
unit-24e3f171029da265ee8cc20fe1a8846a0b49cb43.tar.bz2
Packages: added njs support.
Diffstat (limited to 'pkg/rpm')
-rw-r--r--pkg/rpm/Makefile10
-rw-r--r--pkg/rpm/unit.spec.in6
2 files changed, 13 insertions, 3 deletions
diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile
index a1ac2af9..d00a25ac 100644
--- a/pkg/rpm/Makefile
+++ b/pkg/rpm/Makefile
@@ -106,7 +106,7 @@ include Makefile.jsc8
include Makefile.jsc11
endif
-CONFIGURE_ARGS=\
+CONFIGURE_ARGS_COMMON=\
--prefix=/usr \
--state=%{_sharedstatedir}/unit \
--control="unix:/var/run/unit/control.sock" \
@@ -118,6 +118,10 @@ CONFIGURE_ARGS=\
--tests \
--openssl
+CONFIGURE_ARGS=\
+ $(CONFIGURE_ARGS_COMMON) \
+ --njs
+
export CR=\\n
default:
@@ -176,7 +180,7 @@ endif
rpmbuild/SOURCES/unit-$(VERSION).tar.gz:
cd ../.. && tar -czf pkg/rpm/rpmbuild/SOURCES/unit-$(VERSION).tar.gz \
--transform "s#^#unit-$(VERSION)/#" \
- LICENSE NOTICE CHANGES README.md CONTRIBUTING.md configure auto src test version go docs/man/unitd.8.in
+ LICENSE NOTICE CHANGES README.md CONTRIBUTING.md configure auto src test version go pkg/contrib docs/man/unitd.8.in
unit: check-build-depends-unit rpmbuild/SPECS/unit.spec rpmbuild/SOURCES/unit-$(VERSION).tar.gz
@echo "===> Building $@ package" ; \
@@ -212,7 +216,7 @@ rpmbuild/SPECS/unit-%.spec: unit.module.spec.in ../../docs/changes.xml | rpmbuil
-e "s#%%UNIT_RELEASE%%#$(RELEASE)#g" \
-e "s#%%PACKAGE_VENDOR%%#$(PACKAGE_VENDOR)#g" \
-e "s#%%MODULE_SOURCES%%#$${sources}#g" \
- -e "s#%%CONFIGURE_ARGS%%#$(CONFIGURE_ARGS)#g" \
+ -e "s#%%CONFIGURE_ARGS%%#$(CONFIGURE_ARGS_COMMON)#g" \
-e "s#%%MODULE_CONFARGS%%#$(MODULE_CONFARGS_$*)#g" \
-e "s#%%MODULE_MAKEARGS%%#$(MODULE_MAKEARGS_$*)#g" \
-e "s#%%MODULE_INSTARGS%%#$(MODULE_INSTARGS_$*)#g" \
diff --git a/pkg/rpm/unit.spec.in b/pkg/rpm/unit.spec.in
index 50eee876..fddabb69 100644
--- a/pkg/rpm/unit.spec.in
+++ b/pkg/rpm/unit.spec.in
@@ -46,6 +46,7 @@ Requires(preun): systemd
Requires(postun): systemd
BuildRequires: pcre2-devel
+BuildRequires: pkg-config
Provides: unit-r%{version}
@@ -74,6 +75,9 @@ Library and include files required for NGINX Unit modules development.
%setup -q
%build
+%{__make} %{?_smp_mflags} -C pkg/contrib .njs
+
+PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \
./configure \
%{CONFIGURE_ARGS} \
--modules=%{_libdir}/unit/debug-modules \
@@ -84,6 +88,8 @@ Library and include files required for NGINX Unit modules development.
%{__make} %{?_smp_mflags}
%{__make} %{?_smp_mflags} build/libunit.a
%{__mv} build build-debug
+
+PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \
./configure \
%{CONFIGURE_ARGS} \
--modules=%{_libdir}/unit/modules \