Skip to content

Commit 24e3f17

Browse files
committed
Packages: added njs support.
1 parent 11c6694 commit 24e3f17

File tree

5 files changed

+30
-8
lines changed

5 files changed

+30
-8
lines changed

pkg/deb/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ include Makefile.jsc-common
115115
include Makefile.jsc11
116116
endif
117117

118-
CONFIGURE_ARGS=\
118+
CONFIGURE_ARGS_COMMON=\
119119
--prefix=/usr \
120120
--state=/var/lib/unit \
121121
--control="unix:/var/run/control.unit.sock" \
@@ -127,6 +127,10 @@ CONFIGURE_ARGS=\
127127
--tests \
128128
--openssl
129129

130+
CONFIGURE_ARGS=\
131+
$(CONFIGURE_ARGS_COMMON) \
132+
--njs
133+
130134
export CR=\\n
131135

132136
default:
@@ -195,7 +199,7 @@ endif
195199
debuild/unit_$(VERSION).orig.tar.gz: | debuild/$(SRCDIR)/debian
196200
cd ../.. && tar -czf pkg/deb/debuild/$(SRCDIR).tar.gz \
197201
--transform "s#^#$(SRCDIR)/#" \
198-
LICENSE NOTICE CHANGES README.md CONTRIBUTING.md configure auto src test version go docs/man/unitd.8.in
202+
LICENSE NOTICE CHANGES README.md CONTRIBUTING.md configure auto src test version go pkg/contrib docs/man/unitd.8.in
199203
mv debuild/$(SRCDIR).tar.gz debuild/unit_$(VERSION).orig.tar.gz
200204
cd debuild && tar zxf unit_$(VERSION).orig.tar.gz
201205

@@ -257,7 +261,7 @@ endif
257261
-e "s#%%CODENAME%%#$(CODENAME)#g" \
258262
-e "s#%%UNIT_VERSION%%#$(VERSION)#g" \
259263
-e "s#%%UNIT_RELEASE%%#$(RELEASE)#g" \
260-
-e "s#%%CONFIGURE_ARGS%%#$(CONFIGURE_ARGS)#g" \
264+
-e "s#%%CONFIGURE_ARGS%%#$(CONFIGURE_ARGS_COMMON)#g" \
261265
-e "s#%%MODULE_CONFARGS%%#$(MODULE_CONFARGS_$*)#g" \
262266
-e "s#%%MODULE_MAKEARGS%%#$(MODULE_MAKEARGS_$*)#g" \
263267
-e "s#%%MODULE_INSTARGS%%#$(MODULE_INSTARGS_$*)#g" \

pkg/deb/debian/control.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ Maintainer: %%PACKAGE_VENDOR%%
55
Build-Depends: debhelper (>= 11),
66
linux-libc-dev,
77
libssl-dev,
8-
libpcre2-dev
8+
libpcre2-dev,
9+
pkg-config
910
Standards-Version: 4.1.4
1011
Homepage: https://unit.nginx.org
1112

pkg/deb/debian/rules.in

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ BASEDIR = $(CURDIR)
2020

2121
DOTESTS = 0
2222

23-
config.env.%:
23+
njs:
24+
dh_testdir
25+
cd pkg/contrib && make .njs
26+
touch $@
27+
28+
config.env.%: njs
2429
dh_testdir
2530
mkdir -p $(BUILDDIR_$*)
2631
cp -Pa $(CURDIR)/auto $(BUILDDIR_$*)/
@@ -40,6 +45,7 @@ config.env.%:
4045

4146
configure.unit: config.env.unit
4247
cd $(BUILDDIR_unit) && \
48+
PKG_CONFIG_PATH=$(CURDIR)/pkg/contrib/njs/build \
4349
CFLAGS= ./configure \
4450
%%CONFIGURE_ARGS%% \
4551
--modules=/usr/lib/unit/modules \
@@ -50,6 +56,7 @@ configure.unit: config.env.unit
5056

5157
configure.unit_debug: config.env.unit_debug
5258
cd $(BUILDDIR_unit_debug) && \
59+
PKG_CONFIG_PATH=$(CURDIR)/pkg/contrib/njs/build \
5360
CFLAGS= ./configure \
5461
%%CONFIGURE_ARGS%% \
5562
--modules=/usr/lib/unit/debug-modules \

pkg/rpm/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ include Makefile.jsc8
106106
include Makefile.jsc11
107107
endif
108108

109-
CONFIGURE_ARGS=\
109+
CONFIGURE_ARGS_COMMON=\
110110
--prefix=/usr \
111111
--state=%{_sharedstatedir}/unit \
112112
--control="unix:/var/run/unit/control.sock" \
@@ -118,6 +118,10 @@ CONFIGURE_ARGS=\
118118
--tests \
119119
--openssl
120120

121+
CONFIGURE_ARGS=\
122+
$(CONFIGURE_ARGS_COMMON) \
123+
--njs
124+
121125
export CR=\\n
122126

123127
default:
@@ -176,7 +180,7 @@ endif
176180
rpmbuild/SOURCES/unit-$(VERSION).tar.gz:
177181
cd ../.. && tar -czf pkg/rpm/rpmbuild/SOURCES/unit-$(VERSION).tar.gz \
178182
--transform "s#^#unit-$(VERSION)/#" \
179-
LICENSE NOTICE CHANGES README.md CONTRIBUTING.md configure auto src test version go docs/man/unitd.8.in
183+
LICENSE NOTICE CHANGES README.md CONTRIBUTING.md configure auto src test version go pkg/contrib docs/man/unitd.8.in
180184

181185
unit: check-build-depends-unit rpmbuild/SPECS/unit.spec rpmbuild/SOURCES/unit-$(VERSION).tar.gz
182186
@echo "===> Building $@ package" ; \
@@ -212,7 +216,7 @@ rpmbuild/SPECS/unit-%.spec: unit.module.spec.in ../../docs/changes.xml | rpmbuil
212216
-e "s#%%UNIT_RELEASE%%#$(RELEASE)#g" \
213217
-e "s#%%PACKAGE_VENDOR%%#$(PACKAGE_VENDOR)#g" \
214218
-e "s#%%MODULE_SOURCES%%#$${sources}#g" \
215-
-e "s#%%CONFIGURE_ARGS%%#$(CONFIGURE_ARGS)#g" \
219+
-e "s#%%CONFIGURE_ARGS%%#$(CONFIGURE_ARGS_COMMON)#g" \
216220
-e "s#%%MODULE_CONFARGS%%#$(MODULE_CONFARGS_$*)#g" \
217221
-e "s#%%MODULE_MAKEARGS%%#$(MODULE_MAKEARGS_$*)#g" \
218222
-e "s#%%MODULE_INSTARGS%%#$(MODULE_INSTARGS_$*)#g" \

pkg/rpm/unit.spec.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Requires(preun): systemd
4646
Requires(postun): systemd
4747

4848
BuildRequires: pcre2-devel
49+
BuildRequires: pkg-config
4950

5051
Provides: unit-r%{version}
5152

@@ -74,6 +75,9 @@ Library and include files required for NGINX Unit modules development.
7475
%setup -q
7576

7677
%build
78+
%{__make} %{?_smp_mflags} -C pkg/contrib .njs
79+
80+
PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \
7781
./configure \
7882
%{CONFIGURE_ARGS} \
7983
--modules=%{_libdir}/unit/debug-modules \
@@ -84,6 +88,8 @@ Library and include files required for NGINX Unit modules development.
8488
%{__make} %{?_smp_mflags}
8589
%{__make} %{?_smp_mflags} build/libunit.a
8690
%{__mv} build build-debug
91+
92+
PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \
8793
./configure \
8894
%{CONFIGURE_ARGS} \
8995
--modules=%{_libdir}/unit/modules \

0 commit comments

Comments
 (0)