summaryrefslogtreecommitdiffhomepage
path: root/pkg/rpm/Makefile.wasm
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/rpm/Makefile.wasm')
-rw-r--r--pkg/rpm/Makefile.wasm51
1 files changed, 51 insertions, 0 deletions
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