From d15acabfc59472457f06563a939be3c97fc6b5d9 Mon Sep 17 00:00:00 2001 From: Andrei Belov Date: Wed, 16 Dec 2020 09:55:59 +0300 Subject: Packages: introduced PYTEST_ARGS env variable for test targets. This is useful for running particular tests, e.g.: PYTEST_ARGS='test/test_respawn.py::TestRespawn::test_respawn_router' make test --- pkg/rpm/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/rpm') diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index 1944d58d..98a8ce97 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -274,7 +274,7 @@ test: unit modules test -h rpmbuild/BUILD/unit-$(VERSION)/build-nodebug/$${soname} || \ ln -fs `pwd`/$${so} rpmbuild/BUILD/unit-$(VERSION)/build-nodebug/$${soname} ; \ done ; \ - ( cd rpmbuild/BUILD/unit-$(VERSION) && rm -f build && ln -s build-nodebug build && env python3 -m pytest ) ; \ + ( cd rpmbuild/BUILD/unit-$(VERSION) && rm -f build && ln -s build-nodebug build && env python3 -m pytest $(PYTEST_ARGS) ) ; \ } test-debug: unit modules @@ -285,7 +285,7 @@ test-debug: unit modules test -h rpmbuild/BUILD/unit-$(VERSION)/build-debug/$${soname} || \ ln -fs `pwd`/$${so} rpmbuild/BUILD/unit-$(VERSION)/build-debug/$${soname} ; \ done ; \ - ( cd rpmbuild/BUILD/unit-$(VERSION) && rm -f build && ln -s build-debug build && env python3 -m pytest ) ; \ + ( cd rpmbuild/BUILD/unit-$(VERSION) && rm -f build && ln -s build-debug build && env python3 -m pytest $(PYTEST_ARGS) ) ; \ } clean: -- cgit From 9c09bc17726ccb2ab769faec6aacbe38db1b2e0f Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Tue, 24 Nov 2020 13:25:09 +0300 Subject: Packages: dropped support for non-systemd distributions. --- pkg/rpm/rpmbuild/SOURCES/unit.init | 88 ----------------------------------- pkg/rpm/rpmbuild/SOURCES/unit.sysconf | 1 - pkg/rpm/unit.spec.in | 58 ++++------------------- 3 files changed, 8 insertions(+), 139 deletions(-) delete mode 100644 pkg/rpm/rpmbuild/SOURCES/unit.init delete mode 100644 pkg/rpm/rpmbuild/SOURCES/unit.sysconf (limited to 'pkg/rpm') diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.init b/pkg/rpm/rpmbuild/SOURCES/unit.init deleted file mode 100644 index e1aacd81..00000000 --- a/pkg/rpm/rpmbuild/SOURCES/unit.init +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -# -# unitd NGINX Unit -# -# chkconfig: - 86 14 -# description: NGINX Unit - -### BEGIN INIT INFO -# Provides: unitd -# Required-Start: $local_fs $network $named $syslog -# Required-Stop: $local_fs $network $named $syslog -# Default-Start: -# Default-Stop: 0 1 2 3 4 5 6 -# Short-Description: NGINX Unit -# Description: NGINX Unit -### END INIT INFO - -# Source function library. -. /etc/rc.d/init.d/functions - -exec="/usr/sbin/unitd" -prog="unitd" - -[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog - -lockfile=/var/lock/subsys/$prog - -start() { - [ -x $exec ] || exit 5 - echo -n $"Starting $prog: " - daemon $exec $UNITD_OPTIONS - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile - return $retval -} - -stop() { - echo -n $"Stopping $prog: " - killproc $prog - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile - return $retval -} - -restart() { - stop - start -} - -rh_status() { - status $prog -} - -rh_status_q() { - rh_status &>/dev/null -} - - -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload|force-reload) - echo "Not implemented." >&2 - exit 1 - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart}" - exit 2 -esac -exit $? diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.sysconf b/pkg/rpm/rpmbuild/SOURCES/unit.sysconf deleted file mode 100644 index 9146bdac..00000000 --- a/pkg/rpm/rpmbuild/SOURCES/unit.sysconf +++ /dev/null @@ -1 +0,0 @@ -UNITD_OPTIONS="--log /var/log/unit/unit.log --pid /var/run/unit/unit.pid" diff --git a/pkg/rpm/unit.spec.in b/pkg/rpm/unit.spec.in index 7fc950ec..f2a77b61 100644 --- a/pkg/rpm/unit.spec.in +++ b/pkg/rpm/unit.spec.in @@ -1,19 +1,7 @@ # distribution specific definitions -%define use_systemd (0%{?rhel} >= 7 || 0%{?fedora} >= 19 || 0%{?suse_version} >= 1315) %define bdir %{_builddir}/%{name}-%{version} %define dotests 0 -%if ( 0%{?rhel} == 5 || 0%{?rhel} == 6 ) -Requires: initscripts >= 8.36 -%endif - -%if %{use_systemd} -BuildRequires: systemd -Requires(post): systemd -Requires(preun): systemd -Requires(postun): systemd -%endif - %if 0%{?rhel}%{?fedora} BuildRequires: gcc BuildRequires: openssl-devel @@ -48,12 +36,14 @@ Group: System Environment/Daemons Source0: unit-%{version}.tar.gz Source1: unit.service -Source2: unit.init -Source3: unit.sysconf -Source4: unit.example.config -Source5: unit.logrotate +Source2: unit.example.config +Source3: unit.logrotate BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: systemd +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd %description NGINX Unit is a runtime and delivery environment for modern distributed @@ -116,17 +106,12 @@ DESTDIR=%{buildroot} make unitd-install libunit-install %{__mkdir} -p %{buildroot}%{_sharedstatedir}/unit %{__mkdir} -p %{buildroot}%{_localstatedir}/log/unit %{__mkdir} -p %{buildroot}%{_localstatedir}/run/unit -%if ! %{use_systemd} -%{__mkdir} -p %{buildroot}%{_sysconfdir}/sysconfig -%{__install} -m 644 -p %{SOURCE3} \ - %{buildroot}%{_sysconfdir}/sysconfig/unitd -%endif %{__mkdir} -p %{buildroot}%{_sysconfdir}/logrotate.d -%{__install} -m 644 -p %{SOURCE5} \ +%{__install} -m 644 -p %{SOURCE3} \ %{buildroot}%{_sysconfdir}/logrotate.d/unit %{__mkdir} -p %{buildroot}%{_sysconfdir}/unit %{__mkdir} -p %{buildroot}%{_datadir}/doc/unit/examples -%{__install} -m 644 -p %{SOURCE4} \ +%{__install} -m 644 -p %{SOURCE2} \ %{buildroot}%{_datadir}/doc/unit/examples/example.config %{__install} -m 644 -p CHANGES \ %{buildroot}%{_datadir}/doc/unit/ @@ -135,14 +120,8 @@ DESTDIR=%{buildroot} make unitd-install libunit-install %{__install} -m 644 -p README \ %{buildroot}%{_datadir}/doc/unit/ -# init scripts -%if %{use_systemd} %{__rm} -rf %{buildroot}%{_initrddir}/ %{__install} -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/unit.service -%else -%{__mkdir} -p %{buildroot}%{_initrddir} -%{__install} -p -D -m 0755 %{SOURCE2} %{buildroot}%{_initrddir}/unit -%endif QA_SKIP_BUILD_ROOT=1 export QA_SKIP_BUILD_ROOT @@ -164,11 +143,7 @@ cat /dev/null > debugsourcefiles.list %post if [ $1 -eq 1 ]; then -%if %{use_systemd} /usr/bin/systemctl preset unit.service >/dev/null 2>&1 ||: -%else - /sbin/chkconfig --add unit -%endif cat </dev/null 2>&1 ||: /usr/bin/systemctl stop unit.service >/dev/null 2>&1 ||: -%else - /sbin/service unit stop >/dev/null 2>&1 - /sbin/chkconfig --del unit -%endif fi %postun -%if %{use_systemd} /usr/bin/systemctl daemon-reload >/dev/null 2>&1 ||: -%endif if [ $1 -ge 1 ]; then -%if %{use_systemd} /usr/bin/systemctl try-restart unit.service >/dev/null 2>&1 ||: -%else - /sbin/service unit condrestart >/dev/null 2>&1 ||: -%endif fi %files @@ -211,14 +175,8 @@ fi %attr(0755,root,root) %{_sbindir}/unitd %attr(0755,root,root) %{_sbindir}/unitd-debug %dir %{_sysconfdir}/unit -%if %{use_systemd} %{_unitdir}/unit.service %dir %attr(0755,root,root) %ghost %{_localstatedir}/run/unit -%else -%config(noreplace) %{_sysconfdir}/sysconfig/unitd -%dir %attr(0755,root,root) %{_localstatedir}/run/unit -%{_initrddir}/unit -%endif %dir %{_datadir}/doc/unit %{_datadir}/doc/unit/* %dir %{_libdir}/unit/modules -- cgit From a5fa9673d98c9c814c01ddfce8bcfbec6fcc02e8 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Tue, 24 Nov 2020 14:27:06 +0300 Subject: Packages: added pcre2 to build depends. While at it, propagate unit build depends to modules. --- pkg/rpm/unit.module.spec.in | 11 +++++++++++ pkg/rpm/unit.spec.in | 2 ++ 2 files changed, 13 insertions(+) (limited to 'pkg/rpm') diff --git a/pkg/rpm/unit.module.spec.in b/pkg/rpm/unit.module.spec.in index 2ef4ff1b..39083e66 100644 --- a/pkg/rpm/unit.module.spec.in +++ b/pkg/rpm/unit.module.spec.in @@ -7,6 +7,15 @@ %define dist .el7 %endif +%if 0%{?rhel}%{?fedora} +BuildRequires: gcc +BuildRequires: openssl-devel +%endif + +%if 0%{?suse_version} >= 1315 +BuildRequires: libopenssl-devel +%endif + %define unit_version %%UNIT_VERSION%% %define unit_release %%UNIT_RELEASE%%%{?dist}.ngx @@ -29,6 +38,8 @@ Source0: unit-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: pcre2-devel + Requires: unit == %%UNIT_VERSION%%-%%UNIT_RELEASE%%%{?dist}.ngx %description diff --git a/pkg/rpm/unit.spec.in b/pkg/rpm/unit.spec.in index f2a77b61..506d1964 100644 --- a/pkg/rpm/unit.spec.in +++ b/pkg/rpm/unit.spec.in @@ -45,6 +45,8 @@ Requires(post): systemd Requires(preun): systemd Requires(postun): systemd +BuildRequires: pcre2-devel + %description NGINX Unit is a runtime and delivery environment for modern distributed applications. It runs the application code in multiple languages -- cgit From 53d847615b270daf706373d65ac5f5d2101f36d9 Mon Sep 17 00:00:00 2001 From: Andrei Belov Date: Thu, 17 Dec 2020 14:30:18 +0300 Subject: Packages: run non-privileged processes under "unit" user. --- pkg/rpm/Makefile | 2 ++ pkg/rpm/rpmbuild/SOURCES/unit.example-go-config | 1 - pkg/rpm/rpmbuild/SOURCES/unit.example-perl-config | 1 - pkg/rpm/rpmbuild/SOURCES/unit.example-php-config | 1 - pkg/rpm/rpmbuild/SOURCES/unit.example-python-config | 1 - pkg/rpm/rpmbuild/SOURCES/unit.example-python27-config | 1 - pkg/rpm/rpmbuild/SOURCES/unit.example-python34-config | 1 - pkg/rpm/rpmbuild/SOURCES/unit.example-python35-config | 1 - pkg/rpm/rpmbuild/SOURCES/unit.example-python36-config | 1 - pkg/rpm/rpmbuild/SOURCES/unit.example-python37-config | 1 - pkg/rpm/rpmbuild/SOURCES/unit.example-python38-config | 1 - pkg/rpm/rpmbuild/SOURCES/unit.example-ruby-config | 1 - pkg/rpm/rpmbuild/SOURCES/unit.example.config | 4 ---- pkg/rpm/unit.spec.in | 19 +++++++++++++++++++ 14 files changed, 21 insertions(+), 15 deletions(-) (limited to 'pkg/rpm') diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index 98a8ce97..1fefb262 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -149,6 +149,8 @@ CONFIGURE_ARGS=\ --pid=/var/run/unit/unit.pid \ --log=/var/log/unit/unit.log \ --tmp=/var/tmp \ + --user=unit \ + --group=unit \ --tests \ --openssl diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.example-go-config b/pkg/rpm/rpmbuild/SOURCES/unit.example-go-config index a2c91e80..8aa65939 100644 --- a/pkg/rpm/rpmbuild/SOURCES/unit.example-go-config +++ b/pkg/rpm/rpmbuild/SOURCES/unit.example-go-config @@ -2,7 +2,6 @@ "applications": { "example_go": { "type": "external", - "user": "nobody", "executable": "/tmp/go-app" } }, diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.example-perl-config b/pkg/rpm/rpmbuild/SOURCES/unit.example-perl-config index 031928ce..2182fc46 100644 --- a/pkg/rpm/rpmbuild/SOURCES/unit.example-perl-config +++ b/pkg/rpm/rpmbuild/SOURCES/unit.example-perl-config @@ -2,7 +2,6 @@ "applications": { "example_perl": { "type": "perl", - "user": "nobody", "processes": 1, "working_directory": "/usr/share/doc/unit-perl/examples/perl-app", "script": "/usr/share/doc/unit-perl/examples/perl-app/index.pl" diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.example-php-config b/pkg/rpm/rpmbuild/SOURCES/unit.example-php-config index 8f23c984..9673385f 100644 --- a/pkg/rpm/rpmbuild/SOURCES/unit.example-php-config +++ b/pkg/rpm/rpmbuild/SOURCES/unit.example-php-config @@ -2,7 +2,6 @@ "applications": { "example_php": { "type": "php", - "user": "nobody", "processes": 2, "root": "/usr/share/doc/unit-php/examples/phpinfo-app", "index": "index.php" diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.example-python-config b/pkg/rpm/rpmbuild/SOURCES/unit.example-python-config index d612c89d..b3d3a2e5 100644 --- a/pkg/rpm/rpmbuild/SOURCES/unit.example-python-config +++ b/pkg/rpm/rpmbuild/SOURCES/unit.example-python-config @@ -2,7 +2,6 @@ "applications": { "example_python": { "type": "python", - "user": "nobody", "processes": 2, "path": "/usr/share/doc/unit-python/examples/python-app", "module": "wsgi" diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.example-python27-config b/pkg/rpm/rpmbuild/SOURCES/unit.example-python27-config index 7541fcb3..094e6621 100644 --- a/pkg/rpm/rpmbuild/SOURCES/unit.example-python27-config +++ b/pkg/rpm/rpmbuild/SOURCES/unit.example-python27-config @@ -2,7 +2,6 @@ "applications": { "example_python": { "type": "python 2.7", - "user": "nobody", "processes": 2, "path": "/usr/share/doc/unit-python27/examples/python-app", "module": "wsgi" diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.example-python34-config b/pkg/rpm/rpmbuild/SOURCES/unit.example-python34-config index b64e570c..15063c5e 100644 --- a/pkg/rpm/rpmbuild/SOURCES/unit.example-python34-config +++ b/pkg/rpm/rpmbuild/SOURCES/unit.example-python34-config @@ -2,7 +2,6 @@ "applications": { "example_python": { "type": "python 3.4", - "user": "nobody", "processes": 2, "path": "/usr/share/doc/unit-python34/examples/python-app", "module": "wsgi" diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.example-python35-config b/pkg/rpm/rpmbuild/SOURCES/unit.example-python35-config index 025f3428..f9923a49 100644 --- a/pkg/rpm/rpmbuild/SOURCES/unit.example-python35-config +++ b/pkg/rpm/rpmbuild/SOURCES/unit.example-python35-config @@ -2,7 +2,6 @@ "applications": { "example_python": { "type": "python 3.5", - "user": "nobody", "processes": 2, "path": "/usr/share/doc/unit-python35/examples/python-app", "module": "wsgi" diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.example-python36-config b/pkg/rpm/rpmbuild/SOURCES/unit.example-python36-config index 825cabc4..ef31c781 100644 --- a/pkg/rpm/rpmbuild/SOURCES/unit.example-python36-config +++ b/pkg/rpm/rpmbuild/SOURCES/unit.example-python36-config @@ -2,7 +2,6 @@ "applications": { "example_python": { "type": "python 3.6", - "user": "nobody", "processes": 2, "path": "/usr/share/doc/unit-python36/examples/python-app", "module": "wsgi" diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.example-python37-config b/pkg/rpm/rpmbuild/SOURCES/unit.example-python37-config index 7f5e52f1..904af440 100644 --- a/pkg/rpm/rpmbuild/SOURCES/unit.example-python37-config +++ b/pkg/rpm/rpmbuild/SOURCES/unit.example-python37-config @@ -2,7 +2,6 @@ "applications": { "example_python": { "type": "python 3.7", - "user": "nobody", "processes": 2, "path": "/usr/share/doc/unit-python37/examples/python-app", "module": "wsgi" diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.example-python38-config b/pkg/rpm/rpmbuild/SOURCES/unit.example-python38-config index 25003869..c98d1a52 100644 --- a/pkg/rpm/rpmbuild/SOURCES/unit.example-python38-config +++ b/pkg/rpm/rpmbuild/SOURCES/unit.example-python38-config @@ -2,7 +2,6 @@ "applications": { "example_python": { "type": "python 3.8", - "user": "nobody", "processes": 2, "path": "/usr/share/doc/unit-python38/examples/python-app", "module": "wsgi" diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.example-ruby-config b/pkg/rpm/rpmbuild/SOURCES/unit.example-ruby-config index 15a92735..930aa987 100644 --- a/pkg/rpm/rpmbuild/SOURCES/unit.example-ruby-config +++ b/pkg/rpm/rpmbuild/SOURCES/unit.example-ruby-config @@ -2,7 +2,6 @@ "applications": { "example_ruby": { "type": "ruby", - "user": "nobody", "processes": 2, "script": "/usr/share/doc/unit-ruby/examples/ruby-app.ru" } diff --git a/pkg/rpm/rpmbuild/SOURCES/unit.example.config b/pkg/rpm/rpmbuild/SOURCES/unit.example.config index 6fe35e2f..4855a954 100644 --- a/pkg/rpm/rpmbuild/SOURCES/unit.example.config +++ b/pkg/rpm/rpmbuild/SOURCES/unit.example.config @@ -2,7 +2,6 @@ "applications": { "example_php": { "type": "php", - "user": "nobody", "processes": 2, "root": "/usr/share/doc/unit-php/examples/phpinfo-app", "index": "index.php" @@ -10,7 +9,6 @@ "example_python": { "type": "python", - "user": "nobody", "processes": 2, "path": "/usr/share/doc/unit-python/examples/python-app", "module": "wsgi" @@ -18,13 +16,11 @@ "example_go": { "type": "external", - "user": "nobody", "executable": "/tmp/go-app" }, "example_perl": { "type": "perl", - "user": "nobody", "processes": 1, "working_directory": "/usr/share/doc/unit-perl/examples/perl-app", "script": "/usr/share/doc/unit-perl/examples/perl-app/index.pl" diff --git a/pkg/rpm/unit.spec.in b/pkg/rpm/unit.spec.in index 506d1964..15853cf1 100644 --- a/pkg/rpm/unit.spec.in +++ b/pkg/rpm/unit.spec.in @@ -145,6 +145,10 @@ cat /dev/null > debugsourcefiles.list %post if [ $1 -eq 1 ]; then + getent group unit >/dev/null || groupadd -r unit + getent passwd unit >/dev/null || \ + useradd -r -g unit -s /sbin/nologin \ + -d /nonexistent -c "unit user" unit /usr/bin/systemctl preset unit.service >/dev/null 2>&1 ||: cat </dev/null 2>&1 ||: fi +%triggerpostun -- unit < 1.22.0 +cat < Date: Tue, 22 Dec 2020 12:57:24 +0300 Subject: Packages: check and create unit user on each post-script invocation. --- pkg/rpm/unit.spec.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pkg/rpm') diff --git a/pkg/rpm/unit.spec.in b/pkg/rpm/unit.spec.in index 15853cf1..08db73e2 100644 --- a/pkg/rpm/unit.spec.in +++ b/pkg/rpm/unit.spec.in @@ -144,11 +144,11 @@ cat /dev/null > debugsourcefiles.list %{__rm} -rf %{buildroot} %post +getent group unit >/dev/null || groupadd -r unit +getent passwd unit >/dev/null || \ + useradd -r -g unit -s /sbin/nologin \ + -d /nonexistent -c "unit user" unit if [ $1 -eq 1 ]; then - getent group unit >/dev/null || groupadd -r unit - getent passwd unit >/dev/null || \ - useradd -r -g unit -s /sbin/nologin \ - -d /nonexistent -c "unit user" unit /usr/bin/systemctl preset unit.service >/dev/null 2>&1 ||: cat < Date: Wed, 23 Dec 2020 18:31:18 +0300 Subject: Packages: set the "--user" value to "nobody" for build-stage tests. This allows tests to pass well in cases when the default user specified in the ./configure parameters does not exist in the building environment. --- pkg/rpm/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/rpm') diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index 1fefb262..80418149 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -276,7 +276,7 @@ test: unit modules test -h rpmbuild/BUILD/unit-$(VERSION)/build-nodebug/$${soname} || \ ln -fs `pwd`/$${so} rpmbuild/BUILD/unit-$(VERSION)/build-nodebug/$${soname} ; \ done ; \ - ( cd rpmbuild/BUILD/unit-$(VERSION) && rm -f build && ln -s build-nodebug build && env python3 -m pytest $(PYTEST_ARGS) ) ; \ + ( cd rpmbuild/BUILD/unit-$(VERSION) && rm -f build && ln -s build-nodebug build && env python3 -m pytest --user=nobody $(PYTEST_ARGS) ) ; \ } test-debug: unit modules @@ -287,7 +287,7 @@ test-debug: unit modules test -h rpmbuild/BUILD/unit-$(VERSION)/build-debug/$${soname} || \ ln -fs `pwd`/$${so} rpmbuild/BUILD/unit-$(VERSION)/build-debug/$${soname} ; \ done ; \ - ( cd rpmbuild/BUILD/unit-$(VERSION) && rm -f build && ln -s build-debug build && env python3 -m pytest $(PYTEST_ARGS) ) ; \ + ( cd rpmbuild/BUILD/unit-$(VERSION) && rm -f build && ln -s build-debug build && env python3 -m pytest --user=nobody $(PYTEST_ARGS) ) ; \ } clean: -- cgit From c981ac6558440f42670fc0a3d3857a3bb10e1f0a Mon Sep 17 00:00:00 2001 From: Andrei Belov Date: Thu, 24 Dec 2020 16:17:27 +0300 Subject: Packages: fixed an ability to override package version. This was broken since 00d8049418cf. --- pkg/rpm/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/rpm') diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index 80418149..285e0857 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -2,9 +2,10 @@ include ../../version +DEFAULT_VERSION := $(NXT_VERSION) DEFAULT_RELEASE := 1 -VERSION ?= $(NXT_VERSION) +VERSION ?= $(DEFAULT_VERSION) RELEASE ?= $(DEFAULT_RELEASE) ifeq ($(shell test `rpm --eval '0%{?rhel} -eq 6 -a 0%{?amzn} -eq 0'`; echo $$?), 0) -- cgit From e4f7d1a29c59985f291876e2e76852007c2a390a Mon Sep 17 00:00:00 2001 From: Andrei Belov Date: Tue, 26 Jan 2021 13:06:30 +0300 Subject: Packages: added Fedora 33 support. --- pkg/rpm/Makefile | 4 +- pkg/rpm/Makefile.python39 | 57 ++++++++++++++++++++++ .../rpmbuild/SOURCES/unit.example-python39-config | 16 ++++++ 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 pkg/rpm/Makefile.python39 create mode 100644 pkg/rpm/rpmbuild/SOURCES/unit.example-python39-config (limited to 'pkg/rpm') diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile index 285e0857..f0bd0cf9 100644 --- a/pkg/rpm/Makefile +++ b/pkg/rpm/Makefile @@ -128,7 +128,9 @@ include Makefile.php ifeq ($(shell test `rpm --eval '0%{?fedora} -lt 32'`; echo $$?),0) include Makefile.python27 endif -ifeq ($(shell test `rpm --eval '0%{?fedora} -ge 32'`; echo $$?),0) +ifeq ($(shell test `rpm --eval '0%{?fedora} -ge 33'`; echo $$?),0) +include Makefile.python39 +else ifeq ($(shell test `rpm --eval '0%{?fedora} -ge 32'`; echo $$?),0) include Makefile.python38 else ifeq ($(shell test `rpm --eval '0%{?fedora} -ge 29'`; echo $$?),0) include Makefile.python37 diff --git a/pkg/rpm/Makefile.python39 b/pkg/rpm/Makefile.python39 new file mode 100644 index 00000000..8e444e56 --- /dev/null +++ b/pkg/rpm/Makefile.python39 @@ -0,0 +1,57 @@ +MODULES+= python39 +MODULE_SUFFIX_python39= python3.9 + +MODULE_SUMMARY_python39= Python 3.9 module for NGINX Unit + +MODULE_VERSION_python39= $(VERSION) +MODULE_RELEASE_python39= 1 + +MODULE_CONFARGS_python39= python --config=python3.9-config +MODULE_MAKEARGS_python39= python3.9 +MODULE_INSTARGS_python39= python3.9-install + +MODULE_SOURCES_python39= unit.example-python-app \ + unit.example-python39-config + +ifneq (,$(findstring $(OSVER),opensuse-tumbleweed sles fedora amazonlinux2)) +BUILD_DEPENDS_python39= python3-devel +else +BUILD_DEPENDS_python39= python39-devel +endif + +BUILD_DEPENDS+= $(BUILD_DEPENDS_python39) + +define MODULE_PREINSTALL_python39 +%{__mkdir} -p %{buildroot}%{_datadir}/doc/unit-python39/examples/python-app +%{__install} -m 644 -p %{SOURCE100} \ + %{buildroot}%{_datadir}/doc/unit-python39/examples/python-app/wsgi.py +%{__install} -m 644 -p %{SOURCE101} \ + %{buildroot}%{_datadir}/doc/unit-python39/examples/unit.config +endef +export MODULE_PREINSTALL_python39 + +define MODULE_FILES_python39 +%{_libdir}/unit/modules/* +%{_libdir}/unit/debug-modules/* +endef +export MODULE_FILES_python39 + +define MODULE_POST_python39 +cat <