summaryrefslogtreecommitdiffhomepage
path: root/pkg/rpm
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/rpm')
-rw-r--r--pkg/rpm/Makefile49
-rw-r--r--pkg/rpm/Makefile.go4
-rw-r--r--pkg/rpm/Makefile.python276
-rw-r--r--pkg/rpm/Makefile.python31057
-rw-r--r--pkg/rpm/Makefile.python3114
-rw-r--r--pkg/rpm/Makefile.python364
-rw-r--r--pkg/rpm/Makefile.python372
-rw-r--r--pkg/rpm/Makefile.python392
-rw-r--r--pkg/rpm/Makefile.wasm22
-rw-r--r--pkg/rpm/rpmbuild/SOURCES/unit.example-python310-config16
-rw-r--r--pkg/rpm/rpmbuild/SOURCES/unit.service5
-rw-r--r--pkg/rpm/unit.module.spec.in12
-rw-r--r--pkg/rpm/unit.spec.in8
13 files changed, 27 insertions, 164 deletions
diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile
index 1f3bbd58..f00b336a 100644
--- a/pkg/rpm/Makefile
+++ b/pkg/rpm/Makefile
@@ -10,9 +10,7 @@ RELEASE ?= $(DEFAULT_RELEASE)
PACKAGE_VENDOR = NGINX Packaging <nginx-packaging@f5.com>
-ifeq ($(shell test `rpm --eval '0%{?rhel} -eq 7 -a 0%{?amzn} -eq 0'`; echo $$?), 0)
-OSVER = centos7
-else ifeq ($(shell rpm --eval "%{?rhel}"), 8)
+ifeq ($(shell rpm --eval "%{?rhel}"), 8)
OSVER = centos8
else ifeq ($(shell rpm --eval "%{?rhel}"), 9)
OSVER = centos9
@@ -20,19 +18,11 @@ else ifeq ($(shell rpm --eval "%{?amzn}"), 2)
OSVER = amazonlinux2
else ifeq ($(shell rpm --eval "%{?amzn}"), 2023)
OSVER = amazonlinux2023
-else ifeq ($(shell test `rpm --eval '0%{?fedora} -ge 35 -a 0%{?fedora} -le 36'`; echo $$?),0)
-OSVER = fedora
-else ifeq ($(shell test `rpm --eval '0%{?fedora} -ge 37 -a 0%{?fedora} -le 38'`; echo $$?),0)
-OSVER = fedora37
else ifeq ($(shell test `rpm --eval '0%{?fedora} -ge 39'`; echo $$?),0)
OSVER = fedora39
endif
-BUILD_DEPENDS_unit = gcc rpm-build rpmlint
-
-ifeq ($(OSVER), centos7)
-BUILD_DEPENDS_unit += which
-endif
+BUILD_DEPENDS_unit = gcc rpm-build rpmlint clang llvm
ifneq (,$(findstring $(OSVER),amazonlinux2))
BUILD_DEPENDS_unit += libxml2 libxslt openssl11-devel
@@ -44,17 +34,6 @@ BUILD_DEPENDS = $(BUILD_DEPENDS_unit)
MODULES=
-ifeq ($(OSVER), centos7)
-include Makefile.php
-include Makefile.python27
-include Makefile.python36
-include Makefile.go
-include Makefile.perl
-include Makefile.jsc-common
-include Makefile.jsc8
-include Makefile.jsc11
-endif
-
ifeq ($(OSVER), centos8)
include Makefile.php
include Makefile.python27
@@ -102,30 +81,6 @@ include Makefile.jsc17
include Makefile.wasm
endif
-ifeq ($(OSVER), fedora)
-include Makefile.php
-include Makefile.python310
-include Makefile.go
-include Makefile.perl
-include Makefile.ruby
-include Makefile.jsc-common
-include Makefile.jsc8
-include Makefile.jsc11
-include Makefile.wasm
-endif
-
-ifeq ($(OSVER), fedora37)
-include Makefile.php
-include Makefile.python311
-include Makefile.go
-include Makefile.perl
-include Makefile.ruby
-include Makefile.jsc-common
-include Makefile.jsc8
-include Makefile.jsc11
-include Makefile.wasm
-endif
-
ifeq ($(OSVER), fedora39)
include Makefile.php
include Makefile.python312
diff --git a/pkg/rpm/Makefile.go b/pkg/rpm/Makefile.go
index aacbe2b9..335b207a 100644
--- a/pkg/rpm/Makefile.go
+++ b/pkg/rpm/Makefile.go
@@ -13,11 +13,7 @@ MODULE_INSTARGS_go= go-install-src
MODULE_SOURCES_go= unit.example-go-app \
unit.example-go-config
-ifeq ($(OSVER), centos6)
-BUILD_DEPENDS_go= epel-release golang
-else
BUILD_DEPENDS_go= golang
-endif
BUILD_DEPENDS+= $(BUILD_DEPENDS_go)
diff --git a/pkg/rpm/Makefile.python27 b/pkg/rpm/Makefile.python27
index 3de5f634..aeb1248f 100644
--- a/pkg/rpm/Makefile.python27
+++ b/pkg/rpm/Makefile.python27
@@ -13,9 +13,9 @@ MODULE_INSTARGS_python27= python2.7-install
MODULE_SOURCES_python27= unit.example-python-app \
unit.example-python27-config
-ifneq (,$(findstring $(OSVER),fedora centos8))
+ifneq (,$(findstring $(OSVER),centos8))
BUILD_DEPENDS_python27= python2-devel
-else ifneq (,$(findstring $(OSVER),centos7 amazonlinux2))
+else ifneq (,$(findstring $(OSVER),amazonlinux2))
BUILD_DEPENDS_python27= python-devel
else
BUILD_DEPENDS_python27= python27-devel
@@ -24,7 +24,7 @@ endif
BUILD_DEPENDS+= $(BUILD_DEPENDS_python27)
define MODULE_DEFINITIONS_python27
-%if (0%{?rhel} == 7) || (0%{?amzn} == 2)
+%if 0%{?amzn} == 2
Obsoletes: unit-python
%endif
endef
diff --git a/pkg/rpm/Makefile.python310 b/pkg/rpm/Makefile.python310
deleted file mode 100644
index 50731475..00000000
--- a/pkg/rpm/Makefile.python310
+++ /dev/null
@@ -1,57 +0,0 @@
-MODULES+= python310
-MODULE_SUFFIX_python310= python3.10
-
-MODULE_SUMMARY_python310= Python 3.10 module for NGINX Unit
-
-MODULE_VERSION_python310= $(VERSION)
-MODULE_RELEASE_python310= 1
-
-MODULE_CONFARGS_python310= python --config=python3.10-config
-MODULE_MAKEARGS_python310= python3.10
-MODULE_INSTARGS_python310= python3.10-install
-
-MODULE_SOURCES_python310= unit.example-python-app \
- unit.example-python310-config
-
-ifneq (,$(findstring $(OSVER),fedora amazonlinux2))
-BUILD_DEPENDS_python310= python3-devel
-else
-BUILD_DEPENDS_python310= python310-devel
-endif
-
-BUILD_DEPENDS+= $(BUILD_DEPENDS_python310)
-
-define MODULE_PREINSTALL_python310
-%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-python310/examples/python-app
-%{__install} -m 644 -p %{SOURCE100} \
- %{buildroot}%{_datadir}/doc/unit-python310/examples/python-app/wsgi.py
-%{__install} -m 644 -p %{SOURCE101} \
- %{buildroot}%{_datadir}/doc/unit-python310/examples/unit.config
-endef
-export MODULE_PREINSTALL_python310
-
-define MODULE_FILES_python310
-%{_libdir}/unit/modules/*
-%{_libdir}/unit/debug-modules/*
-endef
-export MODULE_FILES_python310
-
-define MODULE_POST_python310
-cat <<BANNER
-----------------------------------------------------------------------
-
-The $(MODULE_SUMMARY_python310) has been installed.
-
-To check the sample app, run these commands:
-
- sudo service unit start
- cd /usr/share/doc/%{name}/examples
- sudo curl -X PUT --data-binary @unit.config --unix-socket /var/run/unit/control.sock http://localhost/config
- curl http://localhost:8400/
-
-Online documentation is available at https://unit.nginx.org
-
-----------------------------------------------------------------------
-BANNER
-endef
-export MODULE_POST_python310
diff --git a/pkg/rpm/Makefile.python311 b/pkg/rpm/Makefile.python311
index ae58d722..10c9c69b 100644
--- a/pkg/rpm/Makefile.python311
+++ b/pkg/rpm/Makefile.python311
@@ -13,11 +13,7 @@ MODULE_INSTARGS_python311= python3.11-install
MODULE_SOURCES_python311= unit.example-python-app \
unit.example-python311-config
-ifneq (,$(findstring $(OSVER),fedora37))
-BUILD_DEPENDS_python311= python3-devel
-else
BUILD_DEPENDS_python311= python3.11-devel
-endif
BUILD_DEPENDS+= $(BUILD_DEPENDS_python311)
diff --git a/pkg/rpm/Makefile.python36 b/pkg/rpm/Makefile.python36
index c1fc8b6c..7019b819 100644
--- a/pkg/rpm/Makefile.python36
+++ b/pkg/rpm/Makefile.python36
@@ -13,11 +13,7 @@ MODULE_INSTARGS_python36= python3.6-install
MODULE_SOURCES_python36= unit.example-python-app \
unit.example-python36-config
-ifneq (,$(findstring $(OSVER),fedora centos7))
-BUILD_DEPENDS_python36= python3-devel
-else
BUILD_DEPENDS_python36= python36-devel
-endif
BUILD_DEPENDS+= $(BUILD_DEPENDS_python36)
diff --git a/pkg/rpm/Makefile.python37 b/pkg/rpm/Makefile.python37
index c0604fd9..1feae6a4 100644
--- a/pkg/rpm/Makefile.python37
+++ b/pkg/rpm/Makefile.python37
@@ -13,7 +13,7 @@ MODULE_INSTARGS_python37= python3.7-install
MODULE_SOURCES_python37= unit.example-python-app \
unit.example-python37-config
-ifneq (,$(findstring $(OSVER),fedora amazonlinux2))
+ifneq (,$(findstring $(OSVER),amazonlinux2))
BUILD_DEPENDS_python37= python3-devel
else
BUILD_DEPENDS_python37= python37-devel
diff --git a/pkg/rpm/Makefile.python39 b/pkg/rpm/Makefile.python39
index 7a3ae0b0..25f2a2a8 100644
--- a/pkg/rpm/Makefile.python39
+++ b/pkg/rpm/Makefile.python39
@@ -13,7 +13,7 @@ MODULE_INSTARGS_python39= python3.9-install
MODULE_SOURCES_python39= unit.example-python-app \
unit.example-python39-config
-ifneq (,$(findstring $(OSVER),fedora amazonlinux2 amazonlinux2023 centos9))
+ifneq (,$(findstring $(OSVER),amazonlinux2 amazonlinux2023 centos9))
BUILD_DEPENDS_python39= python3-devel
else
BUILD_DEPENDS_python39= python39-devel
diff --git a/pkg/rpm/Makefile.wasm b/pkg/rpm/Makefile.wasm
index cb2ad35a..fe5c6808 100644
--- a/pkg/rpm/Makefile.wasm
+++ b/pkg/rpm/Makefile.wasm
@@ -6,13 +6,18 @@ 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 \&\& ./configure wasm-wasi-component
-MODULE_MAKEARGS_wasm= wasm wasm-wasi-component CFLAGS=\"\$$(grep ^CFLAGS build/Makefile | cut -d' ' -f 3-) -Wno-missing-prototypes\"
-MODULE_INSTARGS_wasm= wasm-install wasm-wasi-component-install
+MODULE_CONFARGS_wasm= wasm-wasi-component
+MODULE_MAKEARGS_wasm= wasm-wasi-component CFLAGS=\"\$$(grep ^CFLAGS build/Makefile | cut -d' ' -f 3-) -Wno-missing-prototypes\"
+MODULE_INSTARGS_wasm= wasm-wasi-component-install
+
+ifeq (,$(findstring $(OSVER),amazonlinux2))
+MODULE_CONFARGS_wasm+= \&\& ./configure wasm --include-path=\`pwd\`/pkg/contrib/wasmtime/artifacts/include --lib-path=\`pwd\`/pkg/contrib/wasmtime/artifacts/lib
+MODULE_MAKEARGS_wasm+= wasm
+MODULE_INSTARGS_wasm+= wasm-install
MODULE_SOURCES_wasm=
-BUILD_DEPENDS_wasm=
+BUILD_DEPENDS_wasm= cmake
BUILD_DEPENDS+= $(BUILD_DEPENDS_wasm)
@@ -22,16 +27,23 @@ endef
export MODULE_PREBUILD_wasm
define MODULE_PREINSTALL_wasm
+\# brp-mangle-shebangs parses all executable files for a shebang
+\# this fails on a vendored code that somehow ships with exec bit enabled
+find pkg/contrib/wasmtime/ -type f -executable -name "*.rs" | xargs chmod -x
endef
export MODULE_PREINSTALL_wasm
define MODULE_POSTINSTALL_wasm
-%{__install} -m 755 -p pkg/contrib/wasmtime/target/release/libwasmtime.so %{buildroot}%{_libdir}/
+%{__install} -m 755 -p pkg/contrib/wasmtime/artifacts/lib/libwasmtime.so %{buildroot}%{_libdir}/
endef
export MODULE_POSTINSTALL_wasm
+endif
define MODULE_FILES_wasm
+%if 0%{?amzn2}
+%else
%{_libdir}/libwasmtime.so
+%endif
%{_libdir}/unit/modules/*
%{_libdir}/unit/debug-modules/*
endef
diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.example-python310-config b/pkg/rpm/rpmbuild/SOURCES/unit.example-python310-config
deleted file mode 100644
index 8a73ca53..00000000
--- a/pkg/rpm/rpmbuild/SOURCES/unit.example-python310-config
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "applications": {
- "example_python": {
- "type": "python 3.10",
- "processes": 2,
- "path": "/usr/share/doc/unit-python310/examples/python-app",
- "module": "wsgi"
- }
- },
-
- "listeners": {
- "*:8400": {
- "pass": "applications/example_python"
- }
- }
-}
diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.service b/pkg/rpm/rpmbuild/SOURCES/unit.service
index 6df00fbb..f52d96da 100644
--- a/pkg/rpm/rpmbuild/SOURCES/unit.service
+++ b/pkg/rpm/rpmbuild/SOURCES/unit.service
@@ -15,12 +15,13 @@ Wants=network-online.target
After=network-online.target
[Service]
-Type=simple
+Type=forking
Environment="UNITD_OPTIONS=--log /var/log/unit/unit.log --pid /var/run/unit/unit.pid"
-ExecStart=/usr/sbin/unitd $UNITD_OPTIONS --no-daemon
+ExecStart=/usr/sbin/unitd $UNITD_OPTIONS
ExecReload=
RuntimeDirectory=unit
RuntimeDirectoryMode=0755
+PIDFile=/run/unit/unit.pid
[Install]
WantedBy=multi-user.target
diff --git a/pkg/rpm/unit.module.spec.in b/pkg/rpm/unit.module.spec.in
index b3d5d94b..7d1d1b0e 100644
--- a/pkg/rpm/unit.module.spec.in
+++ b/pkg/rpm/unit.module.spec.in
@@ -1,10 +1,6 @@
# distribution specific definitions
%define bdir %{_builddir}/%{name}-%{version}
-%if (0%{?rhel} == 7 && 0%{?amzn} == 0)
-%define dist .el7
-%endif
-
%%MODULE_DEFINITIONS%%
%if 0%{?rhel}%{?fedora}
@@ -30,13 +26,10 @@ Release: %%RELEASE%%%{?dist}.ngx
License: ASL 2.0
Vendor: %%PACKAGE_VENDOR%%
URL: https://unit.nginx.org/
-Group: System Environment/Daemons
Source0: unit-%{version}.tar.gz
%%MODULE_SOURCES%%
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
BuildRequires: pcre2-devel
Requires: unit-r%%UNIT_VERSION%%
@@ -77,7 +70,6 @@ make %%MODULE_MAKEARGS%%
%{__mv} build build-nodebug
%install
-%{__rm} -rf %{buildroot}
%{__mkdir} -p %{buildroot}%{_datadir}/doc/%%NAME%%
if [ `basename %{SOURCE100}` == COPYRIGHT.%{name} ]; then
%{__install} -m 644 -p %{SOURCE100} \
@@ -100,16 +92,12 @@ cd %{bdir}
grep -v 'usr/src' debugfiles.list > debugfiles.list.new && mv debugfiles.list.new debugfiles.list
cat /dev/null > debugsources.list
-%clean
-%{__rm} -rf %{buildroot}
-
%post
if [ $1 -eq 1 ]; then
%%MODULE_POST%%
fi
%files
-%defattr(-,root,root,-)
%dir %{_datadir}/doc/%%NAME%%
%{_datadir}/doc/%%NAME%%/*
%%MODULE_FILES%%
diff --git a/pkg/rpm/unit.spec.in b/pkg/rpm/unit.spec.in
index 01323650..9360ff7e 100644
--- a/pkg/rpm/unit.spec.in
+++ b/pkg/rpm/unit.spec.in
@@ -31,7 +31,6 @@ Release: %%RELEASE%%%{?dist}.ngx
License: ASL 2.0
Vendor: %%PACKAGE_VENDOR%%
URL: https://unit.nginx.org/
-Group: System Environment/Daemons
Source0: unit-%{version}.tar.gz
Source1: unit.service
@@ -39,7 +38,6 @@ Source2: unit-debug.service
Source3: unit.example.config
Source4: unit.logrotate
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: systemd
Requires(post): systemd
Requires(preun): systemd
@@ -68,7 +66,6 @@ dynamically via an API.
Summary: NGINX Unit (development files)
Version: %%VERSION%%
Release: %%RELEASE%%%{?dist}.ngx
-Group: Development/Libraries
Requires: unit == %%VERSION%%-%%RELEASE%%%{?dist}.ngx
%description devel
Library and include files required for NGINX Unit modules development.
@@ -106,7 +103,6 @@ PKG_CONFIG_PATH=%{bdir}/pkg/contrib/njs/build \
%endif
%install
-%{__rm} -rf %{buildroot}
%{__ln_s} build-nodebug build
DESTDIR=%{buildroot} make unitd-install libunit-install manpage-install
%{__mkdir} -p %{buildroot}%{_bindir}
@@ -160,9 +156,6 @@ cd %{bdir}
grep -v 'usr/src' debugfiles.list > debugfiles.list.new && mv debugfiles.list.new debugfiles.list
cat /dev/null > debugsources.list
-%clean
-%{__rm} -rf %{buildroot}
-
%post
getent group unit >/dev/null || groupadd -r unit
getent passwd unit >/dev/null || \
@@ -213,7 +206,6 @@ More info: https://unit.nginx.org/installation/#official-packages
BANNER
%files
-%defattr(-,root,root,-)
%attr(0755,root,root) %{_bindir}/unitc
%attr(0755,root,root) %{_bindir}/setup-unit
%attr(0755,root,root) %{_sbindir}/unitd