diff options
Diffstat (limited to 'pkg/rpm')
-rw-r--r-- | pkg/rpm/Makefile | 10 | ||||
-rw-r--r-- | pkg/rpm/Makefile.wasm | 51 | ||||
-rw-r--r-- | pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc11 | 11 | ||||
-rw-r--r-- | pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc8 | 11 | ||||
-rw-r--r-- | pkg/rpm/unit.module.spec.in | 1 | ||||
-rw-r--r-- | pkg/rpm/unit.spec.in | 18 |
6 files changed, 94 insertions, 8 deletions
diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index d3cc34bd..355f8a59 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -64,6 +64,7 @@ include Makefile.perl include Makefile.jsc-common include Makefile.jsc8 include Makefile.jsc11 +include Makefile.wasm endif ifeq ($(OSVER), centos9) @@ -74,6 +75,7 @@ include Makefile.perl include Makefile.jsc-common include Makefile.jsc8 include Makefile.jsc11 +include Makefile.wasm endif ifeq ($(OSVER), amazonlinux2) @@ -84,6 +86,7 @@ include Makefile.go include Makefile.perl include Makefile.jsc-common include Makefile.jsc8 +include Makefile.wasm endif ifeq ($(OSVER), amazonlinux2023) @@ -94,6 +97,7 @@ include Makefile.go include Makefile.perl include Makefile.jsc-common include Makefile.jsc17 +include Makefile.wasm endif ifeq ($(OSVER), fedora) @@ -105,6 +109,7 @@ include Makefile.ruby include Makefile.jsc-common include Makefile.jsc8 include Makefile.jsc11 +include Makefile.wasm endif ifeq ($(OSVER), fedora37) @@ -116,13 +121,16 @@ include Makefile.ruby include Makefile.jsc-common include Makefile.jsc8 include Makefile.jsc11 +include Makefile.wasm endif CONFIGURE_ARGS_COMMON=\ --prefix=/usr \ --statedir=%{_sharedstatedir}/unit \ --control="unix:/var/run/unit/control.sock" \ + --runstatedir=/var/run \ --pid=/var/run/unit/unit.pid \ + --logdir=/var/log \ --log=/var/log/unit/unit.log \ --tmpdir=/var/tmp \ --user=unit \ @@ -216,6 +224,7 @@ rpmbuild/SPECS/unit-%.spec: unit.module.spec.in ../../docs/changes.xml | rpmbuil done ; \ pkgname=$(shell echo $@ | cut -d '/' -f 3 | tr '_' '-' | cut -d '.' -f 1) ; \ definitions=`echo "$$MODULE_DEFINITIONS_$*" | sed -e ':a' -e 'N' -e '$$!ba' -e "s/\n/\$$CR/g"` ; \ + prebuild=`echo "$$MODULE_PREBUILD_$*" | sed -e ':a' -e 'N' -e '$$!ba' -e "s/\n/\$$CR/g"` ; \ preinstall=`echo "$$MODULE_PREINSTALL_$*" | sed -e ':a' -e 'N' -e '$$!ba' -e "s/\n/\$$CR/g"` ; \ postinstall=`echo "$$MODULE_POSTINSTALL_$*" | sed -e ':a' -e 'N' -e '$$!ba' -e "s/\n/\$$CR/g"` ; \ files=`echo "$$MODULE_FILES_$*" | sed -e ':a' -e 'N' -e '$$!ba' -e "s/\n/\$$CR/g"` ; \ @@ -234,6 +243,7 @@ rpmbuild/SPECS/unit-%.spec: unit.module.spec.in ../../docs/changes.xml | rpmbuil -e "s#%%MODULE_MAKEARGS%%#$(MODULE_MAKEARGS_$*)#g" \ -e "s#%%MODULE_INSTARGS%%#$(MODULE_INSTARGS_$*)#g" \ -e "s#%%MODULE_DEFINITIONS%%#$${definitions}#g" \ + -e "s#%%MODULE_PREBUILD%%#$${prebuild}#g" \ -e "s#%%MODULE_PREINSTALL%%#$${preinstall}#g" \ -e "s#%%MODULE_POSTINSTALL%%#$${postinstall}#g" \ -e "s#%%MODULE_FILES%%#$${files}#g" \ diff --git a/pkg/rpm/Makefile.wasm b/pkg/rpm/Makefile.wasm new file mode 100644 index 00000000..c638071b --- /dev/null +++ b/pkg/rpm/Makefile.wasm @@ -0,0 +1,51 @@ +MODULES+= wasm +MODULE_SUFFIX_wasm= wasm + +MODULE_SUMMARY_wasm= WASM module for NGINX Unit + +MODULE_VERSION_wasm= $(VERSION) +MODULE_RELEASE_wasm= 1 + +MODULE_CONFARGS_wasm= wasm --include-path=\`pwd\`/pkg/contrib/wasmtime/crates/c-api/include --lib-path=\`pwd\`/pkg/contrib/wasmtime/target/release +MODULE_MAKEARGS_wasm= wasm +MODULE_INSTARGS_wasm= wasm-install + +MODULE_SOURCES_wasm= + +BUILD_DEPENDS_wasm= + +BUILD_DEPENDS+= $(BUILD_DEPENDS_wasm) + +define MODULE_PREBUILD_wasm +%{__make} -C pkg/contrib .wasmtime +endef +export MODULE_PREBUILD_wasm + +define MODULE_PREINSTALL_wasm +endef +export MODULE_PREINSTALL_wasm + +define MODULE_POSTINSTALL_wasm +%{__install} -m 755 -p pkg/contrib/wasmtime/target/release/libwasmtime.so %{buildroot}%{_libdir}/ +endef +export MODULE_POSTINSTALL_wasm + +define MODULE_FILES_wasm +%{_libdir}/libwasmtime.so +%{_libdir}/unit/modules/* +%{_libdir}/unit/debug-modules/* +endef +export MODULE_FILES_wasm + +define MODULE_POST_wasm +cat <<BANNER +---------------------------------------------------------------------- + +The $(MODULE_SUMMARY_wasm) has been installed. + +Online documentation is available at https://unit.nginx.org + +---------------------------------------------------------------------- +BANNER +endef +export MODULE_POST_wasm diff --git a/pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc11 b/pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc11 index b08fcc34..4505b5b5 100644 --- a/pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc11 +++ b/pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc11 @@ -1,12 +1,15 @@ NGINX Unit. - Copyright 2017-2022 NGINX, Inc. + Copyright 2017-2023 NGINX, Inc. + Copyright 2017-2023 Andrei Zeliankou + Copyright 2018-2023 Konstantin Pavlov + Copyright 2021-2023 Zhidao Hong + Copyright 2021-2023 Alejandro Colomar + Copyright 2022-2023 Andrew Clayton + Copyright 2022-2023 Liam Crilly Copyright 2017-2022 Valentin V. Bartenev Copyright 2017-2022 Max Romanov - Copyright 2017-2022 Andrei Zeliankou - Copyright 2018-2022 Konstantin Pavlov - Copyright 2021-2022 Zhidao Hong Copyright 2021-2022 Oisín Canty Copyright 2017-2021 Igor Sysoev Copyright 2017-2021 Andrei Belov diff --git a/pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc8 b/pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc8 index 5e31863d..59891951 100644 --- a/pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc8 +++ b/pkg/rpm/rpmbuild/SOURCES/COPYRIGHT.unit-jsc8 @@ -1,12 +1,15 @@ NGINX Unit. - Copyright 2017-2022 NGINX, Inc. + Copyright 2017-2023 NGINX, Inc. + Copyright 2017-2023 Andrei Zeliankou + Copyright 2018-2023 Konstantin Pavlov + Copyright 2021-2023 Zhidao Hong + Copyright 2021-2023 Alejandro Colomar + Copyright 2022-2023 Andrew Clayton + Copyright 2022-2023 Liam Crilly Copyright 2017-2022 Valentin V. Bartenev Copyright 2017-2022 Max Romanov - Copyright 2017-2022 Andrei Zeliankou - Copyright 2018-2022 Konstantin Pavlov - Copyright 2021-2022 Zhidao Hong Copyright 2021-2022 Oisín Canty Copyright 2017-2021 Igor Sysoev Copyright 2017-2021 Andrei Belov diff --git a/pkg/rpm/unit.module.spec.in b/pkg/rpm/unit.module.spec.in index 04323afc..b3d5d94b 100644 --- a/pkg/rpm/unit.module.spec.in +++ b/pkg/rpm/unit.module.spec.in @@ -59,6 +59,7 @@ This package contains %%SUMMARY%%. tar --strip-components=1 -zxf %{SOURCE0} %build +%%MODULE_PREBUILD%% ./configure \ %{CONFIGURE_ARGS} \ --modulesdir=%{_libdir}/unit/debug-modules \ diff --git a/pkg/rpm/unit.spec.in b/pkg/rpm/unit.spec.in index 14a2ea00..01323650 100644 --- a/pkg/rpm/unit.spec.in +++ b/pkg/rpm/unit.spec.in @@ -47,6 +47,8 @@ Requires(postun): systemd BuildRequires: pcre2-devel BuildRequires: pkgconfig +BuildRequires: clang +BuildRequires: llvm Provides: unit-r%{version} @@ -99,6 +101,10 @@ PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \ %{__make} %{?_smp_mflags} %{__mv} build build-nodebug +%if (0%{?fedora}) || (0%{?rhel} >= 8) || (0%{?amzn2}) +%{__make} %{?_smp_mflags} -C pkg/contrib .libunit-wasm +%endif + %install %{__rm} -rf %{buildroot} %{__ln_s} build-nodebug build @@ -136,6 +142,12 @@ DESTDIR=%{buildroot} make unitd-install libunit-install manpage-install %{__install} -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/unit.service %{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/unit-debug.service +%if (0%{?fedora}) || (0%{?rhel} >= 8) || (0%{?amzn2}) +%{__mkdir} -p %{buildroot}%{_includedir}/unit/ +%{__install} -m 644 pkg/contrib/libunit-wasm/src/c/libunit-wasm.a %{buildroot}%{_libdir}/ +%{__install} -m 644 pkg/contrib/libunit-wasm/src/c/include/unit/unit-wasm.h %{buildroot}%{_includedir}/unit/ +%endif + QA_SKIP_BUILD_ROOT=1 export QA_SKIP_BUILD_ROOT @@ -221,6 +233,12 @@ BANNER %files devel %{_libdir}/libunit.a %{_libdir}/libunit-debug.a +%if (0%{?fedora}) || (0%{?rhel} >= 8) || (0%{?amzn2}) +%{_libdir}/libunit-wasm.a +%dir %{_includedir}/unit +%{_includedir}/unit/*.h +%endif %{_includedir}/nxt_*.h +%{_datadir}/pkgconfig/unit.pc %changelog |