From c814dee7d503a665a9c88ac630d4f8dddd93cf71 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 5 Feb 2021 09:00:28 +0100 Subject: update to 1.22.0 --- unit.spec | 88 ++++++++++++++++++++++++++------------------------------------- 1 file changed, 36 insertions(+), 52 deletions(-) diff --git a/unit.spec b/unit.spec index c45ecfa..05252f2 100644 --- a/unit.spec +++ b/unit.spec @@ -1,24 +1,22 @@ # remirepo/fedora spec file for unit-php # -# Copyright (c) 2019-2020 Remi Collet +# Copyright (c) 2019-2021 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # +%bcond_without tests + %global gh_owner nginx %global project unit -%global gh_commit 9e85732e9a8435b059d627b3c264549c33678f74 +%global gh_commit 98228f8ac878799e8265658d990bbff94675856b %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) -# distribution specific definitions -%global use_systemd (0%{?rhel} >= 7 || 0%{?fedora} >= 19) -%global with_tests 0%{!?_without_tests:1} - Name: unit Summary: NGINX Unit application server -Version: 1.21.0 +Version: 1.22.0 Release: 1%{?dist} License: ASL 2.0 URL: https://unit.nginx.org/ @@ -32,20 +30,14 @@ Source4: unit.logrotate # Use system crypto policy Patch0: https://github.com/nginx/unit/pull/215.patch +BuildRequires: make BuildRequires: gcc BuildRequires: openssl-devel BuildRequires: pcre2-devel -%if %{use_systemd} BuildRequires: systemd -Requires(post): systemd -Requires(preun): systemd -Requires(postun): systemd -%else -Requires(post): chkconfig -Requires(preun): chkconfig -Requires(preun): initscripts -Requires(postun): initscripts -%endif + +%{?systemd_requires} +Requires(pre): /usr/sbin/useradd Requires: logrotate Provides: nginx-unit = %{version}-%{release} @@ -84,15 +76,12 @@ unitconf() { --libdir=%{_libdir} \ --prefix=%{_prefix} \ --state=%{_sharedstatedir}/unit \ -%if %{use_systemd} --control="unix:/run/unit/control.sock" \ --pid=/run/unit/unit.pid \ -%else - --control="unix:/var/run/unit/control.sock" \ - --pid=/var/run/unit/unit.pid \ -%endif --log=/var/log/unit/unit.log \ --tmp=/var/tmp \ + --user=unit \ + --group=unit \ --openssl \ --cc-opt="%{optflags}" \ --tests \ @@ -127,50 +116,48 @@ mkdir -p %{buildroot}%{_localstatedir}/run/%{name} install -p -D -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} # init scripts -%if %{use_systemd} install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service mkdir -p %{buildroot}%{_sysconfdir}/systemd/system/%{name}.service.d -%else -install -p -D -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/unitd -install -p -D -m 0755 %{SOURCE2} %{buildroot}%{_initrddir}/%{name} -%endif - %check -%if %{with_tests} +%if %{with tests} make tests %{?_smp_mflags} ./build/tests %endif +%pre +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 + %post -%if %{use_systemd} %systemd_post %{name}.service -%else -/sbin/chkconfig --add unit -%endif %preun -%if %{use_systemd} %systemd_preun %{name}.service -%else -if [ $1 -eq 0 ]; then - /sbin/service unit stop >/dev/null 2>&1 - /sbin/chkconfig --del unit -fi -%endif %postun -%if %{use_systemd} %systemd_postun_with_restart %{name}.service -%else -if [ $1 -ge 1 ]; then - /sbin/service unit condrestart >/dev/null 2>&1 ||: -fi -%endif +%triggerpostun -- unit < 1.22.0 +cat < - 1.22.0-1 +- update to 1.22.0 + * Fri Nov 20 2020 Remi Collet - 1.21.0-1 - update to 1.21.0 -- cgit